qrisp.cks.unary_prep#

unary_prep(case, coeffs)[source]#

Prepares the unary-encoded state \(\ket{\text{unary}}\) of Chebyshev coefficients.

When applied to a variable in state \(\ket{0}\), the resulting superposition is

\[\ket{\text{unary}} \propto \sqrt{\alpha_1}\ket{100\dots00} + \sqrt{\alpha_3}\ket{110\dots00} + \cdots + \sqrt{\alpha_{2j_0+1}}\ket{111\dots11}\]
Parameters:
caseQuantumVariable

Variable with \(j_0\) qubits on which the unary state preparation will be performed. If the variable is in state \(\ket{0}\), the state \(\ket{\text{unary}}\) is prepared.

coeffsnumpy.ndarray

An array of \(j_0\) Chebyshev coefficients \(\alpha_1,\alpha_3,\dotsc,\alpha_{2j_0+1}\).