Magic.MagicQubit¶
- Magic.MagicQubit.Pauli2Stab(A_mat, n_qubit)¶
- Required packages:¶
channel_magic v2.0 https://github.com/jamesrseddon/channel_magic
Convert Pauli representations of pure stabilizers in A_mat to stabilizer matrices:
- Parameters:¶
A_mat – Pauli representations of pure stabilizers from the package channel_magic v2.0.
n_qubit (
int
) – Number of qubits.
- Returns:¶
Stabilizer matrices where each column is a pure stabilizer state.
- Return type:¶
numeric
- Raises:¶
error
– If the number of qubits does not match with the A_mat file provided, an error is raised.- Examples:¶
A_mat_2 = load('Amat2.mat'); Stab_Vec = Pauli2Stab(A_mat_2, 2); % Convert Pauli representations of 2-qubit pure stabilizers in A_mat % to stabilizer matrices.
- Magic.MagicQubit.QubitHstate()¶
Generate H state
Note
Emerson, J. (2014). The resource theory of stabilizer computation. Bulletin of the American Physical Society, 59.
- Magic.MagicQubit.QubitTstate()¶
Generate qubit T state
Note
Emerson, J. (2014). The resource theory of stabilizer computation. Bulletin of the American Physical Society, 59.
- Magic.MagicQubit.RandomCSPO(num_s)¶
Sampling num_s random qubit-qubit channels and sift the qubit-qubit CSPO.
- Parameters:¶
num_s (
int
) – The number of sampling random qubit-qubit channels.- Returns:¶
cell array containing the sift CSPO.
- Return type:¶
numeric
- Raises:¶
error
– None.- Examples:¶
Chois_CSPO_cell = RandomCSPO(10000); % Sampling 10000 random qubit-qubit channels and sift the qubit-qubit % CSPO.
Note
Wang, X., Wilde, M. M., & Su, Y. (2019). Quantifying the magic of quantum channels. New Journal of Physics, 21(10), 103002.
- Magic.MagicQubit.RoM_Chan(J, A_mat)¶
- Dependencies:¶
Trans_K findChoiCPTProbustness from channel_magic v2.0 https://github.com/jamesrseddon/channel_magic
\[\mathcal{R}_*(\mathcal{N}) := \min_{\mathcal{N}_{\pm} \in \text{CSPO}} \big\{ 2p+1: \mathcal{N}=(1+p)\mathcal{N}_+ - p \mathcal{N}_-, p\geq 0\big\}\]Compute the Channel robustness of a Choi matrix
- Parameters:¶
J (
numeric
) – Choi matrix of a quantum channel.A_mat – Pauli representations of pure stabilizers form the package channel_magic v2.0.
- Returns:¶
Channel robustness of the channel.
- Return type:¶
numeric
- Raises:¶
error
– If dimension of channel does not match with the A_mat file provided, an error is raised.
Note: Seddon, J. R., & Campbell, E. T. (2019). Quantifying magic for multi-qubit operations. Proceedings of the Royal Society A, 475(2227), 20190251.
- Magic.MagicQubit.RobMag(rho, Stab)¶
From https://bartoszregula.me/code/magic
\[\mathcal{R}(\rho) = \min_{\textbf{q}}\Big\{ \| \textbf{q} \|_1 \ : \rho=\sum_i q_i \ketbra{s_i}{s_i} \ , \ketbra{s_i}{s_i} \in \mathrm{STAB}_n \Big\},\]- Parameters:¶
rho (
numeric
) – The density matrix of a n-qubit quantum state.Stab (
numeric
) – A matrix whose columns are pure stabilizer states.
- Returns:¶
The robustness of magic states.
- Return type:¶
numeric
- Raises:¶
error
– If the dimension of the input state does not match with the pure stabilizer state matrix, an error is raised.
Note: Howard, M., & Campbell, E. (2017). Application of a resource theory for magic states to fault-tolerant quantum computing. Physical review letters, 118(9), 090501.
- Magic.MagicQubit.Stabilizer_Renyi_Entropy(rho, alpha)¶
- \[M_\alpha(\psi):=(1-\alpha)^{-1} \log \sum_{P \in \mathcal{P}_n} \Xi_P^\alpha(\psi)-\log d\]
where \(\Xi_P^\alpha(\psi) =d^{-1}\tr^2(P\psi)\) and :math: mathcal{P}_n denotes the set of all n-qubit Pauli operators.
- Parameters:¶
rho (
numeric
) – The density matrix of a n-qubit quantum state.alpha (
numeric
) – alpha parameter.
- Returns:¶
The Stabilizer Renyi Entropy of magic states.
- Return type:¶
numeric
- Raises:¶
error
– If the input state is not a pure state, an error is raised.
Note: Leone, L., Oliviero, S. F., & Hamma, A. (2022). Stabilizer rényi entropy. Physical Review Letters, 128(5), 050402.