mimiqcircuits.operations.noisechannel.standards.ampdamping¶
Classes
|
One-qubit amplitude damping noise channel. |
|
One-qubit generalized amplitude damping noise channel. |
- class GeneralizedAmplitudeDamping(p, gamma)[source]¶
Bases:
krauschannelOne-qubit generalized amplitude damping noise channel.
Amplitude damping towards a thermal state instead of \(|0\rangle\): with weight \(p\) the qubit decays from \(|1\rangle\) to \(|0\rangle\), with weight \(1-p\) it is excited from \(|0\rangle\) to \(|1\rangle\), in both cases with probability \(\gamma\). The Kraus operators are
\[\begin{split}E_1 = \sqrt{p} \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1-\gamma} \end{pmatrix} ,\quad E_2 = \sqrt{1-p} \begin{pmatrix} \sqrt{1-\gamma} & 0 \\ 0 & 1 \end{pmatrix} ,\quad E_3 = \sqrt{p} \begin{pmatrix} 0 & \sqrt{\gamma} \\ 0 & 0 \end{pmatrix} ,\quad E_4 = \sqrt{1-p} \begin{pmatrix} 0 & 0 \\ \sqrt{\gamma} & 0 \end{pmatrix}.\end{split}\]For \(p = 1\) it reduces to
AmplitudeDamping.- Parameters:
- Raises:
ValueError – If a numeric
porgammais outside \([0, 1]\).
See also
AmplitudeDamping,PhaseAmplitudeDampingExamples
>>> from mimiqcircuits import * >>> # p = 1: pure decay to |0>, same as AmplitudeDamping(0.1) >>> c = Circuit() >>> c.push(GeneralizedAmplitudeDamping(1, 0.1), 0) 1-qubit circuit with 1 instruction: └── GeneralizedAmplitudeDamping((1, 0.1)) @ q[0]
- evaluate(d={})[source]¶
Return a copy with symbols in
pandgammasubstituted by values.- Parameters:
d (dict) – Map from symbols to the values to substitute.
- Returns:
A new channel; each parameter becomes a float when it is fully numeric.
- Return type:
- Raises:
ValueError – If a substituted parameter is outside \([0, 1]\).
- krausoperators()[source]¶
Return the Kraus operators \(E_k\) of the channel as operator objects.
Every concrete channel implements this method; the base class raises.
- Returns:
One operator (for example
Operator,DiagonalOporRescaledGate) per Kraus operator.- Return type:
- Raises:
NotImplementedError – When called on a class that does not define it.
Examples
>>> from mimiqcircuits import * >>> # projective noise in Z: project on |0> or on |1> >>> ProjectiveNoise("Z").krausoperators() [P₀(1), P₁(1)]
- krausmatrices()[source]¶
Return the matrices of the Kraus operators \(E_k\) of the channel.
These are the matrices of
krausoperators(), in the same order. For a parametric channel the entries are symbolic expressions.- Returns:
One symengine matrix per Kraus operator.
- Return type:
Examples
>>> from mimiqcircuits import * >>> AmplitudeDamping(0.36).krausmatrices() [[1.0, 0] [0, 0.8] , [0, 0.6] [0, 0] ]
- iswrapper()[source]¶
Whether the operation wraps another operation.
Truefor composite operations such asControl,Power,Inverse,ParallelorIfStatement,Falseotherwise.- Returns:
bool
- property num_qubits¶
Number of qubits the operation acts on.
Read-only: assigning to it raises
ValueError.
- property parnames¶
Names of the operation’s parameters, as a tuple of strings.
Read-only: assigning to it raises
ValueError.
- class AmplitudeDamping(gamma)[source]¶
Bases:
krauschannelOne-qubit amplitude damping noise channel.
Models energy relaxation: the excited state \(|1\rangle\) decays to \(|0\rangle\) with probability \(\gamma\). The Kraus operators are
\[\begin{split}E_1 = \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1-\gamma} \end{pmatrix} ,\quad E_2 = \begin{pmatrix} 0 & \sqrt{\gamma} \\ 0 & 0 \end{pmatrix}.\end{split}\]- Parameters:
gamma (float) – Damping probability, in \([0, 1]\); may be symbolic.
- Raises:
ValueError – If a numeric
gammais outside \([0, 1]\).
See also
GeneralizedAmplitudeDamping,PhaseAmplitudeDampingExamples
>>> from mimiqcircuits import * >>> # |1> decays to |0> with probability 0.1 >>> c = Circuit() >>> c.push(AmplitudeDamping(0.1), 0) 1-qubit circuit with 1 instruction: └── AmplitudeDamping(0.1) @ q[0]
- evaluate(d={})[source]¶
Return a copy with symbols in
gammasubstituted by values.- Parameters:
d (dict) – Map from symbols to the values to substitute.
- Returns:
A new channel;
gammabecomes a float when it is fully numeric.- Return type:
- Raises:
ValueError – If the substituted
gammais outside \([0, 1]\).
- krausoperators()[source]¶
Return the Kraus operators \(E_k\) of the channel as operator objects.
Every concrete channel implements this method; the base class raises.
- Returns:
One operator (for example
Operator,DiagonalOporRescaledGate) per Kraus operator.- Return type:
- Raises:
NotImplementedError – When called on a class that does not define it.
Examples
>>> from mimiqcircuits import * >>> # projective noise in Z: project on |0> or on |1> >>> ProjectiveNoise("Z").krausoperators() [P₀(1), P₁(1)]
- krausmatrices()[source]¶
Return the matrices of the Kraus operators \(E_k\) of the channel.
These are the matrices of
krausoperators(), in the same order. For a parametric channel the entries are symbolic expressions.- Returns:
One symengine matrix per Kraus operator.
- Return type:
Examples
>>> from mimiqcircuits import * >>> AmplitudeDamping(0.36).krausmatrices() [[1.0, 0] [0, 0.8] , [0, 0.6] [0, 0] ]
- iswrapper()[source]¶
Whether the operation wraps another operation.
Truefor composite operations such asControl,Power,Inverse,ParallelorIfStatement,Falseotherwise.- Returns:
bool
- property parnames¶
Names of the operation’s parameters, as a tuple of strings.
Read-only: assigning to it raises
ValueError.