Korean
언어
English
Japanese
German
Korean
Shortcuts

qiskit.providers.aer.StatevectorSimulator

class StatevectorSimulator(configuration=None, properties=None, provider=None, **backend_options)[소스]

Ideal quantum circuit statevector simulator

Configurable Options

The StatevectorSimulator supports CPU and GPU simulation methods and additional configurable options. These may be set using the appropriate kwargs during initialization. They can also be set of updated using the set_options() method.

Run-time options may also be specified as kwargs using the run() method. These will not be stored in the backend and will only apply to that execution. They will also override any previously set options.

For example, to configure a a single-precision simulator

backend = StatevectorSimulator(precision='single')

Backend Options

The following configurable backend options are supported

  • method (str): Set the simulation method supported methods are "statevector" for CPU simulation, and "statevector_gpu" for GPU simulation (Default: "statevector").

  • precision (str): Set the floating point precision for certain simulation methods to either "single" or "double" precision (default: "double").

  • zero_threshold (double): Sets the threshold for truncating small values to zero in the result data (Default: 1e-10).

  • validation_threshold (double): Sets the threshold for checking if the initial statevector is valid (Default: 1e-8).

  • max_parallel_threads (int): Sets the maximum number of CPU cores used by OpenMP for parallelization. If set to 0 the maximum will be set to the number of CPU cores (Default: 0).

  • max_parallel_experiments (int): Sets the maximum number of qobj experiments that may be executed in parallel up to the max_parallel_threads value. If set to 1 parallel circuit execution will be disabled. If set to 0 the maximum will be automatically set to max_parallel_threads (Default: 1).

  • max_memory_mb (int): Sets the maximum size of memory to store a state vector. If a state vector needs more, an error is thrown. In general, a state vector of n-qubits uses 2^n complex values (16 Bytes). If set to 0, the maximum will be automatically set to half the system memory size (Default: 0).

  • statevector_parallel_threshold (int): Sets the threshold that 《n_qubits》 must be greater than to enable OpenMP parallelization for matrix multiplication during execution of an experiment. If parallel circuit or shot execution is enabled this will only use unallocated CPU cores up to max_parallel_threads. Note that setting this too low can reduce performance (Default: 14).

These backend options apply in circuit optimization passes:

  • fusion_enable (bool): Enable fusion optimization in circuit optimization passes [Default: True]

  • fusion_verbose (bool): Output gates generated in fusion optimization into metadata [Default: False]

  • fusion_max_qubit (int): Maximum number of qubits for a operation generated in a fusion optimization [Default: 5]

  • fusion_threshold (int): Threshold that number of qubits must be greater than or equal to enable fusion optimization [Default: 14]

Aer class for backends.

This method should initialize the module and its configuration, and raise an exception if a component of the module is not available.

매개변수
  • configuration (BackendConfiguration) – backend configuration.

  • properties (BackendProperties or None) – Optional, backend properties.

  • defaults (PulseDefaults or None) – Optional, backend pulse defaults.

  • available_methods (list or None) – Optional, the available simulation methods if backend supports multiple methods.

  • provider (BaseProvider) – Optional, provider responsible for this backend.

  • backend_options (dict or None) – Optional set custom backend options.

예외

AerError – if there is no name in the configuration

__init__(configuration=None, properties=None, provider=None, **backend_options)[소스]

Aer class for backends.

This method should initialize the module and its configuration, and raise an exception if a component of the module is not available.

매개변수
  • configuration (BackendConfiguration) – backend configuration.

  • properties (BackendProperties or None) – Optional, backend properties.

  • defaults (PulseDefaults or None) – Optional, backend pulse defaults.

  • available_methods (list or None) – Optional, the available simulation methods if backend supports multiple methods.

  • provider (BaseProvider) – Optional, provider responsible for this backend.

  • backend_options (dict or None) – Optional set custom backend options.

예외

AerError – if there is no name in the configuration

Methods

__init__([configuration, properties, provider])

Aer class for backends.

available_methods()

Return the available simulation methods.

clear_options()

Reset the simulator options to default values.

configuration()

Return the simulator backend configuration.

defaults()

Return the simulator backend pulse defaults.

name()

Return the backend name.

properties()

Return the simulator backend properties if set.

provider()

Return the backend Provider.

run(qobj[, backend_options, validate])

Run a qobj on the backend.

set_options(**backend_options)

Set the simulator options

status()

Return backend status.

version()

Return the backend version.

Attributes

options

Return the current simulator options

available_methods()

Return the available simulation methods.

clear_options()

Reset the simulator options to default values.

configuration()

Return the simulator backend configuration.

반환값

the configuration for the backend.

반환 형식

BackendConfiguration

defaults()

Return the simulator backend pulse defaults.

반환값

The backend pulse defaults or None if the

backend does not support pulse.

반환 형식

PulseDefaults

name()

Return the backend name.

반환값

the name of the backend.

반환 형식

str

property options

Return the current simulator options

properties()

Return the simulator backend properties if set.

반환값

The backend properties or None if the

backend does not have properties set.

반환 형식

BackendProperties

provider()

Return the backend Provider.

반환값

the Provider responsible for the backend.

반환 형식

BaseProvider

run(qobj, backend_options=None, validate=False, **run_options)

Run a qobj on the backend.

매개변수
  • qobj (QasmQobj) – The Qobj to be executed.

  • backend_options (dict or None) – DEPRECATED dictionary of backend options for the execution (default: None).

  • validate (bool) – validate the Qobj before running (default: False).

  • run_options (kwargs) – additional run time backend options.

반환값

The simulation job.

반환 형식

AerJob

Additional Information:
  • kwarg options specified in run_options will temporarily override any set options of the same name for the current run.

  • The entries in the backend_options will be combined with the Qobj.config dictionary with the values of entries in backend_options taking precedence. This kwarg is deprecated and direct kwarg’s should be used for options to pass them to run_options.

set_options(**backend_options)

Set the simulator options

status()

Return backend status.

반환값

the status of the backend.

반환 형식

BackendStatus

version()

Return the backend version.

반환값

the X.X.X version of the backend.

반환 형식

str