translate
¤
Translate single- and two-qubit gates in the quantum circuit into basis gates.
Classes:
| Name | Description |
|---|---|
TranslateToBasisGates |
Transpiler pass for converting quantum gates to hardware-specific basis gates. |
TranslateToBasisGates(convert_single_qubit_gate_to_u: bool = True, two_qubit_gate_basis: Literal['cz', 'cx', 'iswap'] = 'cz')
¤
Bases: TranspilerPass
Transpiler pass for converting quantum gates to hardware-specific basis gates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
TranspilerPass
|
class
|
The base class that provides the structure for the transpiler pass. |
required |
Initializes the TranslateToBasisGates class with the specified settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
convert_single_qubit_gate_to_u
|
bool
|
If True, converts all single-qubit gates into U3 gates. Defaults to True. |
True
|
two_qubit_gate_basis
|
Literal['cz', 'cx']
|
Specifies the basis gate for two-qubit gate decomposition. Defaults to 'cz'. |
'cz'
|
Methods:
| Name | Description |
|---|---|
run |
Translate all gates in the quantum circuit into a specified basis gate set. |
Source code in quark/circuit/translate.py
52 53 54 55 56 57 58 59 60 61 | |
run(qc: QuantumCircuit) -> QuantumCircuit
¤
Translate all gates in the quantum circuit into a specified basis gate set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qc
|
QuantumCircuit
|
The input quantum circuit to be translated. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
QuantumCircuit |
QuantumCircuit
|
A new quantum circuit where all gates are expressed using the chosen basis gate set. |
Source code in quark/circuit/translate.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |