Some utilities: QPtomographer.util

Utility routines for reliable process tomography.

QPtomographer.util.process_matrix(sigma_A, E_AB)

Returns the process matrix corresponding to the process E_AB (represented by its Choi matrix) applied onto the input state sigma_A. Both arguments must be qutip.Qobj objects.

This is simply \(\sigma_A^{1/2}\,E_{AB}\,\sigma_A^{1/2}\).

QPtomographer.util.projpauli(i, v)

Projector onto the eigenspace corresponding to the eigenvalue v of the i-th Pauli matrix counted from 1 (as a qutip.Qobj object)

QPtomographer.util.projpaulimat(i, v)

Projector onto the eigenspace corresponding to the eigenvalue v of the i-th Pauli matrix counted from 1 (as a NumPy array)

QPtomographer.util.simulate_process_measurements(sigma_A, E_AB, Mk_in, Mk_out, num_samples_per_setting)

Simulate measurements for process tomography. Mk_in and Mk_out describe the POVM effects applied on the reference system (or prepared as inputs) and the output system, respectively.

Both sigma_A and E_AB should be qutip.Qobj objects. sigma_A is the input state, which determines the probabilities of preparing each Mk_in effect, or alternatively, the reduced state on the reference system if the channel is applied onto half of a pure state. E_AB is the Choi matrix of the channel being applied, as a qutip.Qobj density matrix (NOT as a superoperator).

Mk_in and Mk_out must be lists of lists of POVM effects. Each POVM effect is a positive semidefinite matrix of norm ≤ 1. Mk[k][i] is the POVM effect corresponding to outcome i of measurement setting k; this applies both to the input and output effects.

num_samples_per_setting specifies the number of repetitions of the same pair of measurement settings. (I.e., for each pair of an input and an output measurement setting, we collect num_samples_per_setting measurement results.)

Returns: an object d with properties d.Emn and d.Nm, representing the POVM effects and simulated frequency counts. They are in a format suitable for direct input to the C++ code.

QPtomographer.util.simulate_process_prep_measure(E_AB, prep_meas_settings)

Simulate measurements for process tomography using the prepare-and-measure scheme, given a “true” quantum process E_AB, a list of input states and measurement settings specified by prep_meas_settings.

The process E_AB should be a qutip.Qobj containing the Choi matrix of the channel being applied, as a qutip.Qobj matrix (NOT as a superoperator). It should not be normalized, i.e., we expect \(\mathrm{tr}_B(E_{AB}) = \mathbb{I}_A\).

The argument prep_meas_settings must be a list of tuples (sigma_in, Mk_out, num_repeats), where sigma_in is an input state specified as a qutip.Qobj object, where Mk_out is a POVM specified as a list of POVM effects (each POVM effect is a positive semidefinite matrix of norm ≤ 1, and is specified as a qutip.Qobj matrix), and finally num_repeats is the number of times to repeat this setting.

Returns: an object d with properties d.Emn_ch, d.Nm, representing the arguments suitable for QPtomographer.channelspace.run() and the simulated frequency counts.