mimiqcircuits.operations.losschannel¶
Loss-channel operations.
Functions
|
|
Classes
|
Check operation. |
|
Loss operation. |
MeasureCheck operation. |
|
|
Reload operation. |
- class mimiqcircuits.operations.losschannel.Loss(p=1.0)[source]¶
Bases:
OperationLoss operation.
A qubit-loss event: the qubit is lost with probability
p.Loss()isLoss(1.0), a certain loss. It replaces bothLossErrandQubitLoss.The probability is resolved by
mimiqcircuits.Circuit.sample_losses(), which turns eachLoss(p)intoLoss(1.0)or removes it, and a circuit is turned into a runnable, loss-free form bymimiqcircuits.Circuit.resolve_losses().Warning
This operation is non-reversible.
- Parameters:
p – The loss probability, real and between 0 and 1. Defaults to 1.0.
Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(Loss(0.1), 0) 1-qubit circuit with 1 instruction: └── Loss(0.1) @ q[0] >>> c.push(Loss(), 1) 2-qubit circuit with 2 instructions: ├── Loss(0.1) @ q[0] └── Loss(1.0) @ q[1]
See also
- class mimiqcircuits.operations.losschannel.Reload[source]¶
Bases:
OperationReload operation.
Re-initialise a qubit to \(|0\rangle\) and mark it present. By default a reload always resets, regardless of whether the qubit was lost. It replaces
QubitReload.Warning
This operation is non-reversible.
Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(Reload(), 0) 1-qubit circuit with 1 instruction: └── Reload @ q[0]
See also
Loss,Reset
- class mimiqcircuits.operations.losschannel.Check[source]¶
Bases:
OperationCheck operation.
Record whether a qubit is present into a classical bit (1 present, 0 lost). Like
Measurerecords a qubit’s value,Checkrecords its presence; it does not touch the quantum state. It replacesCheckLoss.Warning
This operation is non-reversible.
Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(Check(), 0, 0) 1-qubit, 1-bit circuit with 1 instruction: └── Check @ q[0], c[0]
See also
- class mimiqcircuits.operations.losschannel.MeasureCheck[source]¶
Bases:
OperationMeasureCheck operation.
Measure a qubit if it is present, and record its presence. The first bit is the measurement result (0 if lost), the second is the presence (1 present, 0 lost). The state is collapsed only when the qubit is present. It replaces
MeasureCheckLoss.Warning
This operation is non-reversible.
Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(MeasureCheck(), 0, 0, 1) 1-qubit, 2-bit circuit with 1 instruction: └── MeasureCheck @ q[0], c[0:1]