qrisp.QuantumVariable.__init__#

QuantumVariable.__init__(size: int, qs: QuantumSession | None = None, name: str | None = None)[source]#

Constructs a QuantumVariable.

Constructs a QuantumVariable, possibly with a given name or in a given QuantumSession.

Parameters:
sizeint

The amount of qubits this QuantumVariable contains.

qsQuantumSession, optional

A QuantumSession object, where the QuantumVariable is supposed to be registered. The default is None.

namestring, optional

A name which uniquely identifies the QuantumVariable. If ended with a *, name is allowed to be updated if a naming collision arises. By default, Qrisp will try to infer the name of the Python variable - otherwise a generic name is given.

Raises:
QuantumVariableNamingError

Name of qv is already used in this QuantumSession.