We write fifteen standard quantum gates and fourteen standard quantum algorithms in qg units [1]. An -qubit state is described by its qg values, for every Pauli string , and a gate acts as . With this one rule each gate becomes a table of qg transformations and each algorithm a readout identity: which qg values hold the answer. The formulation is the Pauli (Heisenberg) representation and adds no new physics. It gives three practical classifications in the units used by the rest of the qang project: which gates conserve Hamming weight, and therefore admit the qg symmetry witness and filter; which algorithms are read out from a few qg values and which need the full outcome histogram; and where reading qg values is strictly worse than the standard readout. Three readout identities are, as far as we know, not stated in this form elsewhere: the per-qubit polar bias after Grover iterations, Simon’s secret as the unique non-trivial Z-parity equal to one, and quantum counting as a single . Every identity is checked numerically and pinned by tests in the open-source library qang (version 0.5.1, pip install qang), module qang.formulation.
We write fifteen standard quantum gates and fourteen standard quantum algorithms in qg units [1]. An -qubit state is described by its qg values, for every Pauli string , and a gate acts as . With this one rule each gate becomes a table of qg transformations and each algorithm a readout identity: which qg values hold the answer. The formulation is the Pauli (Heisenberg) representation and adds no new physics. It gives three practical classifications in the units used by the rest of the qang project: which gates conserve Hamming weight, and therefore admit the qg symmetry witness and filter; which algorithms are read out from a few qg values and which need the full outcome histogram; and where reading qg values is strictly worse than the standard readout. Three readout identities are, as far as we know, not stated in this form elsewhere: the per-qubit polar bias after Grover iterations, Simon’s secret as the unique non-trivial Z-parity equal to one, and quantum counting as a single . Every identity is checked numerically and pinned by tests in the open-source library qang (version 0.5.1, pip install qang), module qang.formulation.
Each qubit’s local qg values are a point in the Bloch ball. Its squared distance from the centre, , is the radius of the sphere on which the qubit lives (area ). For a pure register the deficit is the known one-tangle of the qubit with the rest; with noise it mixes entanglement and impurity. We show that circuits which conserve the Hamming weight remove this ambiguity under one noise model. In a state of fixed weight on every qubit, so and the deficit is read from Z-basis shots alone; under equal amplitude damping the qg symmetry filter returns the noiseless state exactly, so the filtered deficit is the noiseless one-tangle. In a pre-registered simulation (90 configurations) the filtered deficit equals it to , and on product states it is exactly zero, while the unfiltered readout reports a false deficit of 0.60–0.95. On five device noise models (three IBM backends, two IonQ) the filter cuts the deficit error of trained circuits 3.2–4.0 times, but it removes only 15–33% of the false deficit of a product state: errors that move an excitation inside the sector survive the filter, and near a pole the deficit amplifies them as . The radius also separates the polar angle in radians from the length of the vector, : this angle is exact under depolarizing noise, where $\arccosqg_Z$ errs by up to 0.7 rad, and it is 5–9 times more accurate on the device noise models once the noise gates are actually executed. Three of nineteen predictions failed and are reported. Everything is reproduced by the open-source library qang (version 0.6.8, pip install qang).
We are now ready to see how computing with qubits can be done. In this book, we will mainly use the circuit model for computation which was first introduced by Deutsch [25]. We will represent by quantum “wires,” the qubits upon which manipulations. The length of the wire is to be interpreted as the time axis. Manipulations on qubits can be done using basic unitary operators that are the equivalents of logic “gates.” An algorithm, or a complete set of steps for achieving a processing task, is a combination of wires and gates representing a quantum circuit. This circuit must be thought of as a time sequence of events with every wire a way of representing qubit states, and with gates representing processing of those states.
⟨ ⟩ The qang project describes qubits by measurement—level quantities, the qg values qgP = P [1]. This short note states two classical results in those units, implemented and checked in the qang library (pip install qang, version 0.6.0). First, a polarization state of light is a qubit: the normalized Stokes parameters are exactly the qg values, the degree of polarization P is the length of the qg vector, and a lossless Mueller matrix is the qg gate rule qg′ = qgU†PU . Malus's law becomes I = I0(1 + qgZ cos 2θ + qgX sin 2θ)/2 for any input state. Second, the — geometric phase of a closed loop on the Bloch (Poincaré) sphere is minus half the enclosed solid angle, which is Stokes' theorem for the Berry curvature. For a loop at constant qgZ the phase is (qgZ 1)/2 of a turn: it is fixed by qgZ alone. Nothing here is new physics. The contribution is the translation into qang's units and a set of 26 numerical checks, with the phase computed three independent ways.
This chapter represents our first step into quantum information theory (QIT). The key to operating such a transition is to become familiar with the concept of the quantum bit, or qubit , which is a probabilistic superposition of the classical 0 and 1 bits. In the quantum world, the classical 0 and 1 bits become the pure states |0〉 and |1〉, respectively. It is as if a coin can be classically in either heads or tails states, but is now allowed to exist in a superposition of both! Then I show that qubits can be physically transformed by the action of unitary matrices , which are also called operators . I show that such qubit transformations, resulting from any qubit manipulation, can be described by rotations on a 2D surface, which is referred to as the Bloch sphere . The Pauli matrices are shown to generate all such unitary transformations. These transformations are reversible , because they are characterized by unitary matrices ; this property always makes it possible to trace the input information carried by qubits. I will then describe different types of elementary quantum computations performed by elementary quantum gates, forming a veritable “zoo” of unitary operators, called I , X , Y , Z , H , CNOT, CCNOT, CROSSOVER or SWAP, controlled- U , and controlled-controlled- U . These gates can be used to form quantum circuits , involving any number of qubits, and of which several examples and tools for analysis are provided. Finally, the concept of tensor product , as progressively introduced through the above description, is eventually formalized.
Classical information processing is performed using bits , which are just two-state systems, with the two states called 0 and 1. By grouping bits togetherwe can represent arbitrary pieces of information, and by manipulating these bits we can perform arbitrary computations. The corresponding basic element used in quantum information is the quantum bit, or qubit . This is simply a quantum system with two orthonormal basis states, which we shall call |0⧽ and |1⧽. There are many possible physical implementations of a qubit, such as spin states of electrons or atomic nuclei, charge states of quantum dots, atomic energy levels, vibrational states of groups of atoms, polarization states of photons, or paths in an interferometer. At this stage the physical implementation is not important: the idea of a qubit is to abstract the discussion away from physical details. Taking the standard approach of quantum information theory, we shall begin by not worrying too much about the properties of these states, or even what their energies are; we shall simply assume that they are eigenstates of the system's Hamiltonian with known eigenvalues (that is, known energies). This approach allows us to concentrate on the fundamental properties of the system, without considering all the tedious details. We can in principle perform classical information processing on our quantum system by using the two states |0⧽ and |1⧽ as our logical states 0 and 1 and proceeding in the usual fashion, giving rise to the field of reversible computing , which will be explored briefly in Part II. This, however, misses the point.
A quantum neural network (QNN) built from gates that conserve the Hamming weight keeps its data in one weight sector, so the shots that left the sector can be discarded at readout. This is the qg filter of the qang library [1, 2]. We show that, with equal amplitude damping (T1) on every qubit, the filtered readout of such a network is exactly the noiseless one in any weight sector. The kept fraction of shots is (1 − γ)k d for weight k and depth d, and training under T1 with the filter gives exactly the parameters of noiseless training. We then measure what this is worth on four small classification datasets. Every result is reported with the filter and without it, and every prediction was committed before its run, failures included. Over 60 runs per model, a network trained on a simulator and run under T1 gains +2.5 points from the filter at weight 1 (95% CI [0.8, 4.1]) and +16.5 points at weight 2 ([11.8, 21.2]), recovering its noiseless accuracy exactly. A network trained under the calibrated noise without the filter catches up (diflerences of 0.1 points), and the filter corrects neither dephasing nor unequal T1 across qubits. These models are classically simulable and no quantum advantage is claimed. The filter is a way to make noise—free training valid under relaxation, at a shot cost known in advance. The models are released as qang. qml (version 0.6.0, pip install qang).