Encode#
- class discopy.quantum.gates.Encode(name=None, dom=None, cod=None, data=None, *args, **kwargs)[source]#
Bases:
SelfConjugate
Controlled preparation, i.e. encode n bits into n qubits.
- Parameters:
n_bits (int) – Number of bits to encode.
constructive (bool, optional) – Whether to do a classically-controlled correction instead.
reset_bits (bool, optional) – Whether to reset the bits to the uniform distribution.