Creating Physical Noise Models
Noise Mechanisms currently supported
The current version of the HQS Noise App supports single-qubit physical noise in the form of damping, dephasing, and depolarization, with user-given decoherence rates. We assume that the noise is the same for all gate types.
Setting up the HQS Noise App
The HQS Noise App has no parameters for initialization.
However, there are some settings that have default values and can be set with setter functions with the same name as the setting.
number_measurements
: The number of projective measurements used when measuring observables (defaults to 100000).use_bath_as_control
:True
/False
to use/not use bath qubits as control when solving system-bath problems (defaults toFalse
).algorithm
: Options are:ParityBased
,QSWAP
,QSWAPMolmerSorensen
,VariableMolmerSorensen
, (defaults toParityBased
).noise_symmetrization
: Whether or not to apply noise symmetrization, which controls whether the Trotterstep is symmetrized with respect to damping noise. When the overall noise has the tendency to favor one state (|0> or |1>), the Trotterstep can be symmetrized by doubling the Trotter circuit and flipping the definition of |0> and |1> for the second circuit. This process will bring the effective noise closer to a balanced noise at the cost of larger decoherence overall. This option defaults tofalse
.trotterization_order
: Trotterization order of time-evolution operator, 1 or 2 (defaults to 1)parallelization_blocks
: The way noise is added to a quantum circuit. By default, this is set tofalse
, so the noise will be inserted on all qubits, according to the user-specifiedNoiseModels
(see the section onCreating a noise model
, below). If theparallelization_blocks
option is set totrue
, the noise mode is changed toParallelizationBlocks
. In this case, the noise model adds noise on the qubits that are involved in a block or parallel operations. These noise terms are added after aPragmaStopParallelBlock
, which signals the end of the parallel operations in a qoqo circuit.
Creating a Device
We can define an AllToAllDevice
device with the following settings:
number_of_qubits
: The number of qubits for the device.single_qubit_gates
: The list of single-qubit gates available on the quantum computer.two_qubit_gates
: The list of two-qubit gates available on the quantum computer.default_gate_time
: The default gate time of the specified gates.
The single_qubit_gates
option can be any list of single qubit gates available in
the HQS qoqo library as long as it contains one of the following
combinations:
RotateX
andRotateZ
RotateY
andRotateZ
RotateX
andRotateY
RotateZ
andSqrtPauliX
andInvSqrtPauliX
The supported options for two_qubit_gates
are:
CNOT
ControlledPauliZ
ControlledPhaseShift
MolmerSorensenXX
VariableMSXX
An example code for setting device information is given below.
from qoqo import devices
# Setting up the device.
number_of_qubits=5
single_qubit_gates = ["RotateX", "RotateZ", "RotateY"]
two_qubit_gates = ["CNOT"]
default_gate_time = 1.0
device = devices.AllToAllDevice(
number_of_qubits, single_qubit_gates, two_qubit_gates, default_gate_time
)
Creating a Noise Model
We can define a ContinuousDecoherenceModel
noise model with the following types of noise:
- dephasing: Using the
add_dephasing_rate
function. - depolarisation: Using the
add_depolarising_rate
function. - damping: Using the
add_damping_rate
function. - excitations: Using the
add_excitation_rate
function.
Each of these functions takes a list of qubits to apply the noise to and a noise rate (float), and
returns the modified ContinuousDecoherenceModel
. An example code of setting noise model
information, including the damping of qubits, reads as follows.
from qoqo import noise_models
# Setting up the noise model.
damping = 1e-3
dephasing = 5e-4
noise_model = (
noise_models.ContinuousDecoherenceModel()
.add_damping_rate([0, 1, 2], damping)
.add_dephasing_rate([3, 4], dephasing)
)