Skip to content

Commit

Permalink
use XXMINUSYY gate
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Feb 13, 2025
1 parent b172fe4 commit a6bc585
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/qiskit_quimb/gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ def _(op: Instruction, qubits: Sequence[int], kwargs: dict[str, Any]):
return quimb.tensor.Gate("X", params=[], qubits=qubits, **kwargs)


@_register_gate_func("xx_minus_yy")
def _(op: Instruction, qubits: Sequence[int], kwargs: dict[str, Any]):
theta, beta = op.params
return quimb.tensor.Gate("XXMINUSYY", params=[theta, beta], qubits=qubits, **kwargs)


@_register_gate_func("xx_plus_yy")
def _(op: Instruction, qubits: Sequence[int], kwargs: dict[str, Any]):
theta, beta = op.params
Expand Down
4 changes: 4 additions & 0 deletions tests/circuit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
U2Gate,
U3Gate,
XGate,
XXMinusYYGate,
XXPlusYYGate,
YGate,
ZGate,
Expand All @@ -60,6 +61,9 @@ def test_quimb_circuit():
circuit.append(XXPlusYYGate(rng.uniform(-10, 10), rng.uniform(-10, 10)), [b, c])
circuit.append(XXPlusYYGate(rng.uniform(-10, 10), rng.uniform(-10, 10)), [a, b])
circuit.append(XXPlusYYGate(rng.uniform(-10, 10), rng.uniform(-10, 10)), [c, d])
circuit.append(XXMinusYYGate(rng.uniform(-10, 10), rng.uniform(-10, 10)), [b, c])
circuit.append(XXMinusYYGate(rng.uniform(-10, 10), rng.uniform(-10, 10)), [a, b])
circuit.append(XXMinusYYGate(rng.uniform(-10, 10), rng.uniform(-10, 10)), [c, d])
circuit.append(CPhaseGate(rng.uniform(-10, 10)), [b, c])
circuit.append(CPhaseGate(rng.uniform(-10, 10)), [a, b])
circuit.append(CPhaseGate(rng.uniform(-10, 10)), [c, d])
Expand Down

0 comments on commit a6bc585

Please sign in to comment.