Papers
Topics
Authors
Recent
Search
2000 character limit reached

Bulk Swap Test: Variants & Applications

Updated 6 July 2026
  • Bulk Swap Test is a collection of quantum circuit designs extending the standard SWAP test to extract overlap information from many states using varied architectures.
  • It incorporates recursive structures, parallelized methods, and ancilla-sharing modules to enable efficient multi-state overlap estimation and improved resource scaling.
  • These architectures facilitate entanglement detection, process characterization, and noise mitigation in quantum metrology and quantum machine learning applications.

Bulk Swap Test is not a single standardized quantum-information primitive. Across the literature, the expression is used for several related constructions built from the standard SWAP test: recursive circuits that recover many pairwise overlaps among several states, parallelized tests whose full ancilla-output distribution encodes subsystem overlaps, many-copy routines based on repeated pairwise SWAP tests, and application-specific modules in quantum neural networks and metrology. In one prominent quantum-machine-learning usage, the term denotes a generalized SWAP-test module in which one ancilla is reused across multiple SWAP-test factors, producing a product layer rather than a separate named protocol (Nagies et al., 20 Jun 2025). In multi-state overlap estimation, by contrast, the term refers to circuits that route many state pairs through one reusable architecture so that all overlaps become recoverable over repeated runs (Liu et al., 2022, Gitiaux et al., 2021).

1. Standard SWAP-test foundation

The common baseline is the standard SWAP test. An ancilla is prepared in 0\ket{0}, a Hadamard gate is applied, a controlled-SWAP acts on two registers ψ\ket{\psi} and ϕ\ket{\phi}, a second Hadamard is applied, and the ancilla is measured. The probability of obtaining 0\ket{0} is

P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),

so the circuit estimates the squared overlap between the two input states (Nagies et al., 20 Jun 2025).

This overlap-based interpretation extends beyond the textbook ancilla-controlled circuit. A destructive version removes the ancilla and reads the symmetry information directly from measurements on the compared systems. In quantum optics, the Hong–Ou–Mandel effect yields the same comparison statistic: the coincidence probability is

1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},

which is the SWAP-test failure probability. This establishes an explicit equivalence between SWAP-test state comparison and Hong–Ou–Mandel interference (Garcia-Escartin et al., 2013).

The standard form is therefore best understood as a symmetry test for two inputs. What later papers call “bulk” variants preserve this overlap logic while changing the number of inputs, the pattern of ancilla reuse, the measurement layout, or the application layer built on top of the test.

2. Recursive multi-state and many-copy generalizations

A major line of work generalizes the SWAP test from one compared pair to many states. In the “Multi-state Swap Test Algorithm,” a recursive circuit UnU_n is constructed so that ancilla outcomes identify which permutation of the input states has been realized, and final swap tests on adjacent registers yield the corresponding overlap estimates. The scheme is designed to recover all pairwise overlaps ϕiϕj2|\langle\phi_i|\phi_j\rangle|^2 among nn states with O(nlogn)O(n\log n) controlled-SWAP gates and ψ\ket{\psi}0 ancilla qubits. The circuit does not output all overlaps in one classical readout; rather, repeated runs over different ancilla branches make every pair recoverable (Liu et al., 2022).

A different recursive construction introduces a pairing unitary ψ\ket{\psi}1 that places every pair among ψ\ket{\psi}2 input states into the first two registers and labels the pair by an ancilla basis state. After a standard two-state SWAP test on those two registers, conditioning on the ancilla label yields

ψ\ket{\psi}3

For this construction, the asymptotic resource bounds are ψ\ket{\psi}4 controlled-SWAP gates and ψ\ket{\psi}5 ancillary qubits (Gitiaux et al., 2021).

A further many-copy interpretation appears in random-SWAP protocols for purification and Schur sampling. There, the SWAP test is treated as a repeated singlet detector on randomly chosen qubit pairs. Singlet pairs are removed, and the remaining qubits are driven toward the totally symmetric subspace. For ψ\ket{\psi}6 qubits, the protocol achieves weak Schur sampling and unitary Schur sampling with error ψ\ket{\psi}7 after

ψ\ket{\psi}8

random SWAP tests, and the probability of detecting any new singlet decreases exponentially once ψ\ket{\psi}9 reaches the ϕ\ket{\phi}0 scale (Brahmachari et al., 7 Aug 2025).

These constructions share the same core principle: the SWAP test is no longer a one-pair comparator, but a reusable module for extracting structured information from many states or many copies.

3. Parallelized, ancilla-free, and photonic realizations

Another meaning of bulk SWAP testing is simultaneous or register-wise readout. In the ϕ\ket{\phi}1-qubit parallelized SWAP test, one ancilla is assigned to each subsystem, each ancilla controls a local SWAP between corresponding subsystems of ϕ\ket{\phi}2 and ϕ\ket{\phi}3, and all ancillas are measured after a second Hadamard layer. If the measured bitstring is ϕ\ket{\phi}4 with support ϕ\ket{\phi}5, its probability is

ϕ\ket{\phi}6

This identifies each normalized shadow enumerator exactly with one output probability of the parallelized test, giving an operational meaning to shadow enumerators and enabling computation of Rains unitary and Shor–Laflamme enumerators from the same distribution (Shi et al., 2024).

Ancilla-free realizations push the same idea into different hardware models. For continuous-variable states ϕ\ket{\phi}7 and ϕ\ket{\phi}8, an ancilla-free SWAP test can be implemented by a 50:50 beamsplitter followed by photon-number-resolving detection, with the parity of one output mode determining the SWAP eigenvalue. The overlap obeys

ϕ\ket{\phi}9

and the protocol extends naturally to many mode pairs and to higher-order permutation tests (Volkoff et al., 2022).

Integrated photonic realizations implement the standard SWAP-test logic with path-encoded qudits. A linear photonic circuit using 0\ket{0}0 spatial modes encodes two qubits plus ancilla in eight waveguides, realizes the controlled-SWAP passively by waveguide crossings, and estimates 0\ket{0}1 from output counts. The reported root mean square error is smaller than 0\ket{0}2 (Baldazzi et al., 2024).

Taken together, these works show that “bulk” may refer either to parallelization across subsystems, to ancilla-free multimode readout, or to hardware architectures that expose many overlap-related observables from one structured circuit.

4. SWAP-test quantum neural networks and product layers

In quantum machine learning, SWAP-test-based neural architectures form a distinct branch of the literature. An early model defines a quantum neuron whose output is determined by the inner product between an input state and a quantum weight state. The overlap 0\ket{0}3 is estimated by a swap-test-plus-phase-estimation construction, transformed into rotation angles, and then used to prepare the neuron’s output qubit. In that architecture, the swap test underpins both forward propagation and gradient evaluation, and hidden-layer measurements are postponed so that later layers retain coherent inputs. A four-layer network trained on a checkerboard classification problem was reported to reach 0\ket{0}4 test accuracy (Zhao et al., 2019).

A later analysis makes the classical correspondence explicit. For amplitude-encoded input

0\ket{0}5

the standard SWAP-test QNN is mathematically equivalent to a classical two-layer feedforward network with quadratic activation. Its output is written as

0\ket{0}6

Because quadratic activations are polynomial, the architecture violates the usual non-polynomial condition associated with the universal approximation theorem. This limitation becomes exact for parity: the paper proves that the original SWAP-test QNN cannot learn the 0\ket{0}7-dimensional parity function for 0\ket{0}8, regardless of network size (Nagies et al., 20 Jun 2025).

The proposed remedy is the construction most closely associated with “bulk swap test” in this context. Each module uses 0\ket{0}9 copies of the input state, P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),0 corresponding weight states, and one ancilla shared across all P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),1 SWAP factors. The resulting module output is

P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),2

and the full layer becomes a product layer. This raises the effective activation degree from P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),3 to P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),4, connects the architecture to classical product layers and P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),5-P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),6-P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),7 networks, and overcomes the parity obstruction empirically up to at least P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),8, with good performance when P(0)=12(1+ψϕ2),P(0)=\frac{1}{2}\left(1+|\langle\psi|\phi\rangle|^2\right),9. The same work reports a pretrained 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},0 parity model achieving 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},1 accuracy in the classical surrogate, 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},2 on noiseless simulation, and 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},3 on IBM quantum hardware for the 3D parity task (Nagies et al., 20 Jun 2025).

In this literature, bulkness therefore refers not to an independent overlap-estimation primitive, but to combining many SWAP-test factors into one expressive learning module.

5. Entanglement, process characterization, and metrological mitigation

Several papers use bulk or multi-copy SWAP tests as diagnostic tools. For pure-state entanglement detection, one construction compares two copies of the same 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},4-qubit state and measures an 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},5-qubit control register, with one control qubit per test qubit. Product states return 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},6 with certainty, whereas entangled states generate characteristic nonzero control strings. In the two-qubit case, if the concurrence is 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},7, then

1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},8

so 1ϕψ22,\frac{1-|\langle\phi|\psi\rangle|^2}{2},9 is an entanglement signature. For GHZ-like states, signatures are even numbers of ones in the control register; for W-like states, they are exactly two ones. The same paper proposes the multipartite quantity UnU_n0 and reports that the average number of copies needed to detect any entanglement can approach about UnU_n1 for large maximally entangled systems (Foulds et al., 2020).

A different entanglement-witness construction shows that the ordinary single-ancilla SWAP test can already witness entanglement in arbitrary two-qubit pure states, and by convexity in arbitrary two-qubit mixed states. If the ancilla-UnU_n2 probability satisfies

UnU_n3

then the state is entangled, and the concurrence obeys the lower bound UnU_n4 with UnU_n5. Without local preprocessing, about UnU_n6 of random entangled pure states are detected; with four local-unitary settings, this rises to UnU_n7 (Guaraldo et al., 23 Dec 2025).

For process characterization, the standard SWAP test is insufficient to distinguish purity loss from a mere rotation of a pure state. A modified protocol adds measurement of the control qubit in its preparation basis and combines the two bits of information according to

UnU_n8

In a specific Toffoli-based realization, the post-selected probability becomes

UnU_n9

so the output depends separately on the decoherence parameter ϕiϕj2|\langle\phi_i|\phi_j\rangle|^20 and the protocol rotation ϕiϕj2|\langle\phi_i|\phi_j\rangle|^21. Under those circumstances, the method can serve as an alternative to full quantum process tomography (Ripper et al., 2022).

In quantum metrology, a two-copy SWAP-test protocol is used to estimate indistinguishable noise that quantum error correction cannot remove. For two copies of a noisy probe state ϕiϕj2|\langle\phi_i|\phi_j\rangle|^22, the control-qubit ϕiϕj2|\langle\phi_i|\phi_j\rangle|^23-measurement yields

ϕiϕj2|\langle\phi_i|\phi_j\rangle|^24

Under local dephasing, ϕiϕj2|\langle\phi_i|\phi_j\rangle|^25 decomposes into ideal and odd-error sectors, and the odd-sector weight is

ϕiϕj2|\langle\phi_i|\phi_j\rangle|^26

The overlap estimate is then combined with a signal observable to form a corrected estimator of the unknown parameter. The paper presents the method as a complement to quantum error correction rather than a replacement, specifically for noise that overlaps with the signal (Lin et al., 22 May 2026).

The literature does not assign a single canonical meaning to “Bulk Swap Test.” In the generalized SWAP-test QNN, the phrase most naturally refers to “a number of ϕiϕj2|\langle\phi_i|\phi_j\rangle|^27 SWAP tests using the same ancilla qubit,” and the paper explicitly characterizes this as a product-module generalization rather than a separate bulk-testing protocol (Nagies et al., 20 Jun 2025). In the multi-class SWAP-test classifier, bulkness has yet another meaning: all training examples and their label states are encoded in one superposition, the SWAP-test circuit accumulates the kernel contributions in parallel, and a single-qubit reconstruction produces a Bloch-vector summary

ϕiϕj2|\langle\phi_i|\phi_j\rangle|^28

for multi-class decision making. The circuit is bulk in its aggregation over training data, not as a literal many-target SWAP comparator (Pillay et al., 2023).

The term also appears by analogy outside quantum circuits. In structured two-sample testing, a “restricted block permutation” scheme is described as mimicking a bulk swap test by allowing only single cross-swaps between block-selected representatives. In that setting the one-swap increments for the difference of means and for the unbiased ϕiϕj2|\langle\phi_i|\phi_j\rangle|^29 statistic have conditional variances of order nn0, in contrast to the nn1 variability under full relabeling, while exact finite-sample validity is maintained for the fixed restricted permutation set (Ho, 29 Nov 2025). This is not a quantum SWAP test, but it shows that the phrase has begun to function as a broader descriptor for structured swap-based comparison.

A persistent source of confusion is therefore lexical rather than technical. Some works mean multi-state overlap extraction, some mean register-wise parallelization, some mean two-copy collective diagnostics, and some mean SWAP-factor aggregation inside a larger algorithmic module. The shared invariant is the use of swap-controlled symmetry information to expose overlap, purity, or class-separation structure; the differing feature is the scale at which that information is organized and read out.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Bulk Swap Test.