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

Added check for hybrid Control/Matrix Gate classes + test #106

Conversation

juanboschero
Copy link
Collaborator

No description provided.

Copy link
Contributor

@rturrado rturrado left a comment

Choose a reason for hiding this comment

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

Good work, @juanboschero !

Please consider my review as a set of comments and questions. I leave the final approval to Chris and Pablo.

Thanks!

opensquirrel/squirrel_ir.py Show resolved Hide resolved
opensquirrel/squirrel_ir.py Outdated Show resolved Hide resolved
opensquirrel/squirrel_ir.py Outdated Show resolved Hide resolved
opensquirrel/squirrel_ir.py Outdated Show resolved Hide resolved
test/utils/test_matrix_expander.py Outdated Show resolved Hide resolved
opensquirrel/squirrel_ir.py Outdated Show resolved Hide resolved
test/utils/test_matrix_expander.py Outdated Show resolved Hide resolved
test/utils/test_matrix_expander.py Outdated Show resolved Hide resolved
opensquirrel/squirrel_ir.py Outdated Show resolved Hide resolved
test/utils/test_matrix_expander.py Outdated Show resolved Hide resolved
opensquirrel/squirrel_ir.py Outdated Show resolved Hide resolved
opensquirrel/squirrel_ir.py Show resolved Hide resolved
@pablolh
Copy link
Contributor

pablolh commented Feb 26, 2024

Your implementation is correct but doesn't scale

I just had this idea, instead of my earlier comment:
You can still use the matrix I believe but you need to use the _QubitReIndexer from replacer.py (reindexer name courtesy of @elenbaasc)

.idea/.gitignore Outdated Show resolved Hide resolved
opensquirrel/replacer.py Outdated Show resolved Hide resolved
opensquirrel/squirrel_ir.py Outdated Show resolved Hide resolved
test/test_squirrel_ir.py Outdated Show resolved Hide resolved
test/test_squirrel_ir.py Outdated Show resolved Hide resolved
test/test_squirrel_ir.py Outdated Show resolved Hide resolved
opensquirrel/squirrel_ir.py Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
opensquirrel/squirrel_ir.py Show resolved Hide resolved
opensquirrel/squirrel_ir.py Show resolved Hide resolved
opensquirrel/utils/matrix_expander.py Show resolved Hide resolved
test/test_squirrel_ir.py Show resolved Hide resolved
@pablolh pablolh force-pushed the 88-make-sure-we-can-compare-a-matrixgate-and-a-controlledgate branch from 2b5ce76 to 22b0a54 Compare March 6, 2024 15:51
@juanboschero juanboschero force-pushed the 88-make-sure-we-can-compare-a-matrixgate-and-a-controlledgate branch from 22b0a54 to 2b68d1f Compare March 6, 2024 16:04
pablolh
pablolh previously approved these changes Mar 6, 2024
@juanboschero juanboschero force-pushed the 88-make-sure-we-can-compare-a-matrixgate-and-a-controlledgate branch from fbd81d2 to fa0592c Compare March 8, 2024 07:32
@pablolh
Copy link
Contributor

pablolh commented Mar 8, 2024

Make sure you rebase on top of latest origin/develop before push --force

dependabot bot and others added 2 commits March 8, 2024 15:22
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.10 to 9.5.11.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@9.5.10...9.5.11)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
- Configured equivalence of gates from subclass to base class
- Renamed get_matrix to get_matrix_after_qubit_remapping and moved function to matrix_expander
- Added tests to check equivalence between MatrixGate and ControlGate objects

removed union import from squirrel_ir
@juanboschero juanboschero force-pushed the 88-make-sure-we-can-compare-a-matrixgate-and-a-controlledgate branch from fa0592c to 63b64d7 Compare March 8, 2024 14:23
@elenbaasc elenbaasc merged commit 5f927b9 into develop Mar 11, 2024
17 checks passed
@elenbaasc elenbaasc deleted the 88-make-sure-we-can-compare-a-matrixgate-and-a-controlledgate branch August 23, 2024 09:29
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.

4 participants