plot_pauli_rep_of_state

forest.benchmarking.plotting.plot_pauli_rep_of_state(state_pl_basis, ax, labels, title)

Visualize a quantum state in the Pauli-Liouville basis.

Examples:
from forest.benchmarking.superoperator_tools import *
from forest.benchmarking.utils import n_qubit_pauli_basis
# zero state in the (Z) computational basis
rho_std_basis = np.array([[1, 0], [0, 0]])
# change to Pauli-Liouville basis
n_qubits = 1
pl_basis = n_qubit_pauli_basis(n_qubits)
c2p = computational2pauli_basis_matrix(2*n_qubits)
rho_pl_basis = np.real(c2p@vec(rho_std_basis))
# plot
fig, ax = plt.subplots(1)
plot_pauli_rep_of_state(rho_pl_basis, ax, pl_basis.labels, 'Zero state |0>')
Parameters:
  • state_pl_basis (numpy.ndarray) – The quantum state represented in the Pauli-Liouville basis.
  • ax – The matplotlib axes.
  • labels – The labels for the operator basis states.
  • title – The title for the plot.