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

Issue 257/xp formalism #286

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Issue 257/xp formalism #286

wants to merge 7 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 14, 2022

Summary

Details and comments

dhruvbhq and others added 7 commits October 18, 2022 00:14
* added skeleton BaseXPPauli and xp_pauli_rep

* fixed formatting and lint warnings in xp

* made changes to XP documentation as per feedback

* changed variable name from N to precision in base_xp_pauli

* changed np.int8 to np.int64 in base_xp_pauli
* Change from "stabilizer" to "propagator" for speed. (#245)

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>
Co-authored-by: Iskandar Sitdikov <IceKhan13@users.noreply.github.com>
Co-authored-by: Drew Vandeth <57962926+dsvandet@users.noreply.github.com>

* retworkx to rustworkx (#265)

* 260 decoding graph fix (#261)

* move code block to avoid issue

* Update test_codes.py

* add test for dg

* removed unused variable

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>

* fix for warning by casting array_ to numpy array with dtype=object in squeeze (#248)

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>

* Use PyMatching 0.7.0 (#278)

* Update requirements.txt

To require previous pymatching version

* PyMatching requirements

Gave PyMatching range so that pip install has more wiggle room for managing dependency reqs.

* PyMatching requirements update

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>

* Make qiskit-qec compatible with pymatching v2 (#280)

* Add !=2.0.0 to pymatching in requirements.txt, fix a test that fails for pymatching >v2.0.0

* Remove edges, instead of assigning large weights

Co-authored-by: Oscar Higgott <oscarhiggott@users.noreply.github.com>
Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>

Co-authored-by: Andrew Cross <awcross@us.ibm.com>
Co-authored-by: Iskandar Sitdikov <IceKhan13@users.noreply.github.com>
Co-authored-by: Drew Vandeth <57962926+dsvandet@users.noreply.github.com>
Co-authored-by: James Wootton <jwo@zurich.ibm.com>
Co-authored-by: Dhruv Bhatnagar <61590679+dhruvbhq@users.noreply.github.com>
Co-authored-by: oscarhiggott <29460323+oscarhiggott@users.noreply.github.com>
Co-authored-by: Oscar Higgott <oscarhiggott@users.noreply.github.com>
* Change from "stabilizer" to "propagator" for speed. (#245)

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>
Co-authored-by: Iskandar Sitdikov <IceKhan13@users.noreply.github.com>
Co-authored-by: Drew Vandeth <57962926+dsvandet@users.noreply.github.com>

* retworkx to rustworkx (#265)

* 260 decoding graph fix (#261)

* move code block to avoid issue

* Update test_codes.py

* add test for dg

* removed unused variable

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>

* fix for warning by casting array_ to numpy array with dtype=object in squeeze (#248)

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>

* Add functions for Howell matrix computation

* Add checks and unit tests for howell

* Modify linear/__init__.py and add acknowledgement for Mark's work

* Create modn.py for arithmetic and modify matrix.py based on feedback

1. modn.py contains gcd_ext, quo, div, ann, stab, unit;
2. matrix.py has the following addition: do_row_op, howell, howell_complete.

* Add unit tests for do_row_op

Co-authored-by: Andrew Cross <awcross@us.ibm.com>
Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>
Co-authored-by: Iskandar Sitdikov <IceKhan13@users.noreply.github.com>
Co-authored-by: Drew Vandeth <57962926+dsvandet@users.noreply.github.com>
Co-authored-by: James Wootton <jwo@zurich.ibm.com>
Co-authored-by: Dhruv Bhatnagar <61590679+dhruvbhq@users.noreply.github.com>
* added xp_pauli class

* added functions for random xp, precision rescaling, unique vector

* added test_xp_pauli and simple test

* added weight / XPDistance function

* added XPisDiag function as is_diagonal

* coded XPD (antisymmetric operator) and refactored

* added XPPower

* added XP multiplication

* added XP degree function

* added dummy XPPauliList

* added test for XPPauliList init, and function in xp_pauli_rep

* added some tests for XPPauliList and upgraded some functions to work for XPPauliList

* cleaned lint and black

* renamed _num_paulis to _num_xppaulis

* added missing truncate variable

* resolved weight todo

* revert precision from list to integer in BaseXPPauli

* added type hints

* removed array as allowed precision from assertion and updated tests

* acknowledged XPF paper on top of BaseXPPauli... files

* added acknowledgement note in individual methods of BaseXPPauli...

* added see also in BaseXPPauli... methods

* changed assertion to if...raise and moved check to higher level method

* changed assertion to if...raise

* added docstrings for BaseXPPauli... methods

* XPF: 1. added examples in docstring 2. updated 1 method to work for xppaulilist 3. added test

* added example and minor change for random_xppauli

* added check in rescale_precision

* added remaining tests for XPPauliList for currently coded functions

* cleaned black and lint
* Change from "stabilizer" to "propagator" for speed. (#245)

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>
Co-authored-by: Iskandar Sitdikov <IceKhan13@users.noreply.github.com>
Co-authored-by: Drew Vandeth <57962926+dsvandet@users.noreply.github.com>

* retworkx to rustworkx (#265)

* 260 decoding graph fix (#261)

* move code block to avoid issue

* Update test_codes.py

* add test for dg

* removed unused variable

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>

* fix for warning by casting array_ to numpy array with dtype=object in squeeze (#248)

Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>

* Add functions for Howell matrix computation

* Add checks and unit tests for howell

* Modify linear/__init__.py and add acknowledgement for Mark's work

* Create modn.py for arithmetic and modify matrix.py based on feedback

1. modn.py contains gcd_ext, quo, div, ann, stab, unit;
2. matrix.py has the following addition: do_row_op, howell, howell_complete.

* Add unit tests for do_row_op

* Fix lint issues

Co-authored-by: Andrew Cross <awcross@us.ibm.com>
Co-authored-by: grace-harper-ibm <74260313+grace-harper-ibm@users.noreply.github.com>
Co-authored-by: Iskandar Sitdikov <IceKhan13@users.noreply.github.com>
Co-authored-by: Drew Vandeth <57962926+dsvandet@users.noreply.github.com>
Co-authored-by: James Wootton <jwo@zurich.ibm.com>
Co-authored-by: Dhruv Bhatnagar <61590679+dhruvbhq@users.noreply.github.com>
* Modify antisymmetric_op based on Issue 299 and change use of compose in tests

* Add inverse method (to base_xp_pauli, xp_pauli, and xp_pauli_list) and tests

* Add conjugate method and tests

* Add commutator method and tests

* Add fundamental_phase method and tests

Also modify power method such that each operator in an XPPauliList can be raised to different powers

* Add reset_eigenvalue method and tests

* Linting cleanup

* Fix small error in reset_eigenvalue method

* Add "See also" in docstrings

* Modify `power` based on comments

The `power` method now accepts int, list, or np.ndarray as input. If an int is provided, all XP operators in an XPPauliList would be raised to the same power.

* Revert change in precision check

* Add docstrings for x, _x, z, _z

* Add warnings and inplace option for `rescale_precision()`

* Add inplace option for `reset_eigenvalue()`
* beginning to add basic stuff to xp_pauli_rep

* implemented xp_symplectic2str basic functionality, added tests

* Implemented changes discussed with Ruihao about exponent of P

* Added documentation, examples, type hints
@ghost ghost reopened this Apr 28, 2023
@ghost ghost marked this pull request as ready for review April 28, 2023 14:09
@grace-harper grace-harper reopened this May 5, 2023
@grace-harper grace-harper marked this pull request as draft September 19, 2023 19:38
@CLAassistant
Copy link

CLAassistant commented Apr 22, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ ruihao-li
✅ dhruvbhq
❌ grace-harper-ibm


grace-harper-ibm seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

None yet

4 participants