diff --git a/src/ITensorMPS.jl b/src/ITensorMPS.jl index 7343983..e90ec72 100644 --- a/src/ITensorMPS.jl +++ b/src/ITensorMPS.jl @@ -24,8 +24,6 @@ include("deprecated.jl") include("defaults.jl") include("update_observer.jl") include("lattices/lattices.jl") -export Lattice, LatticeBond, square_lattice, triangular_lattice -export TimeDependentSum, dmrg_x, expand, linsolve, tdvp, to_vec include("solvers/ITensorsExtensions.jl") using .ITensorsExtensions: to_vec include("solvers/applyexp.jl") diff --git a/src/exports.jl b/src/exports.jl index e16086b..749a73c 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -38,6 +38,20 @@ export truncerror, val, + # lattices.jl + Lattice, + LatticeBond, + square_lattice, + triangular_lattice, + + # solvers + TimeDependentSum, + dmrg_x, + expand, + linsolve, + tdvp, + to_vec, + # dmrg.jl dmrg, # abstractmps.jl diff --git a/src/imports.jl b/src/imports.jl index a83de90..02411c2 100644 --- a/src/imports.jl +++ b/src/imports.jl @@ -1,3 +1,19 @@ +# Primarily used to import names into the `ITensorMPS` +# module from submodules or from `ITensors` so they can +# be reexported. +using ITensors.SiteTypes: + @OpName_str, + @SiteType_str, + @StateName_str, + @TagType_str, + @ValName_str, + OpName, + SiteType, + StateName, + TagType, + ValName +using ITensors.Ops: Trotter + import Base: # types Array, diff --git a/test/base/test_exports.jl b/test/base/test_exports.jl index 5b84483..429b021 100644 --- a/test/base/test_exports.jl +++ b/test/base/test_exports.jl @@ -9,12 +9,17 @@ using Test: @test, @test_broken, @testset @test issetequal( names(ITensorMPS), TestITensorMPSExportedNames.ITENSORMPS_EXPORTED_NAMES ) + # Test the names are actually defined, if not we might need to import them + # from ITensors.jl. + for name in TestITensorMPSExportedNames.ITENSORMPS_EXPORTED_NAMES + @test isdefined(ITensorMPS, name) + end end @testset "Not exported" begin - for f in + for name in [:AbstractProjMPO, :ProjMPS, :makeL!, :makeR!, :set_terms, :sortmergeterms, :terms] - @test isdefined(ITensorMPS, f) - @test !Base.isexported(ITensorMPS, f) + @test isdefined(ITensorMPS, name) + @test !Base.isexported(ITensorMPS, name) end end end diff --git a/test/base/test_fermions.jl b/test/base/test_fermions.jl index 323a88e..05eed7c 100644 --- a/test/base/test_fermions.jl +++ b/test/base/test_fermions.jl @@ -1,5 +1,7 @@ -using ITensors, Test -import ITensors: Out, In +@eval module $(gensym()) +using ITensorMPS +using ITensors +using Test @testset "AutoFermion MPS, MPO, and OpSum" begin ITensors.enable_auto_fermion() @@ -285,3 +287,4 @@ import ITensors: Out, In ITensors.disable_auto_fermion() end +end diff --git a/test/base/test_mps.jl b/test/base/test_mps.jl index ad79895..65eed0e 100644 --- a/test/base/test_mps.jl +++ b/test/base/test_mps.jl @@ -1,9 +1,9 @@ @eval module $(gensym()) using Combinatorics +using ITensorMPS using ITensors -using ITensors: ITensorMPS -using Random using LinearAlgebra: diag +using Random using Test Random.seed!(1234)