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

fixes #77 #78

Merged
merged 2 commits into from
Sep 23, 2019
Merged

fixes #77 #78

merged 2 commits into from
Sep 23, 2019

Conversation

pgawron
Copy link
Collaborator

@pgawron pgawron commented Sep 3, 2019

No description provided.

@adamglos92
Copy link
Collaborator

Proposed changes fixes the UnitaryChannel case, but still does not fix general case because of the code below.

function compose(Φ1::T, Φ2::T) where {T<:AbstractQuantumOperation{<:Number}}
    compose(T, Φ1, Φ2)
end

Furthermore I still suggest to implement separate functions for various combination of composition of IdentityChanneland UnitaryChannel
I think I can propose some additional tests

id = IdentityChannel(2)
u1 = UnitaryChannel([cos(1) sin(1); -sin(1) cos(1)])
@test compose(u1, id)
@test compose(id, u1)
@test compose(id, id)

Φ = KrausOperators([[1 0; 0 0], [0 0; 0 1]])
Φsparse = KrausOperators([sparse([1 0; 0 0]), [0 0; 0 1]])
@test compose(Φ, Φ)
@test compose(Φ, Φsparse)

Not sure what behavior should be expected if Matrix types differs, taking into account the fixes for Unitary case both should pass.

src/channels/compositions.jl Show resolved Hide resolved
src/channels/compositions.jl Outdated Show resolved Hide resolved
@lpawela
Copy link
Member

lpawela commented Sep 3, 2019

@adamglos92 sparse matrices are currently NOT supported, use at your own risk.

@pgawron pgawron requested a review from lpawela September 22, 2019 19:13
@lpawela lpawela merged commit b40714a into master Sep 23, 2019
@lpawela lpawela deleted the pg/unitaryfix branch January 22, 2021 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants