Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all references to Infinite trait #111

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading