compiler
chalmers_qubit.devices.sarimner.compiler
Classes:
Name | Description |
---|---|
SarimnerCompiler |
Compiler for :class: |
SarimnerCompiler
Bases: GateCompiler
Compiler for :class:.SarimnerModel
.
Frequencies are the unit of GHz and times in ns.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Model
|
Model object of the superconducting qubit device with hardware parameters. |
required |
options
|
Optional[dict]
|
A dictionary of compiler options. If not provided, default options will be used. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
num_qubits |
int
|
The number of component systems (qubits). |
params |
dict
|
A Python dictionary containing the name and value of hardware parameters, such as qubit frequency, anharmonicity, etc. |
gate_compiler |
dict
|
A Python dictionary in the form of {gate_name: decompose_function}. It stores the decomposition scheme for each supported gate. |
phase |
list
|
List of values indicating how much we have virtually rotated the Bloch sphere of each qubit. |
global_phase |
float
|
The global phase of the quantum state. |
dt |
float
|
Time step in nanoseconds. |
two_qubit_gate_options |
dict
|
Options specific to two-qubit gates, including buffer_time and rise_fall_time. |
single_qubit_gate_options |
dict
|
Options specific to single-qubit gates, including type, gate_time, pi-pulse amplitude, and std. |
Notes
The compiler supports various gates including RZ, RX, RY, X, H, CZ, ISWAP, CCZS, IDLE, and GLOBALPHASE. Default options are provided for dt, two-qubit gates, and single-qubit gates, which can be overridden by passing custom options during initialization.
Methods:
Name | Description |
---|---|
cczs_compiler |
Compiler for CCZS gate. |
compile |
Compile the the native gates into control pulse sequence. |
cz_compiler |
Compiler for CZ gate. |
generate_pulse_shape |
Return a tuple consisting of a coeff list and a time sequence |
globalphase_compiler |
Compiler for the GLOBALPHASE gate |
h_compiler |
Compiler for the Hadamard gate |
idle_compiler |
Compiler for the IDLE gate |
iswap_compiler |
Compiler for ISWAP gate. |
rx_compiler |
Compiler for the RX gate |
ry_compiler |
Compiler for the RY gate |
rz_compiler |
Compiler for the Virtual-RZ gate |
x_compiler |
Compiler for the Hadamard gate |
cczs_compiler
Compiler for CCZS gate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gate
|
:obj:`.Gate`:
|
The quantum gate to be compiled. |
required |
args
|
dict
|
The compilation configuration defined in the attributes
:obj: |
required |
Returns:
Type | Description |
---|---|
A list of :obj:`.Instruction`, including the compiled pulse
|
|
information for this gate.
|
|
compile
Compile the the native gates into control pulse sequence. It calls each compiling method and concatenates the compiled pulses.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
circuit
|
:class: |
required | |
schedule_mode
|
|
None
|
|
args
|
A dictionary of arguments used in a specific gate compiler function. |
None
|
Returns:
Type | Description |
---|---|
tlist, coeffs: array_like or dict
|
Compiled ime sequence and pulse coefficients.
if |
cz_compiler
Compiler for CZ gate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gate
|
:obj:`.Gate`:
|
The quantum gate to be compiled. |
required |
args
|
dict
|
The compilation configuration defined in the attributes
:obj: |
required |
Returns:
Type | Description |
---|---|
A list of :obj:`.Instruction`, including the compiled pulse
|
|
information for this gate.
|
|
generate_pulse_shape
classmethod
Return a tuple consisting of a coeff list and a time sequence according to a given pulse shape.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shape
|
str
|
The name |
required |
num_samples
|
int
|
The number of the samples of the coefficients. |
required |
maximum
|
float
|
The maximum of the coefficients. The absolute value will be used if negative. |
1.0
|
area
|
float
|
The total area if one integrates coeff as a function of the time. If the area is negative, the pulse is flipped vertically (i.e. the pulse is multiplied by the sign of the area). |
1.0
|
Returns:
Type | Description |
---|---|
coeff, tlist :
|
If the default window |
Notes
If Scipy window functions are used, it is suggested to set
Processor.pulse_mode
to "continuous"
.
Notice that finite number of sampling points will also make
the total integral of the coefficients slightly deviate from area
.
Examples:
.. plot:: :context: reset
1 2 3 4 5 6 7 8 9 10 |
|
We can plot the generated pulse shape:
.. plot:: :context: close-figs
1 2 3 |
|
The pulse is normalized to fit the area. Notice that due to the finite number of sampling points, it is not exactly 1.
.. testsetup::
1 2 3 4 5 6 7 8 9 10 |
|
.. doctest::
1 2 |
|
h_compiler
Compiler for the Hadamard gate
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gate
|
:obj:`.Gate`:
|
The quantum gate to be compiled. |
required |
args
|
dict
|
The compilation configuration defined in the attributes
:obj: |
required |
iswap_compiler
Compiler for ISWAP gate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gate
|
:obj:`.Gate`:
|
The quantum gate to be compiled. |
required |
args
|
dict
|
The compilation configuration defined in the attributes
:obj: |
required |
Returns:
Type | Description |
---|---|
A list of :obj:`.Instruction`, including the compiled pulse
|
|
information for this gate.
|
|
rx_compiler
Compiler for the RX gate
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gate
|
:obj:`.Gate`:
|
The quantum gate to be compiled. |
required |
args
|
dict
|
The compilation configuration defined in the attributes
:obj: |
required |
Returns:
Type | Description |
---|---|
A list of :obj:`.Instruction`, including the compiled pulse
|
|
information for this gate.
|
|
ry_compiler
Compiler for the RY gate
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gate
|
:obj:`.Gate`:
|
The quantum gate to be compiled. |
required |
args
|
dict
|
The compilation configuration defined in the attributes
:obj: |
required |
Returns:
Type | Description |
---|---|
A list of :obj:`.Instruction`, including the compiled pulse
|
|
information for this gate.
|
|
rz_compiler
Compiler for the Virtual-RZ gate
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gate
|
:obj:`.Gate`:
|
The quantum gate to be compiled. |
required |
args
|
dict
|
The compilation configuration defined in the attributes
:obj: |
required |
x_compiler
Compiler for the Hadamard gate
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gate
|
:obj:`.Gate`:
|
The quantum gate to be compiled. |
required |
args
|
dict
|
The compilation configuration defined in the attributes
:obj: |
required |