-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Classical sympy conditions with qudits #4778
Closed
Closed
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
b76950e
Allow sympy expressions as classical controls
daxfohl 5fdff50
Format
daxfohl ef081d7
move Condition to value
daxfohl 0dd430e
Condition subclasses
daxfohl 3fb7f75
Fix sympy resolver
daxfohl 9568ae0
lint
daxfohl 04fcff7
fix CCO serialization
daxfohl b3c344e
fix CCO serialization
daxfohl b8ff20a
add json reprs for conditions
daxfohl aa99805
add support for qudits in conditions
daxfohl cbb029b
add test
daxfohl efce2f9
tests
daxfohl b34994b
tests
daxfohl 5537397
test
daxfohl 73ed74b
format
daxfohl a415235
docstrings
daxfohl 3a0a56d
subop
daxfohl f930f6a
regex
daxfohl 39a7a95
docs
daxfohl 42bac3e
Make test_sympy more intuitive.
daxfohl f4ea9d8
Sympy str roundtrip
daxfohl 71f61f5
Resolve some code review comments
daxfohl 2261355
Add escape key to parse_sympy_condition
daxfohl 6b36357
repr
daxfohl afbf3c9
coverage
daxfohl 58fb2dc
coverage
daxfohl bd80c0b
parser
daxfohl c39a572
Improve sympy repr
daxfohl 12d38ca
lint
daxfohl 724febb
sympy.basic
daxfohl b598697
Add sympy json resolvers for comparators
daxfohl d167de7
_from_json_dict_
daxfohl 72d82eb
lint
daxfohl b55188e
reduce fixed_tokens
daxfohl fd1fefb
Merge branch 'master' into sympy3
daxfohl f6a6645
Merge branch 'master' into sympymerge
daxfohl de3f887
Merge branch 'sympy3' of https://github.com/daxfohl/Cirq into sympy3
daxfohl ca56bd8
more tests
daxfohl 6f8e344
format
daxfohl 689719f
Key
daxfohl 96ba4e9
combined test
daxfohl 793c138
Merge remote-tracking branch 'origin/sympy3' into sympy3
daxfohl 0b5526f
Merge branch 'sympy3' into qudits2
daxfohl 8c17a3f
Merge branch 'master' into qudits2
daxfohl c56d6bb
lint
daxfohl 681a008
Docstrings
daxfohl 1bddb1c
Merge branch 'master' into qudits2
daxfohl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@95-martin-orion I did this the least-invasive way, of adding this
measured_qubits
member and propagating it everywhere it needed to be. This is a little smelly because it andlog_of_measurement_results
go hand in hand and are initialized, copied, etc. in pairs. I think the better option though is to introduce a newclassical_state: ClassicalState
that contains both of these dictionaries, plus whatever we add later, and then deprecatelog_of_measurement_results
.. I know it breaks the "rule of three" to do so, but I'm pretty sure we'll have a third thing to put into it soon.It may be a big deprecation, but it may be worth it to do now rather than having to clean up the mess after things like repeated measurements, keeping track of qubits, etc have all become dependent on it.
Additionally I noticed a minor bug here is that I don't keep track of the qubits in keyed channels. If we have a ClassicalState class then we can make the interface such that writing to the dictionaries requires both a value and a qubit list, so that such an omission is impossible. Of course, that will make for a much bigger review. WDYT?