RandomMeas.jl: End-to-End Quantum Measurements
- RandomMeas.jl is a Julia package for randomized measurements that streamlines quantum experiments by supporting end-to-end workflows from setting generation to shadow estimation.
- Its modular architecture provides composable data structures for measurement settings, outcomes, and classical shadows, enhancing reproducibility in both simulation and hardware studies.
- The package leverages tensor network simulation via ITensors.jl and advanced uncertainty quantification methods to enable scalable quantum property estimation and benchmarking.
Searching arXiv for papers on RandomMeas.jl and closely related randomized measurement protocols. RandomMeas.jl is a Julia package for randomized measurements in quantum devices, introduced as a modular and high-performance open-source software package for implementing and analyzing randomized measurement protocols in quantum computing (Elben et al., 16 Sep 2025). It is designed around the full randomized measurement workflow, from the generation of measurement settings for use on a quantum computer, through optional classical simulation with tensor networks, to the estimation of physical properties from classical shadows (Elben et al., 16 Sep 2025). Within this scope, the package addresses tasks such as expectation-value estimation, entanglement characterization, fidelity estimation, benchmarking, and uncertainty quantification, while providing a unified and composable software architecture (Elben et al., 16 Sep 2025).
1. Definition and scope
Randomized measurements are experimental and computational procedures in which measurement bases are varied according to random local or shallow-circuit transformations, and the resulting outcomes are aggregated through classical post-processing. In the formulation reviewed in “A Moment for Random Measurements,” such methods are valuable because they probe properties invariant under local unitaries and can operate without a shared reference frame between observers (Knips, 2020). RandomMeas.jl situates itself within this methodological lineage by providing software support for randomized measurement protocols and, most prominently, the classical shadow formalism (Elben et al., 16 Sep 2025).
The package is described as covering the full randomized measurement workflow. This includes generation of measurement settings, acquisition of measurement data from a quantum processor or from classical simulation, and post-processing into estimators for physical observables and state properties (Elben et al., 16 Sep 2025). The package supports both experimental data and large-scale simulations, with tensor network methods provided via ITensors.jl for classical simulation of randomized measurements (Elben et al., 16 Sep 2025). This suggests that RandomMeas.jl is intended not merely as a narrow estimator library, but as an end-to-end environment for randomized measurement studies.
The surrounding research context clarifies why such a package is useful. Random measurements have been used to detect entanglement and characterize SLOCC classes through statistical moments of random correlations, including implementations based on spherical designs to reduce the number of settings needed for exact moment estimation up to a given order (Knips, 2020). More recent work has extended the randomized measurement paradigm to real randomized measurements and partial real randomized measurements, which replace Haar-random unitaries in by Haar-random orthogonals in and restrict the observable sector accordingly (Liang et al., 2024). RandomMeas.jl is presented as a platform capable of accommodating such protocol variation through its modular design (Elben et al., 16 Sep 2025).
2. Software architecture and data structures
The software architecture is organized around three core data structures mirroring the experimental and computational workflow: measurement settings, measurement data, and classical shadows (Elben et al., 16 Sep 2025). This division is central to the package’s composability.
The first layer consists of measurement settings. The abstract type MeasurementSetting represents a single setting, with concrete variants including LocalUnitaryMeasurementSetting, ShallowUnitaryMeasurementSetting, and ComputationalBasisMeasurementSetting (Elben et al., 16 Sep 2025). LocalUnitaryMeasurementSetting corresponds to products of single-qubit rotations from ensembles such as Haar or Pauli, while ShallowUnitaryMeasurementSetting represents low-depth circuits of 1- and 2-qubit gates (Elben et al., 16 Sep 2025). The inclusion of ComputationalBasisMeasurementSetting shows that the package also handles the non-random baseline case within the same abstraction. Settings can be exported and imported, which supports reproducibility and interoperation between simulation and experiment (Elben et al., 16 Sep 2025).
The second layer consists of measurement outcomes. MeasurementData stores bitstrings obtained from measurements performed in a single setting, while MeasurementGroup aggregates data from multiple settings across (Elben et al., 16 Sep 2025). This makes the package naturally suited to randomized measurement campaigns where many independently sampled settings contribute to a single downstream estimate. Support for simulated data is integrated into the same conceptual layer, with the full measurement process available through tensor network MPS simulation for large systems (Elben et al., 16 Sep 2025).
The third layer consists of classical shadows. AbstractShadow is the parent type, with FactorizedShadow, DenseShadow, and ShallowShadow as concrete realizations (Elben et al., 16 Sep 2025). FactorizedShadow is described as scalable and memory-efficient because it stores single-qubit shadows, whereas DenseShadow stores full matrices for smaller subsystems, with the regime explicitly mentioned (Elben et al., 16 Sep 2025). ShallowShadow is specialized for shallow-circuit measurement settings (Elben et al., 16 Sep 2025). The package uses ITensors.jl for tensor operations, providing the computational backend for efficient large-scale workflows (Elben et al., 16 Sep 2025).
A concise summary of these architectural elements is given below.
| Layer | Types | Role |
|---|---|---|
| Measurement settings | MeasurementSetting, LocalUnitaryMeasurementSetting, ShallowUnitaryMeasurementSetting, ComputationalBasisMeasurementSetting |
Represent randomized or fixed measurement bases |
| Measurement data | MeasurementData, MeasurementGroup |
Store bitstrings for one or many settings |
| Classical shadows | AbstractShadow, FactorizedShadow, DenseShadow, ShallowShadow |
Support downstream estimators from measured data |
3. Randomized measurement workflow
The package’s workflow begins with the sampling of measurement settings. Unitaries or circuits are randomly drawn from a desired ensemble, with examples including Haar, Pauli, and shallow Clifford ensembles (Elben et al., 16 Sep 2025). In the general randomized measurement literature, one can regard this as drawing local directions or unitary rotations and measuring in a fixed basis after the rotation (Knips, 2020). In RandomMeas.jl, the representation of settings as explicit objects makes those choices persistent and exportable, which is important for reproducible numerical or hardware studies (Elben et al., 16 Sep 2025).
Data acquisition then proceeds either on a QPU or through classical simulation (Elben et al., 16 Sep 2025). The simulation path is particularly significant because the package supports large-scale tensor-network calculations using MPS methods via ITensors.jl (Elben et al., 16 Sep 2025). A plausible implication is that the package is intended to bridge theoretical protocol development and experimental deployment by allowing the same settings and post-processing pipelines to be applied to both simulated and measured data.
The post-processing stage converts MeasurementGroup objects into classical shadows or, in some cases, acts directly on measurement data (Elben et al., 16 Sep 2025). This is aligned with the broader randomized measurement framework, in which moments of measured correlations or shadow reconstructions are averaged over many random settings to infer invariant properties of the state (Knips, 2020). RandomMeas.jl systematizes this stage with composable estimator functions and built-in uncertainty estimation (Elben et al., 16 Sep 2025).
The package supports import and export of settings and collected data, enabling seamless transfer between simulation and experiment (Elben et al., 16 Sep 2025). This matters because randomized measurements are often performed in hybrid workflows: settings are generated offline, executed on hardware, and analyzed later. The package’s explicit handling of these objects suggests a design aimed at preserving the provenance of each stage.
4. Estimation methods and supported quantities
RandomMeas.jl enables extraction of expectation values, entanglement measures, fidelities, state overlaps, benchmarking metrics, and process quantities (Elben et al., 16 Sep 2025). The package therefore covers both linear observables and nonlinear functionals.
For standard classical shadows, the estimator is expressed as
$\hat{\rho} = \bigotimes_{i=1}^N \bigl(3\,U_i^\dag\ket{s_i}\!\bra{s_i}U_i - \openone \bigr),$
where are random single-qubit unitaries and is the measurement outcome (Elben et al., 16 Sep 2025). Observables are then estimated by
This is the canonical shadow-based route to expectation values (Elben et al., 16 Sep 2025).
For polynomial and nonlinear functionals, the package implements U-statistics and batching methods (Elben et al., 16 Sep 2025). Trace moments are estimated using
and batch shadows are formed as
The package also supports direct-data estimators for quantities such as purity or overlap, bypassing explicit shadow construction when appropriate (Elben et al., 16 Sep 2025).
The list of supported physical properties includes generic expectation values 0, purity 1, Rényi entropy, higher-order trace moments 2, fidelities such as 3, state overlaps, cross-entropy benchmarking (XEB), self-XEB, and support for quantum process tomography (Elben et al., 16 Sep 2025). This range situates the package within both state characterization and device benchmarking workflows.
The broader literature shows why moments are central. Random measurement protocols commonly estimate second and fourth moments of correlation distributions, and those moments can witness genuine multipartite entanglement or distinguish SLOCC classes (Knips, 2020). In related work on real randomized measurements, second and fourth moments of orthogonally randomized observables are used to characterize entanglement dimensionality and diagnose imaginarity (Liang et al., 2024). RandomMeas.jl’s focus on moment-based and shadow-based estimation places it directly within this methodological family (Elben et al., 16 Sep 2025).
5. Advanced protocols: robust, shallow, and real randomized measurements
A notable aspect of RandomMeas.jl is the inclusion of advanced shadow techniques beyond the standard local-unitary protocol (Elben et al., 16 Sep 2025). These include robust shadows, shallow shadows, and batch estimators.
Robust shadows incorporate calibration data to describe and invert measurement or channel noise, producing unbiased estimators even in the presence of hardware errors (Elben et al., 16 Sep 2025). The depolarization parameter vector 4 is determined through calibration and used for correction at the level of shadow construction (Elben et al., 16 Sep 2025). This is significant because randomized measurements are often applied on noisy devices, and estimator bias from measurement errors would otherwise contaminate downstream quantities.
Shallow shadow estimation addresses non-local observables through random shallow circuits. In this setting, the measurement map 5 is learned numerically, and an unbiased inverse mapping is used in post-processing: 6 The package states that random shallow circuits can drastically reduce the variance for non-local observables (Elben et al., 16 Sep 2025). This provides a route beyond purely local randomization.
The literature on real randomized measurements is directly relevant to possible protocol extensions. Real randomized measurements (RRMs) use Haar-random orthogonal transformations 7 and real symmetric local observables, while partial real randomized measurements (PRRMs) use Haar-random orthogonals with imaginary antisymmetric observables (Liang et al., 2024). These protocols access different sectors of bipartite correlations: RRMs probe real–real sectors, PRRMs probe imaginary–imaginary sectors, and standard randomized measurements probe all sectors (Liang et al., 2024). The implementation guidance given there explicitly notes that a high-level API for a library such as RandomMeas.jl should provide functions to generate random orthogonal matrices, generalized Gell-Mann observables, analytic moment formulas, and the ability to compare RM, RRM, and PRRM data (Liang et al., 2024). This suggests that the package’s modular architecture is suitable for accommodating protocol families that differ in randomization group and observable class.
More generally, “A Moment for Random Measurements” emphasizes the role of spherical designs as finite measurement sets reproducing moments up to degree 8, for example six directions for second moments and twelve directions for fourth moments in qubit settings (Knips, 2020). Although RandomMeas.jl is described primarily in terms of random settings and classical shadows, this broader framework situates its estimator design within a larger algebra of moment protocols.
6. Simulation, statistical uncertainty, and computational considerations
RandomMeas.jl supports optional classical simulation of randomized measurements with tensor networks, using MPS methods through ITensors.jl (Elben et al., 16 Sep 2025). This is central for studies where direct hardware execution is impractical or where controlled numerical experiments are required. Example use cases include extraction of all Pauli expectation values for large MPS-simulated states, such as 50 qubits, using the same randomized measurement data (Elben et al., 16 Sep 2025).
Uncertainty quantification is built into the package. For linear estimators, the package uses the sample mean and analytic error propagation (Elben et al., 16 Sep 2025). For nonlinear estimators, it employs jackknife resampling, with jackknife variance
9
Post-processing routines expose compute_sem and compute_cov keywords to obtain uncertainty estimates (Elben et al., 16 Sep 2025). This is consequential because randomized measurement estimators frequently involve nontrivial nonlinear aggregation, and uncertainty reporting is essential for both experimental and numerical studies.
The package is also described as including batch estimators, which can reduce variance and computation (Elben et al., 16 Sep 2025). Together with factorized shadows and tensor-network simulation, batching contributes to the package’s scalability. The emphasis on composability and large-system support indicates that the software is designed for contemporary randomized measurement workloads rather than solely pedagogical examples (Elben et al., 16 Sep 2025).
An adjacent computational issue appears in work on unbiased sampling over the matrix product state manifold. That work observes that many packages, including RandomMeas.jl, use independent local Haar unitaries in contexts where such sampling may inadvertently induce bias if interpreted as uniform over constrained state manifolds (Leontica et al., 30 Apr 2025). Specifically, independent local Haar generation of random MPS is shown not to be uniform with respect to the Fubini–Study metric on the MPS manifold, and an unbiased Metropolis-based correction is proposed (Leontica et al., 30 Apr 2025). In the context of RandomMeas.jl, this does not alter the package’s stated functionality, but it clarifies that the statistical meaning of “random” can depend on the manifold and measure under consideration. A plausible implication is that simulation modules based on tensor networks may need careful ensemble specification when used for typical-state studies rather than for protocol emulation.
7. Position within the Julia and quantum-software ecosystem
RandomMeas.jl is presented as a unified, extensible environment for randomized measurement workflows, with an open-source implementation and accompanying notebooks (Elben et al., 16 Sep 2025). The package uses ITensors.jl for tensor operations and is suitable for both theoretical algorithm development and direct support for experimentalists collecting quantum data (Elben et al., 16 Sep 2025). This dual orientation distinguishes it from libraries focused solely on hardware execution or solely on numerical simulation.
Its modular and composable design can be interpreted in light of broader Julia package design principles found in MeasureTheory.jl, where measures are treated as central objects, combinators compose complex constructions from simpler ones, and explicit handling of measure-theoretic structure improves extensibility (Scherrer et al., 2021). RandomMeas.jl is not described as depending on MeasureTheory.jl, and no such claim is warranted. However, the comparison highlights a shared Julia idiom: abstract types, compositional interfaces, and explicit modeling of mathematical structure (Scherrer et al., 2021). This suggests that RandomMeas.jl belongs to a wider ecosystem of mathematically structured scientific software in Julia.
The package’s practical examples include entanglement entropy by purity measurement, device benchmarking with cross-entropy-based quantities, robust-shadow tomography with calibration groups, and shallow-shadow calibration and application (Elben et al., 16 Sep 2025). Fourteen Jupyter notebooks accompany the codebase (Elben et al., 16 Sep 2025). These examples place the software within active research programs in quantum state characterization, error mitigation, and benchmarking.
A recurring misconception in randomized measurement practice is that the method is merely a substitute for full tomography. The literature indicates a more precise view: randomized measurements are especially useful for local-unitary-invariant properties, for reference-frame-independent settings, and for scalable estimation of selected observables or nonlinear functionals rather than full universal reconstruction in the most general sense (Knips, 2020). RandomMeas.jl reflects this specialization. Its feature set centers on shadow-based estimators, moments, and benchmarking quantities, not on exhaustive state tomography as a default endpoint (Elben et al., 16 Sep 2025).
Another misconception is that any convenient randomization ensemble is interchangeable with any other. The distinction between unitary randomized measurements, real randomized measurements, and partial real randomized measurements shows that the choice of randomization group and observable sector determines which correlations are accessible (Liang et al., 2024). Likewise, the MPS sampling results show that random local constructions can fail to be unbiased with respect to a target geometric measure (Leontica et al., 30 Apr 2025). In this sense, RandomMeas.jl should be understood as a protocol framework whose outputs depend materially on the specified randomization ensemble and estimator family.
Taken together, the available descriptions present RandomMeas.jl as a research-oriented software framework for randomized measurement protocols, distinguished by end-to-end workflow coverage, explicit data abstractions, shadow-based and moment-based estimators, tensor-network simulation support, and built-in uncertainty quantification (Elben et al., 16 Sep 2025). Its significance lies in consolidating a fragmented methodological area into a single extensible Julia package while remaining close to current developments in randomized measurements, real randomized measurements, and advanced shadow protocols (Elben et al., 16 Sep 2025, Liang et al., 2024, Knips, 2020).