qdk_chemistry.algorithms.state_preparation._binary_encoding_utils module

Binary encoding circuit synthesiser for REF matrices.

class qdk_chemistry.algorithms.state_preparation._binary_encoding_utils.MatrixCompressionOp(name, qubits, control_state=0, lookup_data=<factory>)[source]

Bases: object

Gate representation for matrix compression operations.

Parameters:
control_state: int = 0
to_dict()[source]

Serialize to a camelCase dict matching the Q# MatrixCompressionOp struct.

Returns:

Dictionary matching the Q# MatrixCompressionOp fields.

Return type:

dict[str, Any]

to_qsharp_parameter()[source]

Convert to a Q# MatrixCompressionOp struct.

Returns:

A Q# MatrixCompressionOp struct instance for use in Q# interop.

__init__(name, qubits, control_state=0, lookup_data=<factory>)
Parameters:
Return type:

None

class qdk_chemistry.algorithms.state_preparation._binary_encoding_utils.MatrixCompressionType(*values)[source]

Bases: CaseInsensitiveStrEnum

Supported operation types for matrix compression.

Each member carries the integer discriminator consumed by BinaryEncoding.qs. Q# cannot compare strings in QIR-emitting code, so the wire value has to be an Int; declaring it alongside the name keeps the two from drifting.

X = 'X'
CX = 'CX'
SWAP = 'SWAP'
CCX = 'CCX'
SELECT = 'SELECT'
SELECT_AND = 'SELECT_AND'