modules.applications.qml.model.Model

class Model

Bases: ABC

Abstract base class for any quantum model. This class defines the necessary methods that models like 'LibraryGenerative' must implement.

__init__()

Methods

__init__()

get_execute_circuit(circuit, backend, ...)

This method combines the circuit implementation and the selected backend and returns a function that will be called during training.

select_backend(config, n_qubits)

This method configures the backend.

sequence_to_circuit(input_data)

Abstract method to convert a sequence into a quantum circuit.

abstract static get_execute_circuit(circuit: any, backend: any, config: str, config_dict: dict) tuple[any, any]

This method combines the circuit implementation and the selected backend and returns a function that will be called during training.

Parameters:
  • circuit -- Implementation of the quantum circuit

  • backend -- Configured qiskit backend

  • config -- Name of a backend

  • config_dict -- Dictionary including the number of shots

Returns:

Tuple that contains a method that executes the quantum circuit for a given set of parameters and the

transpiled circuit

abstract static select_backend(config: str, n_qubits: int) any

This method configures the backend.

Parameters:
  • config -- Name of a backend

  • n_qubits -- Number of qubits

Returns:

Configured backend

abstract sequence_to_circuit(input_data: dict) dict

Abstract method to convert a sequence into a quantum circuit.

Parameters:

input_data -- Input data representing the gate sequence

Returns:

A dictionary representing the quantum circuit