Skip to main content
Functions:
NameDescription
encode_in_angle[Qmod Classiq-library function].
encode_on_bloch[Qmod Classiq-library function].

encode_in_angle

encode_in_angle(
data: CArray[CReal],
qba: Output[QArray[QBit]]
) -> None
[Qmod Classiq-library function] Creates an angle encoding of n data points on n qubits. Applies RY(π\pidata[i]) on qba[i]. Parameters:
NameTypeDescriptionDefault
dataCArray[CReal]A classical array representing the data to encode.required
qbaOutput[QArray[QBit]]The array of qubits on which the data is encoded.required

encode_on_bloch

encode_on_bloch(
data: CArray[CReal],
qba: Output[QArray]
) -> None
[Qmod Classiq-library function] Creates a dense angle encoding of n data points on n//2 qubits. Encodes pairs of data points on a Bloch sphere, via RX(π\pidata[2i])RZ(π\pidata[2i+1]) on qba[i]. If the length of the data is odd then RX(π\pidata[i]) is applied on the last qubit. Parameters:
NameTypeDescriptionDefault
dataCArray[CReal]A classical array representing the data to encode.required
qbaOutput[QArray]The QArray of QBits on which the data is encoded.required