-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[Stretch] Add stretch variable support to QuantumCircuit.
#13852
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
170 commits
Select commit
Hold shift + click to select a range
af4ba52
WIP
kevinhartman e423bf9
Add try_const to lift.
kevinhartman 0a5917b
Try multiple singletons, new one for const.
kevinhartman a97434d
Revert "Try multiple singletons, new one for const."
kevinhartman 1afc965
Remove Bool singleton test.
kevinhartman 86655f1
Add const handling for stores, fix test bugs.
kevinhartman aaeae9b
Fix formatting.
kevinhartman a2a444b
Remove Duration and Stretch for now.
kevinhartman 8ac2dc3
Cleanup, fix const bug in index.
kevinhartman 9f8313c
Fix ordering issue for types with differing const-ness.
kevinhartman db9d9cb
Fix QPY serialization.
kevinhartman 71b7e7a
Make expr.Lift default to non-const.
kevinhartman 2091557
Revert to old test_expr_constructors.py.
kevinhartman 7307be9
Make binary_logical lift independent again.
kevinhartman 9b30284
Update tests, handle a few edge cases.
kevinhartman ce1faf1
Fix docstring.
kevinhartman 4fee48f
Remove now redundant arg from tests.
kevinhartman 88ab046
Add const testing for ordering.
kevinhartman c5a230f
Add const tests for shifts.
kevinhartman 7c88d88
Add release note.
kevinhartman c58a7b8
Add const store tests.
kevinhartman d9e9a8c
Address lint, minor cleanup.
kevinhartman 4a56150
Add Float type to classical expressions.
kevinhartman 23b5961
Allow DANGEROUS conversion from Float to Bool.
kevinhartman 8bf2e4f
Test Float ordering.
kevinhartman 111eb32
Improve error messages for using Float with logical operators.
kevinhartman a839d51
Float tests for constructors.
kevinhartman a19b39a
Add release note.
kevinhartman 7f02e56
Add Duration and Stretch classical types.
kevinhartman 55af327
Add Duration type to qiskit.circuit.
kevinhartman 86b7af9
Block Stretch from use in binary relations.
kevinhartman 9b3c821
Add type ordering tests for Duration and Stretch.
kevinhartman 69eab91
Test expr constructors for Duration and Stretch.
kevinhartman 971cc26
Fix lint.
kevinhartman 657b666
Implement operators +, -, *, /.
kevinhartman fc53d47
Add expression tests for arithmetic ops.
kevinhartman 24f5125
Implement stretch support for circuit.
kevinhartman 9e775e1
Initial support for writing QASM3.
kevinhartman 25508bf
Reject const vars in add_var and add_input.
kevinhartman 2c8ce43
Merge branch 'main' of github.com:Qiskit/qiskit into const-expr
kevinhartman ccf9441
Implement QPY support for const-typed expressions.
kevinhartman c6eab02
Remove invalid test.
kevinhartman edd7806
Update QPY version 14 desc.
kevinhartman 8afa92e
Fix lint.
kevinhartman 4e0f2df
Add serialization testing.
kevinhartman 15ba943
Merge branch 'main' of github.com:Qiskit/qiskit into const-expr
kevinhartman 81c5833
Merge branch 'const-expr' into expr-float
kevinhartman 50c31d3
Test pre-v14 QPY rejects const-typed exprs.
kevinhartman 7e43322
Merge branch 'main' of github.com:Qiskit/qiskit into const-expr
kevinhartman 2449ee6
Merge branch 'const-expr' into expr-float
kevinhartman e55e189
QASM export for floats.
kevinhartman 1d51022
QPY support for floats.
kevinhartman eb8f150
Fix lint.
kevinhartman 415f62e
Merge branch 'expr-float' into expr-timing
kevinhartman d38f3e9
Settle on Duration circuit core type.
kevinhartman fd66c1d
QPY serialization for durations and stretches.
kevinhartman e9b6d97
Add QPY testing.
kevinhartman 52da3cc
QASM support for stretch and duration.
kevinhartman a3be688
Fix lint.
kevinhartman 2ff7e7a
Merge branch 'expr-timing' into math-expr
kevinhartman 6e8080c
Add arithmetic operators to QASM.
kevinhartman 9266166
QPY testing for arithmetic operations.
kevinhartman e92dcc5
QASM testing for arithmetic operations.
kevinhartman 2d8f1b7
Merge branch 'math-expr' into circuit-stretch
kevinhartman f5a5457
Update tests for blocked const vars.
kevinhartman 6d7b2af
Only test declare stretch QASM; fix lint.
kevinhartman 6ad69d4
Special case for stretch in add_uninitialized_var.
kevinhartman af71e3a
Remove outdated docstring comment.
kevinhartman bddbc66
Remove outdated comment.
kevinhartman 07771f1
Merge branch 'main' of github.com:Qiskit/qiskit into const-expr
kevinhartman 9332ed3
Merge branch 'const-expr' into expr-float
kevinhartman 17241c6
Merge branch 'expr-float' into expr-timing
kevinhartman ca91bfd
Don't use match since we still support Python 3.9.
kevinhartman 368b0ac
Merge branch 'expr-timing' into math-expr
kevinhartman 7fcb098
Merge branch 'math-expr' into circuit-stretch
kevinhartman 723e4f0
Block const stores.
kevinhartman ad87e78
Fix enum match.
kevinhartman 9afd68c
Merge branch 'expr-timing' into math-expr
kevinhartman 86ac649
Merge branch 'math-expr' into circuit-stretch
kevinhartman d3bca5f
Merge branch 'main' of github.com:Qiskit/qiskit into const-expr
kevinhartman 50deb93
Revert visitors.py.
kevinhartman f1dc1a1
Address review comments.
kevinhartman 1f439a0
Merge branch 'main' of github.com:Qiskit/qiskit into const-expr
kevinhartman 166d7b2
Improve type docs.
kevinhartman 10b2c8d
Merge branch 'main' of github.com:Qiskit/qiskit into const-expr
kevinhartman 9d6cf39
Revert QPY, since the old format can support constexprs.
kevinhartman 8021e00
Move const-ness from Type to Expr.
kevinhartman a15141b
Revert QPY testing, no longer needed.
kevinhartman ca2785d
Add explicit validation of const expr.
kevinhartman e902009
Revert stuff I didn't need to touch.
kevinhartman 16475c3
Update release note.
kevinhartman 6b5930d
A few finishing touches.
kevinhartman be73180
Merge branch 'const-expr-expr' into expr-float-expr
kevinhartman 25f1693
Fix-up after merge.
kevinhartman ecc343b
Merge branch 'expr-float-expr' into expr-timing-expr
kevinhartman b32e6f0
Fix-ups after merge.
kevinhartman 864506d
Fix lint.
kevinhartman 6bc728a
Fix comment and release note.
kevinhartman 2d38178
Merge branch 'expr-float' into expr-timing
kevinhartman 84f5a66
Merge branch 'expr-timing' into math-expr
kevinhartman 91b4c75
Fixes after merge.
kevinhartman e1dbd1d
Fix test.
kevinhartman 1ad4388
Fix lint.
kevinhartman 42258b8
Merge branch 'main' of github.com:Qiskit/qiskit into expr-float
kevinhartman 481700a
Merge branch 'expr-float' into expr-timing
kevinhartman e09762f
Special-case Var const-ness for Stretch type.
kevinhartman cbd55db
Address review comments.
kevinhartman f12afb4
Update release note.
kevinhartman 8d059cd
Merge branch 'expr-float' into expr-timing
kevinhartman e05d9ff
Update docs.
kevinhartman bd6bf35
Merge branch 'expr-timing' into math-expr
kevinhartman ef04db2
Add release notes and doc link.
kevinhartman 0f14cca
Address review comments.
kevinhartman 7db8222
Merge branch 'expr-float' into expr-timing
kevinhartman 65f2198
Merge branch 'expr-timing' into math-expr
kevinhartman 34e615b
Merge branch 'main' of github.com:Qiskit/qiskit into expr-timing
kevinhartman bbe67a6
Remove Stretch type.
kevinhartman 0acc450
Remove a few more mentions of the binned stretch type.
kevinhartman 7fea216
Add docstring for Duration.
kevinhartman 4a317e8
Merge branch 'expr-timing' into math-expr
kevinhartman f5709ae
Remove Stretch type stuff.
kevinhartman 3ae8e5e
Merge branch 'math-expr' into circuit-stretch
kevinhartman 0ba0126
WIP
kevinhartman de32a57
Track stretch variables throughout circuits.
kevinhartman ed024ab
Update QASM exporter.
kevinhartman eb3cbcd
Fix existing tests and found bugs.
kevinhartman 5634d63
Fix format.
kevinhartman 37dec7a
Simplify structural eq visitor.
kevinhartman 05cbcb1
Add num_identifiers.
kevinhartman 96f4e06
Support QPY.
kevinhartman 3f74a7f
Implement QASM visit for stretch expr.
kevinhartman 7f0b785
Track stretches through DAGCircuit.
kevinhartman ccb3b88
Add visit_stretch to classical resource map.
kevinhartman 576d194
Fix lint.
kevinhartman 78b2951
Address review comments.
kevinhartman 97bbeba
Remove unused import.
kevinhartman 3a34220
Merge branch 'expr-timing' into math-expr
kevinhartman 888e9bb
Merge branch 'math-expr' into circuit-stretch
kevinhartman fab8b36
Represent stretch with StretchDeclaration in QASM AST.
kevinhartman 49f2af8
Remove visitor short circuit.
kevinhartman 69b985b
Merge branch 'expr-timing' into math-expr
kevinhartman 3b42c14
Merge branch 'math-expr' into circuit-stretch
kevinhartman f780d9a
Address review comments.
kevinhartman e7ca9c4
Address review comments.
kevinhartman d4cef21
Merge branch 'main' of github.com:Qiskit/qiskit into math-expr
kevinhartman 60bcfdb
Support division by Uint.
kevinhartman 2d3706e
Merge branch 'math-expr' into circuit-stretch
kevinhartman 286aff7
Add release note.
kevinhartman d40cb32
Fix lint.
kevinhartman dfc02f3
Merge branch 'math-expr' into circuit-stretch
kevinhartman a13dc49
Add missing DAG stretch plumbing.
kevinhartman 6d64f7f
Fix QPY serialization bug.
kevinhartman 099f257
Fix lint.
kevinhartman f1e2557
Add qpy test.
kevinhartman dc972d4
Support remapping for stretch variables in compose.
kevinhartman ad54644
Merge branch 'main' of github.com:Qiskit/qiskit into math-expr
kevinhartman 723445f
Merge branch 'math-expr' into circuit-stretch
kevinhartman ae08fae
Fix qpy compat test.
kevinhartman 320b72d
Add negative test for QPY stretch expr.
kevinhartman c66842b
Merge branch 'main' of github.com:Qiskit/qiskit into circuit-stretch
kevinhartman 827e619
Add more circuit testing.
kevinhartman 4d7129e
Add circuit equality testing for stretch.
kevinhartman 9d82809
Refer to 'stretches' instead of 'stretch variables'.
kevinhartman e84b48e
Remove | None for Stretch.name
kevinhartman 62cf3ee
Address review comments.
kevinhartman e2044e6
Merge branch 'main' of github.com:Qiskit/qiskit into circuit-stretch
kevinhartman 7634b3e
Update QPY desc.
kevinhartman 2223d12
Fix num_identifiers.
kevinhartman 823dd27
Merge branch 'main' of github.com:Qiskit/qiskit into circuit-stretch
kevinhartman a5ccc7b
Fix merge for control flow tests.
kevinhartman 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 hidden or 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
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.
Actually this particular one should compare equal in both cases - captures are orderless, it's just declarations for which the order matters (because captures don't introduce a new degree of freedom).
So in this test they should both be equal, but
would have
qc1 != qc2.That said, at this point I'm fine leaving this til a follow-up anyway, though let's note to do it.
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.
Added to my list, I'll sort it out in #13853
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.
If there's no time, it can wait til post 2.0 - it's a valid bugfix.