Skip to main content
Functions:

free

free(
in_: Input[QArray[QBit]]
) -> None
[Qmod core-library function] Releases the qubits allocated to a quantum variable, allowing them to be reused. Parameters:

prepare_state

prepare_state(
probabilities: CArray[CReal],
bound: CReal,
out: Output[QArray[QBit, Literal[‘log(probabilities.len, 2)’]]]
) -> None
[Qmod core-library function] Initializes a quantum variable in a state corresponding to a given probability distribution: out=i=0len(probabilities)1probabilities[i]i \left|\text{out}\right\rangle = \sum_{i=0}^{\text{len(probabilities)}-1} \sqrt{\text{probabilities}[i]} \left|i\right\rangle with i=0,1,2,...,{len(amplitudes)}1i = 0, 1, 2, ..., \text\{len(amplitudes)\}-1 corresponding to computational basis states. Parameters:

prepare_amplitudes

prepare_amplitudes(
amplitudes: CArray[CReal],
bound: CReal,
out: Output[QArray[QBit, Literal[‘log(amplitudes.len, 2)’]]]
) -> None
[Qmod core-library function] Initializes a quantum variable in a state corresponding to the given amplitudes: out=i=0len(amplitudes)1amplitudes[i]i \left|\text{out}\right\rangle = \sum_{i=0}^{\text{len(amplitudes)}-1} \text{amplitudes}[i] \left|i\right\rangle with i=0,1,2,...,{len(amplitudes)}1i = 0, 1, 2, ..., \text\{len(amplitudes)\}-1 corresponding to computational basis states. Parameters:

inplace_prepare_state

inplace_prepare_state(
probabilities: CArray[CReal],
bound: CReal,
target: QArray[QBit, Literal[‘log(probabilities.len, 2)’]]
) -> None
[Qmod core-library function] Transforms a given quantum variable in the state |0> to the state per the specified probability distribution (similar to prepare_state but preformed on an initialized variable). Parameters:

inplace_prepare_amplitudes

inplace_prepare_amplitudes(
amplitudes: CArray[CReal],
bound: CReal,
target: QArray[QBit, Literal[‘log(amplitudes.len, 2)’]]
) -> None
[Qmod core-library function] Transforms a given quantum variable in the state |0> to the state per the specified amplitudes (similar to prepare_amplitudes but preformed on an initialized variable). Parameters:

assign_phase_table

assign_phase_table(
phases: CArray[CReal],
target: Const[QArray[QBit, Literal[‘log(phases.len, 2)’]]]
) -> None
[Qmod core-library function] Transforms a given quantum variable in the state |n> to e{iphases[n]}e^\{i phases[n]\} |n> for all n, where |n> are the computational basis states. Parameters: