Module encoding

Module encoding 

Source
Expand description

Quantum state encoders (TorchQuantum-compatible)

This module provides encoding schemes for classical data into quantum states:

  • GeneralEncoder: Configurable encoder with custom gate sequences
  • PhaseEncoder: Phase encoding using RZ gates
  • StateEncoder: Direct state vector encoding
  • AmplitudeEncoder: Amplitude encoding

Structs§

EncodingOp
Encoding operation specification
TQAngleEncoder
Angle encoder - encodes data as angles in rotation gates More flexible than PhaseEncoder with configurable scaling
TQGeneralEncoder
General encoder with configurable gate sequence
TQIQPEncoder
IQP (Instantaneous Quantum Polynomial) encoder Encodes data using IQP-style circuit with entangling ZZ interactions
TQMagnitudeEncoder
Magnitude encoder - encodes data in the magnitude of amplitudes Each classical value is mapped to the magnitude of a computational basis state
TQMultiPhaseEncoder
Multi-phase encoder - applies multiple rotation gates to each qubit Each feature is encoded with a sequence of gates (e.g., RX, RY, RZ)
TQPhaseEncoder
Phase encoder (applies same rotation type to all qubits)
TQStateEncoder
Amplitude/State encoder (direct state preparation)

Traits§

TQEncoder
Base encoder trait

Type Aliases§

TQAmplitudeEncoder
Alias for amplitude encoding