qilisdk.backends.backend

Classes

Backend

Abstract base class for all quantum simulation backends.

Module Contents

class Backend(noise_model: qilisdk.noise.NoiseModel | None = None)[fuente]

Bases: abc.ABC

Abstract base class for all quantum simulation backends.

Subclasses must override one or more of the _execute_* methods to provide concrete simulation logic. The public execute() method dispatches to the appropriate handler based on the functional type.

Initialise the backend with an optional noise model.

Parámetros:

noise_model (NoiseModel | None) – Optional noise model applied during execution. Defaults to None.

execute(functional: qilisdk.functionals.variational_program.VariationalProgram, readout: qilisdk.readout.Readout[qilisdk.readout.S, qilisdk.readout.E, qilisdk.readout.T]) qilisdk.functionals.variational_program_result.VariationalProgramResult[qilisdk.functionals.functional_result.FunctionalResult[qilisdk.readout.S, qilisdk.readout.E, qilisdk.readout.T]][fuente]
execute(functional: qilisdk.functionals.functional.PrimitiveFunctional, readout: qilisdk.readout.Readout[qilisdk.readout.S, qilisdk.readout.E, qilisdk.readout.T]) qilisdk.functionals.functional_result.FunctionalResult[qilisdk.readout.S, qilisdk.readout.E, qilisdk.readout.T]

Execute a quantum functional with the specified readout methods.

This is the main entry point for running any supported functional on the backend. The method validates the readout specification, then dispatches to the appropriate _execute_* handler registered for the functional type.

Parámetros:
  • functional – The quantum functional to execute.

  • readout – A Readout built via the builder pattern.

Devuelve:

The execution result whose concrete type depends on the functional and readout specification. Its execution_time attribute holds the wall-clock time, in seconds, taken by the backend to run the simulation.

Muestra:
  • NotImplementedError – If the backend does not support the given functional type.

  • ValueError – If the readout specification is empty.