qrisp.perm_unlock#

perm_unlock(qubits)[source]#

Reverses the effect of “perm_lock”.

Parameters:
qubitslist[Qubit] or QuantumVariable

The qubits to phase-tolerantly unlock.

Examples

We create a QuantumChar, perm-lock it’s Qubits and attempt to initialize.

>>> from qrisp import QuantumChar, perm_lock, perm_unlock
>>> q_ch = QuantumChar()
>>> perm_lock(q_ch)
>>> q_ch[:] = "g"
Exception: Tried to perform non-permeable operations on perm_locked qubits
>>> perm_unlock(q_ch)
>>> q_ch[:] = "g"
>>> print(q_ch)
{'g': 1.0}