Noise and entropic convergence¶
Quantum channels¶
One of the basic objects required to apply our technique is a quantum channel modelling the noise affecting the quantum device. We will depart from the assumption that the noise affecting the device is identical and independently distributed on each qubit and that we have one qubit noise.
We will later expand our package to also allow for each qubit having a different quantum channel affecting it and also to allow for different noise rates for 1qubit and 2qubit gates.
We will use Cirq quantum channels to specify the noise models.
We automatically compute the fixed point of the channel and the contraction coefficient of the relative entropy with respect to the fixed point. This is the main information on the channel we require to compute our lower bound.
Recall that the technique only works if the quantum channel has a unique fixed point and it is not pure. You will obtain warnings if the quantum channel specified does not satisfy these conditions.
Lindbladians¶
Quantum annealers being computational devices with continuous time, it is also more natural to model the noise affecting them in continuous time as well. That is, we will model the noise with a Lindbladian.
Thus, KnowYourLimits also has functions to specify a noise model in continuous time. In the current implementation, it is assumed that the quantum annealer is implementing a timedependent evolutions, but that the noise model itself is timeindependent. Furthermore, we will assume that the Lindbladian affects each qubit independently and that the noise affecting all qubits is the same. For a more detailed discussion of this noise model, we refer to Sec. ID of the supplementary material of “Limitations of optimization algorithms on noisy quantum devices”.
Unlike it was the case for discrete time quantum channels, Cirq does not readily allow the specification of a Lindbladian \(\mathcal{L}\). However, many Lindlbadians of physical interest are of the form \(\mathcal{L}=r(T\textrm{id})\), for some quantum channel \(T\) and a noise rate \(r>0\). Thus, the Lindbladian class will accept specifying both the Lindbladian in terms of a quantum channel and a rate or in terms of the process matrix of the Lindbladian.

class
noise_model.
lindbladian
(input_noise, rate=1, cirq_input=1)¶ The class for Lindbladians. The quantum channel is initialized either by a cirq noise model or a process matrix in the Heisenberg picture. We then compute the spectral gap and fixed point of the Lindbladian. It will srote the contraction rate towards the fixed point of the noise in self.contraction. The density matrix of the noise will be stored in self.fixed_point.
 Parameters
input_noise (complex array or cirq noise model) – specification of the Lindbladian. This can either be in the form of a process matrix or a cirq noise model. In the latter case, the Lindbladian is assumed to be of the form \(\mathcal{L}=r(T\textrm{id})\), where \(T\) is the noise model and \(r\) is the noise rate.
rate (float) – the rate \(r\) of the noise as specified above. Only required if we are given a cirq noise model.
cirq_input (bool) – set to 1 if the input model for the noise model is a cirq quantum channel. If it is set to 0, it is assumed that we are given the process matrix of the Lindbladian.

class
noise_model.
quantum_channel
(cirq_model)¶ The class for quantum channels. The quantum channel is initialized by a cirq noise model. We then compute the spectral gap and fixed point of the noise model.

apply_channel
(X)¶ Applies the quantum channel to a matrix.
 Returns
the output of the channel given an input matrix.
 Return type
output (complex array)
 Parameters
X (complex array) – input of the channel.

overlap
(A, B)¶ Denoting the underlying chanel by \(T\) and given matrices \(A,B\), this function computes \(\operatorname{tr}(A^{\dagger}T(B))\).
 Returns
the output of the channel given an input matrix.
 Return type
output (complex array)
 Parameters
X (complex array) – input of the channel.

Entropic convergence for circuits¶
This module contains the function used to estimate the relative entropy between the output of a circuit and the fixed point of the noise affecting the circuit.
This estimate is performed using the entropic convergence result stated in Lemma 3 of “Limitations of optimization algorithms on noisy quantum devices”. As discussed in more detailed in the aforementioned paper, this estimate is particularly efrfective for QAOAlike circuits or whenever the fixed point of the noise is close to maximally mixed.

circuit_analyser.
entropy_output
(circuit, number_qubits, fixed_point, contraction)¶ Estimates the relative entropy between the output of a noisy circuit and the fixed point of the noise. The code assumes that the initial state of the circuit is \(0\rangle^{\otimes n}\). Note that all arguments related to the noise are automatically provided by the quantum channel class.
 Returns
upper bound on the relative entropy between output of the circuit and fixed point of the noise.
 Return type
final_ent (float)
 Parameters
circuit (Cirq circuit) – cirq noiseless circuit whose output’s energy we wish to lowerbound.
number_qubits (integer) – the number of qubits of the circuit.
fixed_point (2x2 complex array) – density matrix corresponding to the fixed point of the noise.
contraction (float) – contraction of the noise towards the fixed point.
Entropic convergence for annealers¶
This module contains the functions used to estimate the relative entropy between the output of a noisy quantum annealer and the fixed point of the noise.
This estimate is performed using the entropic convergence result stated in Theorem 1 of “Limitations of optimization algorithms on noisy quantum devices”.
Note that we assume that the underlying annealing path is of the form \(f(t/T)H_0+g(t/T)H_I\), where \(H_0=\sum_i X_i\). This reflects the annealing paths that can be implmeented in contemporary platforms.

annealer_analyser.
entropy_output_annealer
(schedule, T, number_qubits, fixed_point, contraction)¶ Estimates the relative entropy between the output of a noisy annealer and the fixed point of the noise. The code assumes that the initial state of the circuit is \(+\rangle^{\otimes n}\) and that the annealing schedule is of the form \(f(t/T)H_0+g(t/T)H_I\), where \(f\) is the annealing schedule and \(H_0=\sum_iX_i\). The function \(g\) does not contribute to the final entropy, so we ignore if for now. Note that the contraction is now the contraction rate, as we are in continuous time.
 Returns
upper bound on the relative entropy between output of the circuit and fixed point of the noise.
 Return type
final_ent (float)
 Parameters
schedule (callable function) – function \(f:[0,1]\to\mathbb{R}\) that describes the annealing schedule.
T (float) – total annealing time.
number_qubits (integer) – the number of qubits of the annealer.
fixed_point (2x2 complex array) – density matrix corresponding to the fixed point of the noise. Note that is has to correspond to a classical state and we adopt the convention that the probability of observing 0 is larger than 1.
contraction (float) – contraction rate of the Linfbladian towards the fixed point. Note that we have