> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haiqu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Statevector Run

#### Haiqu.statevector\_run(circuits, job\_name=None, job\_description=None)

Run quantum circuits on a statevector simulator and obtain exact amplitudes of the wavefunctions.

This execution type is restricted to non-parametrized circuits up to 20 qubits in size. Circuits may contain
Haiqu gates, but no mid-circuit measurements or other logical operations. Final measurements in the circuit,
if present, will be ignored. Statevector is measured over all qubits in their standard qiskit order.

The returned amplitude ordering matches the indexing convention used by amplitude-based data loaders
([`vector_loading()`](../index.md#haiqu.sdk.quantum_haiqu.Haiqu.vector_loading), [`block_vector_loading()`](../index.md#haiqu.sdk.quantum_haiqu.Haiqu.block_vector_loading), [`function_loading()`](../index.md#haiqu.sdk.quantum_haiqu.Haiqu.function_loading),
[`distribution_loading()`](../index.md#haiqu.sdk.quantum_haiqu.Haiqu.distribution_loading), [`mps_loading()`](../index.md#haiqu.sdk.quantum_haiqu.Haiqu.mps_loading)): index `i` corresponds to the computational-basis
ket whose binary label has rightmost bit = qubit 0.

* **Parameters:**
  * **circuits** (*QuantumCircuit* *|* *list* \*\[\**QuantumCircuit* *]*  *|* *CircuitModel* *|* *list* \*\[\**CircuitModel* *]*) -- The quantum circuit(s) to execute. Can be a single circuit or a list of circuits.
  * **job\_name** (*str* *|* *None*) -- The name for the job. If `None` (default), a name will be automatically generated.
  * **job\_description** (*str* *|* *None*) -- The description for the job.
* **Returns:**
  The Run job that will execute the circuit.
  : Call `job.result()` to retrieve a list of complex-valued statevectors (one numpy array per input circuit),
  each of length `2**num_qubits` in standard Qiskit ordering (rightmost bit = qubit 0). Final measurements
  in the input circuits, if any, are ignored.
  Run `help(job.result)` for the full description of result and `info` contents.
* **Return type:**
  RunJobModel

#### Examples

Single circuit:

```python theme={null}
>>> from qiskit import QuantumCircuit
>>> qc = QuantumCircuit(2)
>>> qc.h(0)
>>> qc.cx(0, 1)
>>> qc.measure_all()  # measurements can be present or not
>>> job = haiqu.statevector_run(qc)
>>> job.result()  # Returns: [statevector]
[array([0.70710678+0.j, 0.        +0.j, 0.        +0.j, 0.70710678+0.j])]
```

Multiple circuits:

```python theme={null}
>>> from qiskit import QuantumCircuit
>>> import numpy as np
>>> qc_bell = QuantumCircuit(2)  # standard bell state
>>> qc_bell.h(0)
>>> qc_bell.cx(0, 1)
>>> bell_gate_phased, _ = haiqu.vector_loading([1, 0, 0, 1.j]).result()  # notice the imaginary amplitude
>>> qc_bell_phased = QuantumCircuit(2)  # bell state with different phase on |11> state
>>> qc_bell_phased.compose(bell_gate_phased, inplace=True)
>>> job = haiqu.statevector_run([qc_bell, qc_bell_phased])
>>> np.round(job.result(), 3)
array([[ 0.707+0.j   ,  0.   +0.j   ,  0.   +0.j   ,  0.707+0.j   ],
       [ 0.707+0.j   ,  0.   +0.j   ,  0.   +0.j   , -0.   +0.707j]])
```
