Skip to content

Commit

Permalink
Remove all references to Infinite trait
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Oct 25, 2023
1 parent 4697c96 commit 65c9644
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 83 deletions.
1 change: 0 additions & 1 deletion src/Quantum/MP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ sitealias(::Type{MatrixProduct{P,Open}}, order, n, i) where {P<:Plug} =
order
end
sitealias(::Type{MatrixProduct{P,Periodic}}, order, n, i) where {P<:Plug} = tuple(order...)
sitealias(::Type{MatrixProduct{P,Infinite}}, order, n, i) where {P<:Plug} = tuple(order...)

defaultorder(::Type{<:MatrixProduct{Property}}) = (:l, :r)
defaultorder(::Type{<:MatrixProduct{State}}) = (:l, :r, :o)
Expand Down
1 change: 0 additions & 1 deletion src/Quantum/PEP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function sitealias(::Type{<:ProjectedEntangledPair{P,Open}}, order, size, pos) w
end
end
sitealias(::Type{<:ProjectedEntangledPair{P,Periodic}}, order, _, _) where {P<:Plug} = tuple(order...)
sitealias(::Type{<:ProjectedEntangledPair{P,Infinite}}, order, _, _) where {P<:Plug} = tuple(order...)

defaultorder(::Type{<:ProjectedEntangledPair{State}}) = (:l, :r, :u, :d, :o)
defaultorder(::Type{<:ProjectedEntangledPair{Operator}}) = (:l, :r, :u, :d, :i, :o)
Expand Down
2 changes: 0 additions & 2 deletions src/Quantum/Quantum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ end
abstract type Boundary end
struct Open <: Boundary end
struct Periodic <: Boundary end
struct Infinite <: Boundary end

"""
boundary(::QuantumTensorNetwork)
Expand All @@ -239,7 +238,6 @@ Return the `Boundary` type of the [`TensorNetwork`](@ref). The following `Bounda
- `Open`
- `Periodic`
- `Infinite`
"""
function boundary end

Expand Down
2 changes: 1 addition & 1 deletion src/Tenet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export transform, transform!
include("Quantum/Quantum.jl")
export QuantumTensorNetwork, sites, fidelity
export Plug, plug, Property, State, Dual, Operator
export Boundary, boundary, Open, Periodic, Infinite
export Boundary, boundary, Open, Periodic

include("Quantum/MP.jl")
export MatrixProduct, MPS, MPO
Expand Down
36 changes: 0 additions & 36 deletions test/MatrixProductOperator_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,42 +93,6 @@
MatrixProduct{Operator,Periodic}(arrays) isa QuantumTensorNetwork
end
end

# @testset "`Infinite` boundary" begin
# # product operator
# @test skip = true begin
# arrays = [rand(1, 1, 2, 2), rand(1, 1, 2, 2), rand(1, 1, 2, 2)]
# MatrixProduct{Operator,Infinite}(arrays) isa MPO{Infinite}
# end

# # alternative constructor
# @test skip = true begin
# arrays = [rand(1, 1, 2, 2), rand(1, 1, 2, 2), rand(1, 1, 2, 2)]
# MatrixProduct{Operator}(arrays; boundary = Infinite) isa MPO{Infinite}
# end

# # entangling operator
# @test skip = true begin
# i = 3
# o = 5
# arrays = [rand(2, 4, i, o), rand(4, 8, i, o), rand(8, 2, i, o)]
# MatrixProduct{Operator,Infinite}(arrays) isa MPO{Infinite}
# end

# # entangling operator - change order
# @test skip = true begin
# i = 3
# o = 5
# arrays = [rand(2, i, 4, o), rand(4, i, 8, o), rand(8, i, 2, o)]
# MatrixProduct{Operator,Infinite}(arrays, order = (:l, :i, :r, :o)) isa MPO{Infinite}
# end

# # fail on Infinite with Open format
# @test_throws MethodError begin
# arrays = [rand(1, 2, 2), rand(1, 1, 2, 2), rand(1, 2, 2)]
# MatrixProduct{Operator,Infinite}(arrays) isa MPO{Infinite}
# end
# end
end

@testset "merge" begin
Expand Down
42 changes: 0 additions & 42 deletions test/MatrixProductState_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,48 +99,6 @@
MatrixProduct{State,Periodic}(arrays) isa QuantumTensorNetwork
end
end

# @testset "`Infinite` boundary" begin
# # product state
# @test skip = true begin
# arrays = [rand(1, 1, 2), rand(1, 1, 2), rand(1, 1, 2)]
# MatrixProduct{State,Infinite}(arrays) isa MPS{Infinite}
# end

# # entangled state
# @test skip = true begin
# arrays = [rand(3, 4, 2), rand(4, 8, 2), rand(8, 3, 2)]
# MatrixProduct{State,Infinite}(arrays) isa MPS{Infinite}
# end

# @testset "custom order" begin
# arrays = [rand(3, 1, 3), rand(3, 1, 3), rand(3, 1, 3)]
# ψ = MatrixProduct{State,Infinite}(arrays, order = (:r, :o, :l))

# @test skip = true ψ isa MPS{Infinite}
# end

# # alternative constructor
# @test skip = true begin
# arrays = [rand(1, 1, 2), rand(1, 1, 2), rand(1, 1, 2)]
# MatrixProduct{State}(arrays; boundary = Infinite) isa MPS{Infinite}
# end

# # fail on Infinite with Open format
# @test_throws skip = true Exception begin
# arrays = [rand(1, 2), rand(1, 1, 2), rand(1, 2)]
# MatrixProduct{State,Infinite}(arrays) isa MPS{Infinite}
# end

# # @testset "tensors" begin
# # arrays = [rand(1, 1, 2), rand(1, 1, 2), rand(1, 1, 2)]
# # ψ = MatrixProduct{State,Infinite}(arrays, order = (:l, :r, :o))

# # @test tensors(ψ, 1) isa Tensor
# # @test tensors(ψ, 4) == tensors(ψ, 1)
# # @test tensors(ψ, 0) == tensors(ψ, 3)
# # end
# end
end

@testset "merge" begin
Expand Down

0 comments on commit 65c9644

Please sign in to comment.