---
title: StatevectorSimulatorPy (v0.46)
description: API reference for qiskit.providers.basicaer.StatevectorSimulatorPy in qiskit v0.46
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/0.46/qiskit.providers.basicaer.StatevectorSimulatorPy
---

# StatevectorSimulatorPy

*class* `qiskit.providers.basicaer.StatevectorSimulatorPy(configuration=None, provider=None, **fields)`

[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.46/qiskit/providers/basicaer/statevector_simulator.py)

Bases: [`QasmSimulatorPy`](/docs/api/qiskit/0.46/qiskit.providers.basicaer.QasmSimulatorPy "qiskit.providers.basicaer.qasm_simulator.QasmSimulatorPy")

Python statevector simulator.

> **Deprecated since version 0.46.0**
>
> The class `qiskit.providers.basicaer.statevector_simulator.StatevectorSimulatorPy` is deprecated as of qiskit 0.46.0. It will be removed in Qiskit 1.0.0. The qiskit.providers.basicaer module has been superseded by qiskit.providers.basic\_provider. The new module has no replacement for this class. Use the qiskit.quantum\_info.Statevector class instead.

## Attributes

### DEFAULT\_CONFIGURATION

Default value: `{'backend_name': 'statevector_simulator', 'backend_version': '1.1.0', 'basis_gates': ['u1', 'u2', 'u3', 'rz', 'sx', 'x', 'cx', 'id', 'unitary'], 'conditional': True, 'coupling_map': None, 'description': 'A Python statevector simulator for qobj files', 'gates': [{'name': 'u1', 'parameters': ['lambda'], 'qasm_def': 'gate u1(lambda) q { U(0,0,lambda) q; }'}, {'name': 'u2', 'parameters': ['phi', 'lambda'], 'qasm_def': 'gate u2(phi,lambda) q { U(pi/2,phi,lambda) q; }'}, {'name': 'u3', 'parameters': ['theta', 'phi', 'lambda'], 'qasm_def': 'gate u3(theta,phi,lambda) q { U(theta,phi,lambda) q; }'}, {'name': 'rz', 'parameters': ['phi'], 'qasm_def': 'gate rz(phi) q { U(0,0,phi) q; }'}, {'name': 'sx', 'parameters': [], 'qasm_def': 'gate sx(phi) q { U(pi/2,7*pi/2,pi/2) q; }'}, {'name': 'x', 'parameters': [], 'qasm_def': 'gate x q { U(pi,7*pi/2,pi/2) q; }'}, {'name': 'cx', 'parameters': [], 'qasm_def': 'gate cx c,t { CX c,t; }'}, {'name': 'id', 'parameters': [], 'qasm_def': 'gate id a { U(0,0,0) a; }'}, {'name': 'unitary', 'parameters': ['matrix'], 'qasm_def': 'unitary(matrix) q1, q2,...'}], 'local': True, 'max_shots': 0, 'memory': True, 'n_qubits': 24, 'open_pulse': False, 'simulator': True, 'url': 'https://github.com/Qiskit/qiskit-terra'}`

### DEFAULT\_OPTIONS

Default value: `{'chop_threshold': 1e-15, 'initial_statevector': None}`

### MAX\_QUBITS\_MEMORY

Default value: `29`

### SHOW\_FINAL\_STATE

Default value: `True`

### 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.basicaer.StatevectorSimulatorPy.run "qiskit.providers.basicaer.StatevectorSimulatorPy.run") method.

### version

Default value: `1`

## Methods

### configuration

`configuration()`

Return the backend configuration.

**Returns**

the configuration for the backend.

**Return type**

[BackendConfiguration](/docs/api/qiskit/0.46/qiskit.providers.models.BackendConfiguration "qiskit.providers.models.BackendConfiguration")

### name

`name()`

Return the backend name.

**Returns**

the name of the backend.

**Return type**

[str](https://docs.python.org/3/library/stdtypes.html#str)

### properties

`properties()`

Return the backend properties.

**Returns**

the configuration for the backend. If the backend does not support properties, it returns `None`.

**Return type**

[BackendProperties](/docs/api/qiskit/0.46/qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties")

### provider

`provider()`

Return the backend Provider.

**Returns**

the Provider responsible for the backend.

**Return type**

[Provider](/docs/api/qiskit/0.46/qiskit.providers.Provider "qiskit.providers.Provider")

### run

`run(run_input, **backend_options)`

Run on the backend.

**Parameters**

- **run\_input** ([*QuantumCircuit*](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")  *or*[*list*](https://docs.python.org/3/library/stdtypes.html#list)) – payload of the experiment
- **backend\_options** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)) – backend options

**Returns**

derived from BaseJob

**Return type**

[BasicAerJob](/docs/api/qiskit/0.46/qiskit.providers.basicaer.BasicAerJob "qiskit.providers.basicaer.BasicAerJob")

**Additional Information:**

**backend\_options: Is a dict of options for the backend. It may contain**

- “initial\_statevector”: vector\_like

The “initial\_statevector” option specifies a custom initial initial statevector for the simulator to be used instead of the all zero state. This size of this vector must be correct for the number of qubits in `run_input` parameter.

Example:

```python
backend_options = {
    "initial_statevector": np.array([1, 0, 0, 1j]) / np.sqrt(2),
}
```

### run\_experiment

`run_experiment(experiment)`

Run an experiment (circuit) and return a single experiment result.

**Parameters**

**experiment** ([*QasmQobjExperiment*](/docs/api/qiskit/0.46/qiskit.qobj.QasmQobjExperiment "qiskit.qobj.QasmQobjExperiment")) – experiment from qobj experiments list

**Returns**

A result dictionary which looks something like:

```python
{
"name": name of this experiment (obtained from qobj.experiment header)
"seed": random seed used for simulation
"shots": number of shots used in the simulation
"data":
    {
    "counts": {'0x9: 5, ...},
    "memory": ['0x9', '0xF', '0x1D', ..., '0x9']
    },
"status": status string for the simulation
"success": boolean
"time_taken": simulation time of this single experiment
}
```

**Return type**

[dict](https://docs.python.org/3/library/stdtypes.html#dict)

**Raises**

[**BasicAerError**](/docs/api/qiskit/0.46/qiskit.providers.basicaer.BasicAerError "qiskit.providers.basicaer.BasicAerError") – if an error occurred.

### set\_options

`set_options(**fields)`

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

### status

`status()`

Return the backend status.

**Returns**

the status of the backend.

**Return type**

[BackendStatus](/docs/api/qiskit/0.46/qiskit.providers.models.BackendStatus "qiskit.providers.models.BackendStatus")
