Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
309f3eb
feat: add Rzz gate implementation and update initialization parameters
JulienCalistoTD Feb 18, 2026
ba3648b
fix: update CustomGate to use identity operation and improve label fo…
JulienCalistoTD Feb 24, 2026
8bf4811
feat: add PRX gate implementation and update gate imports
JulienCalistoTD Feb 25, 2026
0ee55c9
feat: update PRX gate to use parameters directly and improve language…
JulienCalistoTD Feb 25, 2026
c1852e4
feat: update PRX gate to use sympy functions for trigonometric calcul…
JulienCalistoTD Feb 25, 2026
7495a58
feat: refactor PRX gate to use Rz and Rx matrices for canonical matri…
JulienCalistoTD Feb 25, 2026
f9219fc
feat: update PRX gate initialization to store target as a list
JulienCalistoTD Feb 25, 2026
0d796e2
feat: update PRX gate to use 'targets' attribute for multiple target …
JulienCalistoTD Feb 25, 2026
1201814
feat: update PRX gate to return RZ and RX gates for Qiskit integration
JulienCalistoTD Feb 25, 2026
5f4f658
chore: Files formated
github-actions[bot] Feb 25, 2026
c9bf744
feat: add disable_qubit_rewiring option to device.run calls in run_br…
JulienCalistoTD Feb 26, 2026
ede5deb
Merge branch 'feat-New-gate' of https://github.com/ColibrITD-SAS/mpqp…
JulienCalistoTD Feb 26, 2026
68e333f
chore: Files formated
github-actions[bot] Feb 26, 2026
e29381a
feat: adjust target indexing for Braket circuit instructions in QCircuit
JulienCalistoTD Feb 26, 2026
2d28df5
Merge branch 'feat-New-gate' of https://github.com/ColibrITD-SAS/mpqp…
JulienCalistoTD Feb 26, 2026
f9d71cb
feat: update Braket circuit handling to use add_verbatim_box method
JulienCalistoTD Mar 10, 2026
4331396
feat: optimize target indexing for Braket circuit instructions in QCi…
JulienCalistoTD Mar 10, 2026
76af3b6
feat: update Braket circuit handling to directly add instructions wit…
JulienCalistoTD Mar 10, 2026
05bdd6d
feat: update installation instructions for providers in getting-start…
JulienCalistoTD Mar 16, 2026
9017258
fix: PRX repr and Braket translation issues
MathieuG-Colibri Mar 24, 2026
de7a220
feat: fix adjust_measure on simple pauli strings
MathieuG-Colibri Mar 25, 2026
c2001a0
fix: adjust_measure padding, apply pre_measure swap
MoHermes Mar 26, 2026
2d4eb43
fix: remove pre_measure swaps, apply direct embedding
MoHermes Mar 29, 2026
9340557
chore: Files formated
github-actions[bot] Mar 29, 2026
724f062
fix: added observables all providers handling
MathieuG-Colibri Apr 1, 2026
e969527
chore: Files formated
github-actions[bot] Apr 1, 2026
12a4bb0
Merge branch 'dev' into feat-New-gate
MathieuG-Colibri Apr 3, 2026
8ebd474
feat: added ComposedGates and fixed tests
MathieuG-Colibri Apr 13, 2026
1050804
Merge branch 'feat-New-gate' of https://github.com/ColibrITD-SAS/mpqp…
MathieuG-Colibri Apr 13, 2026
939f92e
chore: Files formated
github-actions[bot] Apr 13, 2026
8a30c81
feat: added testsuite
MathieuG-Colibri Apr 21, 2026
442132e
fix: merge and testsuite
MathieuG-Colibri Apr 21, 2026
60ef840
chore: Files formated
github-actions[bot] Apr 21, 2026
bdbb6b7
fix: pyright
MathieuG-Colibri Apr 21, 2026
6343ce4
Merge branch 'feat-New-gate' of github.com:ColibrITD-SAS/mpqp into fe…
MathieuG-Colibri Apr 21, 2026
56f8508
feat: added test and translation for ccu
MathieuG-Colibri Apr 23, 2026
7571814
fix: ccu qiskit and braket issues, changed cirq unitary behavior to h…
MathieuG-Colibri Apr 30, 2026
aef067c
chore: Files formated
github-actions[bot] Apr 30, 2026
001d400
fix: custom gate handling in cirq, decomposition bugs, particular gat…
MathieuG-Colibri May 5, 2026
aae68c2
fix: unitary decomposition non ordered qubits
MathieuG-Colibri May 6, 2026
0bd147c
feat: add native Rxx and Ryy rotation gates
MoHermes May 13, 2026
18d6c9c
fix: stabilize CustomGate translation across qiskit and cirq, tests p…
MoHermes May 18, 2026
9b6e0a2
chore: Files formated
github-actions[bot] May 18, 2026
a6d2be7
fix: type annotations for decomposition angles
MoHermes May 19, 2026
25e8f71
Merge branch 'feat-New-gate' of github.com:ColibrITD-SAS/mpqp into fe…
MoHermes May 19, 2026
1d297cf
test: clarify CustomControlledGate translation tests
MoHermes May 19, 2026
0a971f5
test: add Rxx and Ryy composed decompositions
MoHermes May 19, 2026
7864f92
docs: add Rxx and Ryy documentation
MoHermes May 20, 2026
c87d5c4
test: cover Rxx, Ryy, Rzz and PRX gates
MoHermes May 20, 2026
f4477b3
docs: update docs
MoHermes May 27, 2026
bfe1331
chore: kron simplification
Henri-ColibrITD Jun 12, 2026
0cb5086
Merge branch 'feat-New-gate' of github.com:ColibrITD-SAS/mpqp into fe…
Henri-ColibrITD Jun 12, 2026
9cd00e3
fix: merged branches
MathieuG-Colibri Jul 10, 2026
bd7e836
fix: handle composed gates in mpqp_to_qiskit function
JulienCalistoTD Aug 17, 2026
24a002d
fix: gate sets for gate decomposition
ThomasB-Colibri Aug 25, 2026
be2818a
chore: Files formated
github-actions[bot] Aug 25, 2026
67ad59a
fix: set definitions
ThomasB-Colibri Aug 25, 2026
c03e2f6
fix: merge conflict
ThomasB-Colibri Aug 25, 2026
4ba2e45
chore: Files formated
github-actions[bot] Aug 25, 2026
196b495
fix: merge conflict
ThomasB-Colibri Aug 25, 2026
dfff38f
chore: Files formated
github-actions[bot] Aug 25, 2026
57b4c1a
fix: cirq set gates
ThomasB-Colibri Aug 25, 2026
0eea2e2
chore: Files formated
github-actions[bot] Aug 25, 2026
8392224
feat: devices reorganization
ThomasB-Colibri Aug 25, 2026
24dd8da
chore: Files formated
github-actions[bot] Aug 25, 2026
d84863c
fix: qasm documentation issue
ThomasB-Colibri Aug 25, 2026
997438d
Merge branch 'feat-new-gate-improvements' of github.com:ColibrITD-SAS…
ThomasB-Colibri Aug 25, 2026
aa3ae6c
fix: qasm test
ThomasB-Colibri Aug 25, 2026
1c36562
chore: Files formated
github-actions[bot] Aug 25, 2026
310d2f1
fix: custom gate type
ThomasB-Colibri Aug 25, 2026
c8e7f12
fix: wrong typing in gate
ThomasB-Colibri Aug 25, 2026
3af7b96
chore: Files formated
github-actions[bot] Aug 25, 2026
54ab3d9
chore: UnsopportedGateError in error file
ThomasB-Colibri Aug 26, 2026
c30eec9
chore: Files formated
github-actions[bot] Aug 26, 2026
1190406
chore: doctring in gate decomposition
ThomasB-Colibri Aug 26, 2026
2f03b2c
chore: Files formated
github-actions[bot] Aug 26, 2026
0fd0145
Merge pull request #213 from ColibrITD-SAS/feat-new-gate-improvements
ThomasB-Colibri Aug 26, 2026
db1bd01
fix: repr of Rzz, Rxx, Ryy & PRx
ThomasB-Colibri Aug 26, 2026
36d416a
chore: Files formated
github-actions[bot] Aug 26, 2026
7adbea6
merge: dev in new gate
ThomasB-Colibri Aug 26, 2026
feea4b4
Merge branch 'feat-New-gate' of github.com:ColibrITD-SAS/mpqp into fe…
ThomasB-Colibri Aug 26, 2026
57a5330
fix: merge conflicts
ThomasB-Colibri Aug 26, 2026
340a0e6
chore: Files formated
github-actions[bot] Aug 26, 2026
4f78d31
fix: merge conflicts with provider translation
ThomasB-Colibri Aug 26, 2026
6edd6cc
chore: Files formated
github-actions[bot] Aug 26, 2026
6878de5
fix: print of controls in custom controlled gate
ThomasB-Colibri Aug 26, 2026
342cb8b
fix: remove trashfiles
ThomasB-Colibri Aug 26, 2026
f92c756
chore: Files formated
github-actions[bot] Aug 26, 2026
b40c30d
chore: custom controlled gate spacing
ThomasB-Colibri Aug 27, 2026
e4cd491
Merge branch 'feat-New-gate' of github.com:ColibrITD-SAS/mpqp into fe…
ThomasB-Colibri Aug 27, 2026
6b7ceee
fix: defined gates used in PRX
ThomasB-Colibri Aug 31, 2026
e64b6e9
chore: ajustments on device
ThomasB-Colibri Aug 31, 2026
29a2441
chore: Files formated
github-actions[bot] Aug 31, 2026
04a93ec
fix: remove wrong test
ThomasB-Colibri Aug 31, 2026
9e338cb
fix: handling of warnings & typing in native gates
ThomasB-Colibri Sep 1, 2026
a001c4f
chore: Files formated
github-actions[bot] Sep 1, 2026
369c009
fix: typing report reupdated
ThomasB-Colibri Sep 1, 2026
7edab45
chore: Files formated
github-actions[bot] Sep 1, 2026
0f90a91
chore: helpers in tools
ThomasB-Colibri Sep 1, 2026
490ba7a
chore: Files formated
github-actions[bot] Sep 1, 2026
28abea6
Merge pull request #216 from ColibrITD-SAS/fix-native-gates-typing
ThomasB-Colibri Sep 1, 2026
ca6e95f
fix: doc device
MathieuG-Colibri Sep 8, 2026
72669de
Merge branch 'dev' into feat-New-gate
ThomasB-Colibri Sep 8, 2026
05dd652
fix: adjust measure test
ThomasB-Colibri Sep 8, 2026
d262b97
chore: remove warnings on adjust measure
ThomasB-Colibri Sep 8, 2026
e647a6b
Merge branch 'dev' into feat-New-gate
MathieuG-Colibri Sep 21, 2026
25b35c4
fix: eval expr & merge issues
ThomasB-Colibri Sep 23, 2026
0a22af5
chore: Files formated
github-actions[bot] Sep 23, 2026
2d5f512
feat: test qasm for u gates
ThomasB-Colibri Sep 23, 2026
f03ec49
Merge branch 'feat-New-gate' of github.com:ColibrITD-SAS/mpqp into fe…
ThomasB-Colibri Sep 23, 2026
1f0013f
chore: Files formated
github-actions[bot] Sep 23, 2026
4c14fd0
fix: merge conflict & missings gates in IQM gate set
ThomasB-Colibri Sep 24, 2026
91316de
Merge branch 'dev' into feat-New-gate
ThomasB-Colibri Sep 24, 2026
64b751e
fix: path for cirq
ThomasB-Colibri Sep 24, 2026
7951bb9
chore: documentation added to sphinx
ThomasB-Colibri Sep 24, 2026
3bc18b6
fix: prx params order in qasm
ThomasB-Colibri Sep 24, 2026
4bc0783
fix: qasm path & warning removed
ThomasB-Colibri Sep 24, 2026
6676e97
fix: repr for single qubit rotation gates
ThomasB-Colibri Sep 24, 2026
f7fdc8d
fix: test of repr for rotation
ThomasB-Colibri Sep 24, 2026
33cfbbc
Update mpqp/core/instruction/measurement/expectation_value.py
ThomasB-Colibri Sep 24, 2026
720b5c3
fix: import order & redundant imports deleted
ThomasB-Colibri Sep 24, 2026
c8eedf0
fix: check in resolve gates
ThomasB-Colibri Sep 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ __pycache__/
.mypy_cache/
.pytest_cache/
.ipynb_checkpoints/
venv/

# IDE
.vscode/
Expand Down
10 changes: 10 additions & 0 deletions docs/gates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,13 @@ Controlled Custom Gates
-----------------------

.. automodule:: mpqp.core.instruction.gates.custom_controlled_gate

Gate Decomposition
------------------

When a target language or device does not support a
:class:`~mpqp.core.instruction.gates.native_gates.ComposedGate` natively, MPQP
recursively resolves it into gates supported by the target gate set. Gates that
are already supported are preserved without decomposition.

.. automodule:: mpqp.core.instruction.gates.gate_decomposition
2 changes: 1 addition & 1 deletion examples/notebooks/4c_Quantum_Phase_Estimation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
" IBMDevice,\n",
" run,\n",
")\n",
"from mpqp.qasm.qasm_to_mpqp import qasm2_parse\n",
"from mpqp.translation.qasm.qasm_to_mpqp import qasm2_parse\n",
"from mpqp.tools.maths import normalize"
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/aws_execution_trials.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from mpqp.execution.devices import ATOSDevice, AWSDevice
from mpqp.gates import *
from mpqp.measures import BasisMeasure
from mpqp.qasm.qasm_to_braket import qasm3_to_braket_Circuit
from mpqp.translation.qasm.qasm_to_braket import qasm3_to_braket_Circuit

device = LocalSimulator()

Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/open_qasm_conversions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Examples of OpenQASM conversion from 2.0 to 3.0"""

from mpqp.qasm import open_qasm_2_to_3, remove_user_gates
from mpqp.translation.qasm import open_qasm_2_to_3, remove_user_gates

print("-------------------------")
print("-------------------------")
Expand Down
4 changes: 4 additions & 0 deletions mpqp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
CNOT,
CP,
CZ,
PRX,
SWAP,
TOF,
ControlledGate,
Expand All @@ -53,8 +54,11 @@
Rk,
Rk_dagger,
Rx,
Rxx,
Ry,
Ryy,
Rz,
Rzz,
S,
S_dagger,
T,
Expand Down
82 changes: 41 additions & 41 deletions mpqp/core/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
from mpqp.core.instruction.gates import ControlledGate, Gate
from mpqp.core.instruction.gates.custom_controlled_gate import CustomControlledGate
from mpqp.core.instruction.gates.custom_gate import CustomGate
from mpqp.core.instruction.gates.native_gates import NativeGate
from mpqp.core.instruction.gates.parametrized_gate import ParametrizedGate
from mpqp.core.instruction.measurement import BasisMeasure, Measure
from mpqp.core.instruction.measurement.expectation_value import ExpectationMeasure
Expand All @@ -58,6 +57,7 @@
InstructionParsingError,
NonReversibleWarning,
NumberQubitsError,
UnsupportedGateError,
)
from mpqp.tools.generics import OneOrMany
from mpqp.tools.maths import matrix_eq
Expand Down Expand Up @@ -946,7 +946,7 @@ def initializer(cls, state: npt.NDArray[np.complex128]) -> QCircuit:
qiskit_circuit.append(
StatePreparation(Statevector(normalize(state))), range(size)
)
circ, phase = replace_custom_gate(qiskit_circuit[0], size, list(range(size)))
circ, phase = replace_custom_gate(qiskit_circuit, size, list(range(size)))
cls = QCircuit.from_other_language(circ.reverse_bits())
cls.input_g_phase = phase
return cls
Expand Down Expand Up @@ -1109,7 +1109,6 @@ def to_other_language(
language: Literal[Language.QASM2, Language.QASM3],
skip_pre_measure: bool = False,
skip_measurements: bool = False,
authorized_gates: Optional[set[type[NativeGate]]] = None,
printing: bool = False,
) -> str: ...

Expand All @@ -1119,7 +1118,6 @@ def to_other_language(
language: Literal[Language.CIRQ],
skip_pre_measure: bool = False,
skip_measurements: bool = False,
authorized_gates: Optional[set[type[NativeGate]]] = None,
printing: bool = False,
) -> cirq_Circuit: ...

Expand All @@ -1129,7 +1127,6 @@ def to_other_language(
language: Literal[Language.BRAKET],
skip_pre_measure: bool = False,
skip_measurements: bool = False,
authorized_gates: Optional[set[type[NativeGate]]] = None,
printing: bool = False,
) -> braket_Circuit: ...
@overload
Expand All @@ -1138,7 +1135,6 @@ def to_other_language(
language: Literal[Language.MY_QLM],
skip_pre_measure: bool = False,
skip_measurements: bool = False,
authorized_gates: Optional[set[type[NativeGate]]] = None,
printing: bool = False,
) -> myQLM_Circuit: ...

Expand All @@ -1148,7 +1144,6 @@ def to_other_language(
language: Literal[Language.QISKIT],
skip_pre_measure: bool = False,
skip_measurements: bool = False,
authorized_gates: Optional[set[type[NativeGate]]] = None,
printing: bool = False,
) -> QuantumCircuit: ...

Expand All @@ -1158,7 +1153,6 @@ def to_other_language(
language: Language,
skip_pre_measure: bool = False,
skip_measurements: bool = False,
authorized_gates: Optional[set[type[NativeGate]]] = None,
printing: bool = False,
) -> QuantumCircuit | myQLM_Circuit | braket_Circuit | cirq_Circuit | str: ...

Expand All @@ -1167,7 +1161,6 @@ def to_other_language(
language: Language = Language.QISKIT,
skip_pre_measure: bool = False,
skip_measurements: bool = False,
authorized_gates: Optional[set[type[NativeGate]]] = None,
printing: bool = False,
) -> QuantumCircuit | myQLM_Circuit | braket_Circuit | cirq_Circuit | str:
"""Transforms this circuit into the corresponding circuit in the language
Expand Down Expand Up @@ -1241,26 +1234,17 @@ def to_other_language(
circuits.

"""
if authorized_gates is None:
authorized_gates = set()
self._generated_g_phase = 0
if language == Language.QISKIT:
from mpqp.translation.qiskit import mpqp_to_qiskit

return mpqp_to_qiskit(
self,
skip_pre_measure,
skip_measurements,
printing,
authorized_gates=authorized_gates,
)
return mpqp_to_qiskit(self, skip_pre_measure, skip_measurements, printing)

elif language == Language.MY_QLM:
qasm2_code = self.to_other_language(
Language.QASM2,
skip_pre_measure=skip_pre_measure,
skip_measurements=True,
authorized_gates=authorized_gates,
)
from mpqp.translation.qasm.qasm_to_myqlm import qasm2_to_myqlm_Circuit

Expand All @@ -1270,16 +1254,12 @@ def to_other_language(
elif language == Language.BRAKET:
from mpqp.translation.braket import mpqp_to_braket

return mpqp_to_braket(
self, skip_pre_measure, authorized_gates=authorized_gates
)
return mpqp_to_braket(self, skip_pre_measure)

elif language == Language.CIRQ:
from mpqp.translation import mpqp_to_cirq
from mpqp.translation.cirq import mpqp_to_cirq

return mpqp_to_cirq(
self, skip_pre_measure, skip_measurements, authorized_gates
)
return mpqp_to_cirq(self, skip_pre_measure, skip_measurements)

elif language == Language.QASM2:
from mpqp.translation.qasm.mpqp_to_qasm import mpqp_to_qasm2
Expand Down Expand Up @@ -1415,16 +1395,32 @@ def to_other_device(

skip_measurements = False

# Checks if all the gates or its direct decomposition are available on the device.
from copy import deepcopy

from mpqp.core.instruction.gates.gate_decomposition import (
resolve_instructions,
)

translated_circuit = deepcopy(self)
native_gates = device.compatible_gates()

if native_gates:
translated_circuit.instructions = resolve_instructions(
translated_circuit.instructions,
native_gates,
)
unsupported_gates = [
gate
for gate in translated_circuit.gates
if type(gate) not in native_gates
]
if unsupported_gates:
raise UnsupportedGateError(unsupported_gates[0], native_gates)

if isinstance(device, (IBMDevice, StaticIBMSimulatedDevice)):
if job_type == JobType.STATE_VECTOR:
skip_measurements = True
compatible_gates = list(device.compatible_gates())
if len(compatible_gates) != 0:
if any(type(i) not in compatible_gates for i in self.gates):
raise ValueError(
f"Gates {', '.join(map(str, compatible_gates))} "
f"are the only ones available on {device}."
)
Comment on lines -1421 to -1427

@hJaffaliColibritd hJaffaliColibritd Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it's a mistake to remove this, because if we replaced by resolve_instruction in the workflow, when a gate is not a Composed gate or in the set of gates supported, nothing is raised and the gate just pass like this.

So by removing this we don't have anymore the security. Simple example is a circuit containing the gate T, trying to run it on IBMDevice.AER_SIMULATOR_STABILIZER would have returned a ValueError before explaining what is the problem. Instead of that, the process continues until it hits the Qiskit runner, which removes the security we had on mpqp side (and I still believe it's better than letting it go until the provider, can cost QPU time in remote case).

I believe this should be done also for all devices, and maybe this check can be added after we call resolve_gate, would be an option to fix that ? I let you judge

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, I put a check after the call of resolve_instructions c8eedf0

if (
isinstance(device, StaticIBMSimulatedDevice)
and device.value().num_qubits < self.nb_qubits
Expand All @@ -1433,10 +1429,10 @@ def to_other_device(
f"Number of qubits of the circuit ({self.nb_qubits}) is higher "
f"than the one of the IBMSimulatedDevice ({device.value().num_qubits})."
)
qiskit_circuit = self.to_other_language(
Language.QISKIT,
skip_pre_measure,
skip_measurements,
from mpqp.translation.qiskit import mpqp_to_qiskit

qiskit_circuit = mpqp_to_qiskit(
translated_circuit, skip_pre_measure, skip_measurements
)
if TYPE_CHECKING:
assert isinstance(qiskit_circuit, QuantumCircuit)
Expand Down Expand Up @@ -1612,11 +1608,12 @@ def to_other_device(
if job_type == JobType.STATE_VECTOR:
skip_measurements = True

aws_circuit = self.to_other_language(
aws_circuit = translated_circuit.to_other_language(
Language.BRAKET,
skip_pre_measure,
skip_measurements,
)

return aws_circuit
elif isinstance(device, ATOSDevice):
circuit = self.to_other_language(
Expand Down Expand Up @@ -1736,23 +1733,26 @@ def from_other_language(
)

if InstalledProviders.QISKIT in _INSTALLED_MPQP_PROVIDERS:
from mpqp.translation.qiskit import qiskit_to_mpqp
from qiskit import QuantumCircuit

from mpqp.translation.qiskit import qiskit_to_mpqp

if isinstance(qcircuit, QuantumCircuit):
return qiskit_to_mpqp(qcircuit)
if InstalledProviders.CIRQ in _INSTALLED_MPQP_PROVIDERS:
from mpqp.translation import cirq_to_mpqp
from cirq.circuits.circuit import Circuit as cirq_Circuit
from cirq.circuits.moment import Moment

from mpqp.translation import cirq_to_mpqp

if isinstance(qcircuit, Moment | cirq_Circuit):
return cirq_to_mpqp(qcircuit)

if InstalledProviders.BRAKET in _INSTALLED_MPQP_PROVIDERS:
from mpqp.translation.braket import braket_to_mpqp
from braket.circuits import Circuit as braket_Circuit

from mpqp.translation.braket import braket_to_mpqp

if isinstance(qcircuit, braket_Circuit):
return braket_to_mpqp(qcircuit)

Expand Down
12 changes: 6 additions & 6 deletions mpqp/core/instruction/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# pyright: reportUnusedImport=false
from .instruction import Instruction
from .barrier import Barrier
from .gates import *
from .breakpoint import Breakpoint
from .gates import *
from .instruction import Instruction
from .measurement import (
Basis,
ComputationalBasis,
HadamardBasis,
VariableSizeBasis,
BasisMeasure,
ComputationalBasis,
ExpectationMeasure,
Observable,
HadamardBasis,
Measure,
Observable,
VariableSizeBasis,
)
3 changes: 2 additions & 1 deletion mpqp/core/instruction/breakpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
truncated up to the breakpoint."""

from __future__ import annotations

from typing import TYPE_CHECKING, Optional

from mpqp.core.instruction import Instruction
from mpqp.core.instruction.instruction import Instruction
from mpqp.core.languages import Language

if TYPE_CHECKING:
Expand Down
9 changes: 7 additions & 2 deletions mpqp/core/instruction/gates/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
# pyright: reportUnusedImport=false
from .controlled_gate import ControlledGate
from .custom_gate import CustomGate, UnitaryMatrix
from .custom_controlled_gate import CustomControlledGate
from .custom_gate import CustomGate, UnitaryMatrix
from .gate import Gate
from .gate_definition import GateDefinition
from .native_gates import (
CNOT,
CP,
CZ,
PRX,
SWAP,
TOF,
ComposedGate,
CRk,
CRk_dagger,
H,
Id,
P,
CP,
Rk,
Rk_dagger,
Rx,
Rxx,
Ry,
Ryy,
Rz,
Rzz,
S,
S_dagger,
T,
Expand Down
Loading
Loading