fix: use ZZ as IonQ Forte native 2Q gate instead of MS#37
Merged
Conversation
Forte Enterprise 1 rejects the MS gate at submission time with "Gate types [ms] are not supported by this backend". Its native entangling gate is ZZ, confirmed by the compilation output field gate_basis: "ZZ" and successful hardware execution. - Add gate.ZZ(theta) constructor (same matrix as RZZ, named "ZZ") - Add builder.ZZ() shorthand - Change IonQForte target basis from [GPI, GPI2, MS] to [GPI, GPI2, ZZ] - Add ZZ decomposition rules (GPI/GPI2/ZZ basis) for Forte transpilation - Fix op ordering bugs in decompose1qToIonQ(H) and rzToIonQ that had math-notation order instead of circuit-execution order - Add serializer, decomposition, and unitarity tests for ZZ
|
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (49.47%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
==========================================
- Coverage 71.46% 71.42% -0.04%
==========================================
Files 166 166
Lines 17602 17695 +93
==========================================
+ Hits 12579 12639 +60
- Misses 4058 4088 +30
- Partials 965 968 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The CX, CZ, and RZZ decomposition paths all handle ControlledGate via DecomposeMultiControlled, but neither the MS nor ZZ IonQ paths did. Without this, multi-controlled gates (MCX, MCZ, MCP, Controlled(...)) return nil on IonQ targets instead of decomposing.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
msgate with"Gate types [ms] are not supported by this backend". Its native 2Q entangling gate iszz, confirmed by the compilation output (gate_basis: "ZZ") and successful hardware execution with custom pulse shapes.gate.ZZ(theta)constructor, builder shorthand, ZZ-basis decomposition rules, and updatesIonQFortetarget from[GPI, GPI2, MS]to[GPI, GPI2, ZZ]. Aria retains MS.decompose1qToIonQ(H)andrzToIonQwhere ops were in math-notation order instead of circuit-execution order (never caught because the MS CNOT path uses a hardcoded sequence).Test plan
TestMarshalZZGateverifies ZZ serializes to"zz"with angle in turnsTestDecomposeByRule_CNOT_ToZZBasisverifies CNOT decomposition to GPI/GPI2/ZZ matches CNOT unitary up to global phaseTestDecomposeByRule_CZ_ToZZBasisand_SWAP_ToZZBasisverify CZ and SWAP decompositionsTestUnitaritynow includesZZ(pi/4)TestHasBasisGate_IonQupdated for ZZ in Forte, MS in negative setgo test ./...- 0 failures)qpu.forte-enterprise-1, job completed successfully