---
title: BasicSimulator (latest version)
description: API reference for qiskit.providers.basic_provider.BasicSimulator in the latest version of qiskit
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/qiskit.providers.basic_provider.BasicSimulator
---

# BasicSimulator

*class* `qiskit.providers.basic_provider.BasicSimulator(provider=None, target=None, **fields)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/providers/basic_provider/basic_simulator.py#L70-L810)

Bases: [`BackendV2`](/docs/api/qiskit/qiskit.providers.BackendV2 "qiskit.providers.backend.BackendV2")

Python implementation of a basic (non-efficient) quantum simulator.

The simulator supports up to 24 qubits for statevector simulation and up to 2048 qubits for Clifford/Stabilizer simulation.

**Parameters**

- **provider** – An optional backwards reference to the provider object that the backend is from.
- **target** ([*Target*](/docs/api/qiskit/qiskit.transpiler.Target "qiskit.transpiler.Target") *| None*) – An optional target to configure the simulator.
- **fields** – kwargs for the values to use to override the default options.

**Raises**

[**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError) – If a field is specified that’s outside the backend’s options.

## Attributes

### MAX\_QUBITS\_CLIFFORD

Default value: `2048`

### MAX\_QUBITS\_STATEVECTOR

Default value: `24`

### coupling\_map

Return the [`CouplingMap`](/docs/api/qiskit/qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap") object

### dt

Return the system time resolution of input signals

This is required to be implemented if the backend supports Pulse scheduling.

**Returns**

The input signal timestep in seconds. If the backend doesn’t define `dt`, `None` will be returned.

### dtm

Return the system time resolution of output signals

**Returns**

The output signal timestep in seconds.

**Raises**

[**NotImplementedError**](https://docs.python.org/3/library/exceptions.html#NotImplementedError) – if the backend doesn’t support querying the output signal timestep

### instruction\_durations

Return the [`InstructionDurations`](/docs/api/qiskit/qiskit.transpiler.InstructionDurations "qiskit.transpiler.InstructionDurations") object.

### instructions

A list of Instruction tuples on the backend of the form `(instruction, (qubits))`

### max\_circuits

### meas\_map

Return the grouping of measurements which are multiplexed

This is required to be implemented if the backend supports Pulse scheduling.

**Returns**

The grouping of measurements which are multiplexed

**Raises**

[**NotImplementedError**](https://docs.python.org/3/library/exceptions.html#NotImplementedError) – if the backend doesn’t support querying the measurement mapping

### num\_qubits

Return the number of qubits the backend has.

### operation\_names

A list of instruction names that the backend supports.

### operations

A list of [`Instruction`](/docs/api/qiskit/qiskit.circuit.Instruction "qiskit.circuit.Instruction") instances that the backend supports.

### options

Return the options for the backend

The options of a backend are the dynamic parameters defining how the backend is used. These are used to control the [`run()`](#qiskit.providers.basic_provider.BasicSimulator.run "qiskit.providers.basic_provider.BasicSimulator.run") method.

### provider

Return the backend provider.

**Returns**

the provider responsible for the backend.

**Return type**

[provider](#qiskit.providers.basic_provider.BasicSimulator.provider "qiskit.providers.basic_provider.BasicSimulator.provider")

### target

### version

Default value: `2`

### name

Name of the backend.

### description

Optional human-readable description.

### online\_date

Date that the backend came online.

### backend\_version

Version of the backend being provided. This is not the same as [`BackendV2.version`](/docs/api/qiskit/qiskit.providers.BackendV2#version "qiskit.providers.BackendV2.version"), which is the version of the [`Backend`](/docs/api/qiskit/qiskit.providers.Backend "qiskit.providers.Backend") abstract interface.

## Methods

### qubit\_properties

`qubit_properties(qubit)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/providers/backend.py#L238-L268)

Return QubitProperties for a given qubit.

If there are no defined or the backend doesn’t support querying these details this method does not need to be implemented.

**Parameters**

**qubit** ([*int*](https://docs.python.org/3/library/functions.html#int)  *|*[*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*]*) – The qubit to get the [`QubitProperties`](/docs/api/qiskit/qiskit.providers.QubitProperties "qiskit.providers.QubitProperties") object for. This can be a single integer for 1 qubit or a list of qubits and a list of [`QubitProperties`](/docs/api/qiskit/qiskit.providers.QubitProperties "qiskit.providers.QubitProperties") objects will be returned in the same order

**Returns**

The [`QubitProperties`](/docs/api/qiskit/qiskit.providers.QubitProperties "qiskit.providers.QubitProperties") object for the specified qubit. If a list of qubits is provided a list will be returned. If properties are missing for a qubit this can be `None`.

**Raises**

[**NotImplementedError**](https://docs.python.org/3/library/exceptions.html#NotImplementedError) – if the backend doesn’t support querying the qubit properties

**Return type**

[*QubitProperties*](/docs/api/qiskit/qiskit.providers.QubitProperties "qiskit._accelerate.target.QubitProperties") | [list](https://docs.python.org/3/library/stdtypes.html#list)\[[*QubitProperties*](/docs/api/qiskit/qiskit.providers.QubitProperties "qiskit._accelerate.target.QubitProperties")]

### run

`run(run_input, **run_options)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/providers/basic_provider/basic_simulator.py#L438-L489)

Run on the backend.

**Parameters**

- **run\_input** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")  *or*[*list*](https://docs.python.org/3/library/stdtypes.html#list)) – the QuantumCircuit (or list of QuantumCircuit objects) to run
- **run\_options** (*kwargs*) – additional runtime backend options

**Returns**

derived from BaseJob

**Return type**

[BasicProviderJob](/docs/api/qiskit/qiskit.providers.basic_provider.BasicProviderJob "qiskit.providers.basic_provider.BasicProviderJob")

**Additional Information:**

- kwarg options specified in `run_options` will temporarily override any set options of the same name for the current run. These may include:

  > - “initial\_statevector”: vector-like. The “initial\_statevector” option specifies a custom initial statevector to be used instead of the all-zero state. The size of this vector must correspond to the number of qubits in the `run_input` argument.
  > - “seed\_simulator”: int. This is the internal seed for sample generation.
  > - “shots”: int. Number of shots used in the simulation.
  > - “memory”: bool. If True, the result will contain the results of every individual shot simulation.
  > - “use\_clifford\_optimization”: bool. If True, enables Clifford circuit optimization using stabilizer formalism. Default: False.

Example:

```python
backend.run(
    circuit_2q,
    initial_statevector = np.array([1, 0, 0, 1j]) / math.sqrt(2)
)
```

### set\_options

`set_options(**fields)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.5/qiskit/providers/backend.py#L270-L287)

Set the options fields for the backend

This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.

**Parameters**

**fields** – The fields to update the options

**Raises**

[**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError) – If the field passed in is not part of the options
