bsc-quantic / Qrochet.jl

Quantum Tensor Networks
https://bsc-quantic.github.io/Qrochet.jl/
Apache License 2.0
1 stars 0 forks source link

Add `order` keyword argument in `Chain` constructor functions #47

Closed jofrevalles closed 3 months ago

jofrevalles commented 3 months ago

This PR resolves #46 by adding an order keyword argument that allows arbitrary order of the dimensions of the tensors, as long as all those arrays are in the same order.

Example

julia> using Qrochet

julia> mps = Chain(State(), Open(), [rand(3, 2), rand(3, 5, 2), rand(5, 2)]; order=(:l, :r, :o))
MPS (inputs=0, outputs=3)

julia> inds.(tensors(mps))
3-element Vector{Vector{Symbol}}:
 [:D, :A]
 [:D, :E, :B]
 [:E, :C]
jofrevalles commented 3 months ago

@mofeing can we merge this?