Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Add order keyword argument in Chain constructor functions #47

Merged
merged 10 commits into from
Jun 19, 2024

Conversation

jofrevalles
Copy link
Member

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
Copy link
Member Author

@mofeing can we merge this?

src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
test/Ansatz/Chain_test.jl Show resolved Hide resolved
Copy link
Member

@mofeing mofeing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a lil aesthetic request and should be done.

src/Ansatz/Chain.jl Outdated Show resolved Hide resolved
src/Ansatz/Chain.jl Show resolved Hide resolved
@jofrevalles jofrevalles merged commit 837642c into master Jun 19, 2024
5 checks passed
@jofrevalles jofrevalles deleted the fix/Chain-constructor-order branch June 19, 2024 11:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add order keyword argument in Chain constructor functions
2 participants