This program showcases the possibility to use a QUA program and the OPX to perform a single qubit state tomography experiment.
Quantum state tomography is the attempt to discover the quantum-mechanical state of a physical system, or more precisely, of a finite set of systems prepared by the same process. The experimenter acquires a set of measurements of different non-commuting observables and tries to estimate what the density matrix of the systems must have been before the measurements were made, with the goal of being able to predict the statistics of future measurements generated by the same process. In this sense, quantum state tomography characterizes a state preparation process that is assumed to be stable over time.
Source : Schmied, Roman. ”Quantum state tomography of a single qubit: comparison of methods.” Journal of Modern Optics 63.18 (2016): 1744-1758. https://arxiv.org/abs/1407.4759
The state of quantum bit can be written with the following density matrix : with being called the Bloch vector and is such that . Here is a vector with components (
We also define and recall that Tr(. This implies that we have that , and .
The idea behind qubit state tomography is to find a way to recover the Bloch vector. There exist a bunch of methods to do so, we present here two of them : direct inversion and Bayesian mean estimate.
The direct inversion method is the simplest one to derive, and this is because its main hypothesis is the assumption of the equality between the quantum mechanical average introduced above and the statistical empirical mean deduced from actual sampling. Recalling that from an arbitrary qubit state , we have that . Based on the hypothesis above, it is therefore enough to measure the state in the computational basis times ( being sufficiently large to build relying statistics) and to estimate the quantum average of the operator by computing : with and being the number of sampled and states respectively.
For the Pauli-Y and Pauli-X operators, one can proceed in a similar manner by applying an additional unitary transformation on the qubit state before measuring it and computing their expectation values like the Pauli-Z. We have that : , with being the Hadamard gate, and . A similar reasoning can be done with by replacing the Hadamard transformation above by the operator , with .
Once we have proceeded to these measurements, we can therefore reconstruct the Bloch vector using the result of the previous part. Finally we have : . The advantage of this method is undeniably its simplicity. However, one main drawback is the fact that due to statistical noise related to sampling, it is sometimes possible to have reconstructed Bloch vectors which are not physically valid for the density matrix to be corresponding to a valid quantum state.
This method provides an alternative to the problem related to the physicality of the reconstructed density matrix raised by the direct inversion process. The idea here is to construct a likelihood function which is interpreted as a density in the state space (i.e the Bloch sphere), and use it to calculate a weighted mean state. The Bayesian mean estimate of the Bloch vector can be written as :
Given a set of experimental measurements (), Bayes' theorem tell us that the likelihood that a certain density matrix was related to the generation of this data is :
where is a prior density in the space of density matrices, vanishing whenever . In this example, we consider a uniform distribution. The probability distribution is simply the probability of obtaining the experimental data conditioned on having an initial density matrix . One can convince himself pretty easily that this distribution is a product of three binomial schemes (one for each axis) with parameters (, with . More specifically we have :
The calculation of the integral for obtaining the Bloch vector can then be done numerically by using, for example Monte Carlo integration (https://en.wikipedia.org/wiki/Monte_Carlo_integration).
The configuration file is architectured around the following items :
- controllers : We define the outputs and inputs of the OPX device, which will be of use for the experiment. In this case, we have two analog outputs for the qubit, and two others for its coupled readout resonator. We add an analog input which is the channel where will be sampled out the analog results of the readout operation.
- elements : This defines the set of essential components of the quantum system interacting with the OPX. In this case, the two elements are the qubit and the coupled readout resonator. Here are specified the main characteristics of the element, such as its resonant frequency, its associated operations (i.e the operations the OPX can apply on the element).
- pulses : A description of the doable pulses introduced in the elements. Here is provided a description of the default pulse duration (length parameter), the associated waveform (which can be taken from an arbitrary array), the type of operation (e.g control or measurement)
- waveforms : Specification of the pulse shape based on pre-built arrays (either by the user in case the shape is arbitrary, or constant pulse otherwise)
- Integration weights : Describe the demodulation process of the data
Around the program are shown few built-in Python functions acting as macros commands for QUA. Those functions are meant to allow flexibility in the definition of the pulse implementation of the state we want to prepare (there might be a need to add pulses types in the configuration file), and the way to implement the Hadamard gate, which can be hardware dependent. There is also a post processing function named stateestimation where the determination of obtaining the 0 or 1 state should be defined according to the value of the point obtained in the IQ plane by the demodulation process. The program itself consists in doing 3 times (one for each axis of the Bloch sphere) the same scheme within a QUA for loop (indicating the number of samples we want to get for each direction):
- Generate the arbitrary state calling the "Arbitrary_state_generation" function
- Proceed to necessary unitary transformations depending on the axis chosen and perform the measurement
- Save results in the stream variables defined in the beginning of the program
- use a wait command to let the state reset to the state for repeating the same experiment (we assume we know the relaxation time )
Once this is done, the program is simulated using the LoopbackInterface and the retrieval of the data is possible. We then use the state discrimination function to decide what measurement we obtained based on the IQ values obtained. Finally, we reconstruct the Bloch vector using the two methods presented above.
The function "is_physical()" simply returns a Boolean checking if the Bloch vector reconstructed yields a valid quantum state or not.