TheDocumentation Index
Fetch the complete documentation index at: https://docs.classiq.io/llms.txt
Use this file to discover all available pages before exploring further.
calculate_state_vector(...) function is used when you want direct access to the quantum state itself, including amplitudes and phases.
Related pages:
When to use state-vector calculation
Usecalculate_state_vector(...) when you want the full quantum state rather than measurement statistics or a single expectation value.
This is useful when you want to:
- inspect amplitudes directly
- understand the exact state prepared by the circuit
- analyze phases and probabilities
- debug or study a circuit without sampling noise
Basic example
| x | amplitude | magnitude | phase | probability | bitstring |
|---|---|---|---|---|---|
| 0 | 0.707107+0.000000j | 0.71 | 0.00π | 0.5 | 0 |
| 1 | 0.707107+0.000000j | 0.71 | 0.00π | 0.5 | 1 |
Understanding the result
The returned object is a DataFrame describing the full state. Common columns include:- quantum variables - the quantum number values, quantum arrays, and qubits
- amplitude — the complex amplitude of the basis state
- magnitude — the absolute value of the amplitude
- phase — the phase angle
- probability — the squared magnitude
- bitstring — the computational basis state
Filtering small amplitudes
By default, very small amplitudes are filtered out below a threshold of . You can control this behavior usingamplitude_threshold:
Parameterized execution
State-vector calculation also supports parameterized quantum programs. This means you can define symbolic parameters in your circuit and provide their numerical values at execution time. Example| x | amplitude | magnitude | phase | probability | bitstring |
|---|---|---|---|---|---|
| 1 | 0.779815+0.146834j | 0.79 | 0.06π | 0.629672 | 1 |
| 0 | 0.575048-0.199119j | 0.61 | -0.11π | 0.370328 | 0 |
- the circuit structure stays the same
- the parameter values are supplied at execution time
- the returned DataFrame describes the exact state corresponding to those values
Summary
Usecalculate_state_vector(...) when you need the full quantum state.
State-vector calculation:
- returns a DataFrame
- provides amplitudes, phases, and probabilities
- is deterministic
- supports parameterized execution
- only allowed on simulators