qrao.encoding

Quantum Random Access Encoding module.

Contains code dealing with QRACs (quantum random access codes) and preparation of such states.

z_to_31p_qrac_basis_circuit(basis)

Return the basis rotation corresponding to the (3,1,p)-QRAC

z_to_21p_qrac_basis_circuit(basis)

Return the basis rotation corresponding to the (2,1,p)-QRAC

qrac_state_prep_1q(*m)

Prepare a single qubit QRAC state

qrac_state_prep_multiqubit(dvars, q2vars, ...)

Prepare a multiqubit QRAC state.

QuantumRandomAccessEncoding([max_vars_per_qubit])

This class specifies a Quantum Random Access Code that can be used to encode the binary variables of a QUBO (quadratic unconstrained binary optimization problem).

Functions

q2vars_from_var2op(var2op)

Calculate q2vars given var2op

qrac_state_prep_1q(*m)

Prepare a single qubit QRAC state

qrac_state_prep_multiqubit(dvars, q2vars, ...)

Prepare a multiqubit QRAC state.

z_to_21p_qrac_basis_circuit(basis)

Return the basis rotation corresponding to the (2,1,p)-QRAC

z_to_31p_qrac_basis_circuit(basis)

Return the basis rotation corresponding to the (3,1,p)-QRAC

Classes

EncodingCommutationVerifier(encoding)

Class for verifying that the relaxation commutes with the objective function

QuantumRandomAccessEncoding([max_vars_per_qubit])

This class specifies a Quantum Random Access Code that can be used to encode the binary variables of a QUBO (quadratic unconstrained binary optimization problem).