qrisp.QuantumFloat.exp_shift#
- QuantumFloat.exp_shift(shift: int) None[source]#
Performs an internal bit shift.
Note that this method doesnβt cost any quantum gates. For the quantum version of this method, see
quantum_bit_shift.- Parameters:
- shiftint
The amount to shift.
- Raises:
- TypeError
Tried to shift QuantumFloat exponent by non-integer value
Examples
We create a QuantumFloat and perform a bitshift:
>>> from qrisp import QuantumFloat >>> a = QuantumFloat(4) >>> a[:] = 2 >>> a.exp_shift(2) >>> print(a) {8: 1.0} >>> print(a.qs) QuantumCircuit: --------------- a.0: βββββ βββββ a.1: β€ X β βββββ a.2: βββββ a.3: βββββ Live QuantumVariables: ---------------------- QuantumFloat a