qrisp.QuantumFloat.significant#
- QuantumFloat.significant(k)[source]#
Returns the qubit with significance
.- Parameters:
- kint
The significance.
- Returns:
- Qubit
The Qubit with significance
.
- Raises:
- Exception
Tried to retrieve invalid significant from QuantumFloat
Examples
We create a QuantumFloat and flip a qubit of specified significance.
>>> from qrisp import QuantumFloat, x >>> qf = QuantumFloat(6, -3) >>> x(qf.significant(-2)) >>> print(qf) {0.25: 1.0}
The qubit with significance
corresponds to the value .>>> x(qf.significant(2)) {4.25: 1.0}
The qubit with significance
corresponds to the value .