Skip to content

Commit 5f8d50e

Browse files
testing custom gates, still not working
1 parent 2103dc8 commit 5f8d50e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mpqp/core/circuit.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from qat.core.wrappers.circuit import Circuit as myQLM_Circuit
1414
from braket.circuits import Circuit as braket_Circuit
15+
from qiskit.quantum_info import Operator
1516
from sympy import Basic, Expr
1617
from typeguard import typechecked, TypeCheckError
1718

@@ -644,14 +645,13 @@ def to_other_language(
644645
Language.QISKIT, qiskit_parameters
645646
)
646647
assert isinstance(qiskit_inst, CircuitInstruction) or isinstance(
647-
qiskit_inst, Operation
648-
)
648+
qiskit_inst, Operation) or isinstance(qiskit_inst, Operator)
649649
cargs = []
650650

651651
if isinstance(instruction, CustomGate):
652-
new_circ.unitary(instruction.to_other_language(), instruction.targets)
653-
#TODO hamza: to test
654-
break
652+
new_circ.unitary(instruction.to_other_language(), instruction.targets, instruction.label)
653+
#TODO hamza: to test, maybe need to reverse the order of elements in the matrix
654+
continue
655655
elif isinstance(instruction, ControlledGate):
656656
qargs = instruction.controls + instruction.targets
657657
elif isinstance(instruction, Gate):

0 commit comments

Comments
 (0)