:py:mod:`kosmos.ml.models.vqc.encoding.qiskit_encoding` ======================================================= .. py:module:: kosmos.ml.models.vqc.encoding.qiskit_encoding Classes ------- .. py:class:: QiskitAngleEmbedding(input_dim: int, output_dim: int, rotation: Literal['X', 'Y', 'Z']) Bases: :py:class:`kosmos.ml.models.vqc.encoding.encoding.AngleEmbedding` Angle embedding for the VQC using Qiskit. Initialize the angle embedding. :param input_dim: The input dimension of the model. :type input_dim: int :param output_dim: The output dimension of the model. :type output_dim: int :param rotation: The rotation to use for the angle embedding. :type rotation: Literal["X", "Y", "Z"] | .. rubric:: Properties .. py:property:: framework The framework used for the quantum circuit. .. py:property:: num_qubits Number of required qubits. | .. rubric:: Methods .. py:method:: apply_operation(features: torch.Tensor, wires: collections.abc.Sequence[int], qc: qiskit.QuantumCircuit | None = None) -> None Apply the Qiskit angle embedding operation for encoding. :param features: Input features. :type features: Tensor :param wires: Target wires. :type wires: Sequence[int] :param qc: The quantum circuit to use for the encoding (only for 'qiskit' framework). :type qc: QuantumCircuit | None ---- .. py:class:: QiskitAmplitudeEmbedding(input_dim: int, output_dim: int, pad_with: complex, *, normalize: bool) Bases: :py:class:`kosmos.ml.models.vqc.encoding.encoding.AmplitudeEmbedding` Amplitude embedding for the VQC using Qiskit. Initialize the amplitude embedding. :param input_dim: The input dimension of the model. :type input_dim: int :param output_dim: The output dimension of the model. :type output_dim: int :param pad_with: The input is padded with this constant to size :math:`2^n`. :type pad_with: complex :param normalize: Whether to normalize the features. :type normalize: bool | .. rubric:: Properties .. py:property:: framework The framework used for the quantum circuit. .. py:property:: num_qubits Number of required qubits. | .. rubric:: Methods .. py:method:: apply_operation(features: torch.Tensor, wires: collections.abc.Sequence[int], qc: qiskit.QuantumCircuit | None = None) -> None Apply the Qiskit amplitude embedding operation for encoding. :param features: Input features. :type features: Tensor :param wires: Target wires. :type wires: Sequence[int] :param qc: The quantum circuit to use for the encoding (only for 'qiskit' framework). :type qc: QuantumCircuit | None