Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decomposition of arbitrary two-qubit unitaries. (#1552)
* Initial commit. * Add scaffolding and helper function. * Temp commit. * Progress!! * Update su2su2 implementation. * Temp commit. * Implementation that essentially works. Need testing. * Remove perms. * Works about half the time. * Tidy a bit. * Small tweaks. * Temporary work. * Working version, minus tests. * Fix compute matrix in tests. Add check for tensor product structure. * Move decomposition tests to decomposition. * Update some tests. Add to docs. * Remove old test file. * Run black. * Apply suggestions from code review Co-authored-by: Josh Izaac <josh146@gmail.com> * Make E matrix numpy constant. * Vectorize permutation matrix construction. * Replace column negation with matrix multiplication. * Fix decomposition to work in all interfaces. Fix tests to match. * qml.math to math * Remove unneeded variables. * Calculate the required number of CNOTs from tr(gammaU). * Split into multiple cases. 0, 2, and 3-CNOT cases are currently functional. * Add broken version. * Update with integration tests. * Improve documentation. * Run black. * Fix matrix ordering. * RUn black. * Apply suggestions from code review Co-authored-by: Josh Izaac <josh146@gmail.com> * Update error message. Change all qml.math to math. * Fix tests. * Change error to warning. * Remove unused warnings. * Run black. * Test CNOT number computation. * Fix bug in zyz decomposition and tidy tests. * Update CHANGELOG. * Tweak comments. * Add single-CNOT case. * Separate out utility functions and clean up file. * Cast to 1j to handle square root of negative values. * Partially working 2-CNOT case. * Revert qnode file. * Fix CHANGELOG. * Fix CHANGELOG. * Revert test files. * Revert test_qnode. * Run black. * Temporary commit. * Working 2-CNOT case! * Run black. * It works! * Fix test. * Documentation and code factor fixes. * Tweak documentation. * Apply suggestions from code review Co-authored-by: Josh Izaac <josh146@gmail.com> * Move functions back from utils to module. * Make ASCII circuits in docstrings pretty. * Make single-qubit constant matrices top-level. * Rearrange CNOT check. Move matrix to top level. * Streamline conversion to SO(4). * Remove LAST_COL_NEG. * Fix conj. * Update docs and add developer notes. * Update CHANGELOG. * Fix CHANGELOG. * Fix docstring. * Fix decomposition so expansion works. * Fix QMC test. * Fix transform so expand works. * Remove unused import. * Add length checks. * Apply suggestions from code review * Update changelog. * Remove parameter shift test case. * Tweak docstring. * Apply suggestions from code review Co-authored-by: Josh Izaac <josh146@gmail.com> * Add SU(4) invalid check. * Add test case for 3-qubit QubitUnitary in unitary_to_rot. * Massive simplification. Co-authored-by: Olivia Di Matteo <dimatteo.olivia@gmail.com> Co-authored-by: Josh Izaac <josh146@gmail.com>
- Loading branch information