Conventions
Applicable version · ArcQML 0.1.0
On this page
Pure states and normalization
For n qubits, ArcQML represents a pure state as a complex vector of length d, where the state-space dimension is:
The pure state and its normalization condition are:
When importing a single state from Tensor, the framework checks the squared norm of the entire vector. Batch imports are checked row by row. To allow floating-point error, both interfaces require:
The default constructor creates the all-zero computational basis state:
Amplitude 0 is 1; all other amplitudes are 0.
Qubit indices and binary-string display
ArcQML assigns q0 to the least significant bit of the computational basis index, q1 to the next bit, and so on. The relationship between basis states and numerical indices is:
Binary strings display qubits in descending order: q[n-1] on the left and q0 on the right. In a two-qubit system, for example, internal index 1 is displayed as 01.
| Two-qubit internal index | Binary display | q1 value |
q0 value |
|---|---|---|---|
| 0 | 00 | 0 | 0 |
| 1 | 01 | 0 | 1 |
| 2 | 10 | 1 | 0 |
| 3 | 11 | 1 | 1 |
Local matrices and multi-qubit gate order
For multi-qubit gates, call arguments define the local basis order: qubits[0] is the least significant bit of the local matrix index, followed by qubits[1]. For controlled gates such as cnot, cp, crx, cry, and crz, the first qubit is the control and the second the target. Thus cnot(0, 1) uses q0 as control and q1 as target. Swap-like gates still require two valid, distinct qubit indices even though they are mathematically symmetric.
Public row-major data for a dense full unitary matrix is indexed first by the output computational basis index, then by the input index. Internally, full-unitary batch computation instead treats each computational basis input as a column-like batch state, then transposes to the public matrix layout.