-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix Aqua's reported piracies and method ambiguities #85
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
@testitem "Aqua" tags=[:aqua] begin | ||
using Aqua | ||
import QuantumInterface as QI | ||
own_types = [QI.AbstractBra, QI.AbstractKet, QI.AbstractSuperOperator, QI.AbstractOperator] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you elaborate why these need to be marked as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand correctly, a type pyracy is when we expand a function definition with methods that take a certain type, but we neither defined the original function nor the type. The last paragraph in the piracy section here gave me the impression that this was indeed happening intentionally. Aqua docs stating the following too gave me assurance that this is right.
Note: the functions really take |
||
Aqua.test_all(QuantumSymbolics, | ||
ambiguities=(;broken=true), | ||
piracies=(;broken=true), | ||
ambiguities=(), | ||
piracies=(;treat_as_own=own_types), | ||
) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motivation here was to avoid ambiguities with other packages,
But I'm not sure if it should be
::Number
or::{Union{Number, Symbolic{Number}}}
to allowp*tr(q)
just astr(q)*p
is allowed. The test suits for QuantumSymbolics and QuantumSavory pass right now, but I wasn't sure if that is a valid operation since it was allowed before my changes.