Application

VaR and CVaR with quantum amplitude estimation: a practical guide for risk teams

We ran iterative quantum amplitude estimation (IQAE) on a 7-qubit circuit, a 64-bin portfolio loss distribution on a noiseless simulator, against Monte Carlo sampling from the same bins. In queries the quantum method delivered what theory promises: its error fell with oracle calls at close to the ideal rate, quadratically faster than Monte Carlo's with samples, and the gap widened as the target tightened. It did not yet shorten the run: on a CPU, Monte Carlo reached the same accuracy sooner down to tight targets, an exact sum over the bins took microseconds, and the published resource estimates for useful financial workloads need fault-tolerant machines that do not exist yet. Use it to learn the method and check claims on your own portfolio, and keep your VaR engine for the numbers you report.

Updated

The short answer

What is quantum
The tail probability P(loss≥threshold)P(\text{loss} \ge \text{threshold}), estimated by iterative quantum amplitude estimation (IQAE) on a circuit that loads the loss distribution. In eigenkit's PortfolioRiskEstimator, VaR and CVaR are classical sums over the bins by default, a quantum bisection for VaR is opt-in, and CVaR is never estimated on the circuit
What the speed-up is
Fewer oracle queries for the same error. In our run the error against queries fell at -0.92 for IQAE (theory: −1) and at -0.50 for Monte Carlo (theory: −0.5)
What it is not
A shorter run time. On a CPU, Monte Carlo reached the simulated IQAE's accuracy in less time down to tight targets, and summing the bins exactly beat both at every target
Hardware
Nothing here ran on a quantum computer. At ε=0.001\varepsilon = 0.001 the deepest circuit of our 7-qubit run needs at least 38564 CX gates, applied coherently
Largest error in a small run
The bins, not the estimator: against the continuous Gaussian it approximates, the 64-bin VaR has a relative error of -3.1%

How VaR and CVaR become an amplitude

Woerner and Egger set out the construction that most work on quantum VaR builds on[1]. A register of nn qubits holds the loss distribution as amplitudes, one basis state per bin. A comparator flips an extra qubit, the ancilla, when the loss of a bin is at or above a threshold, so the probability of reading the ancilla as 1 is the tail probability P(loss≥threshold)P(\text{loss} \ge \text{threshold}). Amplitude estimation then estimates that probability, using the Grover operator that the Grover's algorithm page explains; the IQAE chapter of the eigenkit docs walks through the loop.

The risk measures follow from that one primitive. VaR at 95% is the smallest threshold whose tail probability is at most 5%, which a bisection over thresholds finds, with one amplitude estimation per step. CVaR, the expected shortfall beyond VaR, needs a different oracle: a controlled rotation that puts the loss above VaR, scaled to [0, 1], into the ancilla's amplitude. The paper showed convergence between O(M−2/3)O(M^{-2/3})[1] and O(M−1)O(M^{-1})[1] in the number of samples MM, depending on how deep the circuits may be, against O(M−1/2)O(M^{-1/2}) for Monte Carlo, and ran a toy T-bill model on IBM Q hardware.

Two things fall outside the query count. The distribution has to be computed and loaded first, and for an analytically given log-concave distribution, a Gaussian among them, Herbert showed that loading it with the Grover-Rudolph method removes the quantum speed-up for its mean and moments[3]. And expected shortfall is what banks under the Basel market-risk framework model internally[6], so it is the number a risk team cares about most, and the one that is hardest to estimate on the circuit, as the run below shows.

VaR, CVaR and the tail probability with eigenkit

import numpy as np
from eigenkit import PortfolioRiskEstimator

# Two years of daily prices for three assets (synthetic, seeded).
rng = np.random.default_rng(0)
prices = 100 * np.exp(np.cumsum(rng.normal(0.0004, 0.015, size=(500, 3)), axis=0))
weights = np.array([0.5, 0.3, 0.2])

# 7 qubits: 64 loss bins plus the ancilla that IQAE reads.
estimator = PortfolioRiskEstimator(n_qubits=7, epsilon=0.01, random_state=0)
risk = estimator.fit(prices, weights=weights).estimate(confidence_level=0.95)

print(round(risk.var, 4))               # 0.0147  classical, from the bins
print(round(risk.cvar, 4))              # 0.019   classical, from the bins
print(round(risk.tail_probability, 4))  # 0.0659  IQAE estimate of P(loss >= VaR)
print([round(x, 4) for x in risk.confidence_interval])  # [0.0629, 0.0688]
print(risk.iqae_result.n_oracle_calls)  # 2900

# VaR and CVaR without running a circuit at all.
classical = PortfolioRiskEstimator(n_qubits=7, measure_tail_probability=False)
print(round(classical.fit(prices, weights=weights).estimate(0.95).var, 4))  # 0.0147

Run with eigenkit 1.1.0 on the built-in NumPy simulator. The VaR and CVaR are identical with and without the circuit, because by default they come from the bins; only the tail probability and its interval come from IQAE, and the interval is for that probability, not for the VaR. Set n_bisection_steps above 0 to locate the VaR with IQAE instead.

What our run measured: one portfolio, 64 bins, 20 seeds

We fitted PortfolioRiskEstimator(n_qubits=7) to four synthetic correlated assets (1,000 trading days, weights 0.4, 0.3, 0.2 and 0.1), took the exact values of its 64 bins as the reference, and compared IQAE with Monte Carlo sampling from the same bins. One-day horizon, 95% confidence, eigenkit's default IQAE settings.

QuantityValue
Exact VaR of the 64 bins, share of portfolio value1.71%
Exact CVaR of the 64 bins2.21%
Exact P(loss ≥ VaR) of the 64 bins6.68%
64-bin VaR against the continuous Gaussian-3.1%
IQAE oracle calls at ε = 0.001, mean and spread23070 oracle calls ± 7661 oracle calls
IQAE error (RMSE) of the tail probability at ε = 0.0010.0147%
IQAE intervals that contained the exact value100%
Monte Carlo samples for the same RMSE2884013 samples
IQAE time on the NumPy simulator0.23 s ± 0.08 s
Monte Carlo time for the same RMSE0.09 s
Exact sum of the 64 bins0.0000032 s
Monte Carlo VaR and CVaR from 1 million correlated draws, no bins0.06 s

Run var-cvar-iqae of 2026-11-03, mean and spread over 20 seeds, on Synthetic correlated Gaussian daily log-returns, 4 assets, 1000 days (seed 2026). Errors are against the exact bin values. Times are wall-clock on one Apple Silicon CPU with other jobs running; read them as orders of magnitude. Nothing ran on quantum hardware.

Reading the run: four things that surprise risk teams

The tail probability is not 5%. On the bins it is 6.68%, because the bin that holds the VaR is counted in the tail. IQAE's confidence interval contained the exact value at least as often as requested at every target we tried, but it is an interval for that probability, and it says nothing direct about the error of the VaR.

The query advantage is real and grows with precision, the time advantage is not there. At ε=0.001\varepsilon = 0.001 Monte Carlo needed 2884013 samples for the error IQAE reached with 23070 oracle calls, and still finished sooner on the CPU. The query ratio is smaller at loose targets and larger at tight ones, so a single "N times" figure is a ratio at one precision, not a speed. At the tightest targets the simulated IQAE did overtake Monte Carlo in time, but only because the simulator reads the exact ancilla probability once per round and draws the shots from a binomial; a quantum device has to run every shot. The comparison of amplitude estimation and Monte Carlo takes the query and time arguments apart in full.

CVaR on the circuit is harder than VaR. PortfolioRiskEstimator does not estimate CVaR quantumly, so the run built an expected-shortfall oracle from eigenkit's public IQAE and AmplitudeEncoding. Its amplitude is tiny, while ε\varepsilon is an additive precision on it, so at loose targets IQAE's CVaR was less accurate than Monte Carlo with the same number of queries. At ε=0.001\varepsilon = 0.001 the order reversed: a relative error of 0.51% from 7735 oracle calls, against 1.55% for Monte Carlo with as many samples. VaR by quantum bisection showed no query advantage at all at this size: with the same total samples, the Monte Carlo quantile landed in the right one of 64 bins as often as the bisection did, or more often.

Discretisation can outweigh estimation. With 7 qubits the bins give VaR a relative error of -3.1% against the continuous Gaussian, more than any estimation error in the run at ε=0.01\varepsilon = 0.01 or tighter. Each added qubit doubles the bins, but loading a general distribution costs a number of gates that grows with the bin count, and on a simulator the time grows exponentially with the qubits. Monte Carlo on the continuous four-asset model, with no bins at all, took 0.06 s for a million draws.

What would change this verdict

The query advantage is already there; what is missing is everything around a query. Three conditions would have to change for it to show up as a shorter risk run, and each names a number you can check rather than a date to wait for.

A query that is cheap to run. Each oracle call loads the loss distribution and marks the tail in one coherent circuit, and the last rounds repeat it about 1/ε1/\varepsilon times. That needs error-corrected hardware with fast logical gates: the threshold estimate for derivative pricing, the closest published workload, sets how fast[4]. Until then, IQAE's interval guarantee assumes noiseless circuits[2], and gate noise caps the Grover depth a device can use.

A distribution that is cheap to load. For a Gaussian, and any log-concave distribution given analytically, Grover-Rudolph loading removes the speed-up[3]. The advantage needs a model whose loading cost grows slowly with the bins and assets, or one whose scenarios the circuit computes rather than looks up.

A problem where sampling is the bottleneck. Here the bins had a closed form and the discretisation error was larger than the estimation error. The case amplitude estimation is for is a model with many risk factors, no closed form and a tight precision, measured against Monte Carlo with variance reduction or quasi-Monte Carlo[5], not plain sampling. The plan below tests your own portfolio in that order.

A practical evaluation plan for a risk team

If you want to know what amplitude estimation would do for your own risk numbers, this order keeps the comparison honest.

  1. Start from the number you already trust

    Take your current VaR and expected shortfall from your own engine, and the exact values of the bins (measure_tail_probability=False). Every quantum estimate is judged against these, not against a second estimate.

  2. Fix the distribution and the bins first

    Choose distribution (Gaussian, empirical or Student-t) and n_qubits, and compare the bins' VaR with your model before running any circuit. If the bins are off by more than your tolerance, no estimator will fix it.

  3. Choose ε against the size of the amplitude

    ε\varepsilon is an additive error. A tail probability near 5% tolerates ε=0.01\varepsilon = 0.01; an expected-shortfall amplitude, which is far smaller, does not. Too loose an ε\varepsilon gives a confident estimate of the wrong number.

  4. Count oracle calls and Grover depth, not seconds

    Read iqae_result.n_oracle_calls and the rounds. Simulator seconds say nothing about hardware; the depth of the last round, which grows like 1/ε1/\varepsilon, says what a device would have to run coherently[2].

  5. Compare with the best classical method, not plain sampling

    Importance sampling for tails, control variates and quasi-Monte Carlo all cut the classical cost. A quantum advantage over naive Monte Carlo is not an advantage over your engine.

  6. Treat hardware as a separate question

    Published resource estimates for comparable finance workloads need about 8k logical qubits[4] and a T-depth of 54 million[4], executed in about a second, for derivative pricing. A small circuit on a real device today shows noise, not advantage.

Run it on a real QPU with EigenOrbit RouterWhat would run: the 7-qubit tail-probability circuit at a loose ε, to see how gate noise limits the Grover depth. eigenkit documents no QPU run of IQAE yet, and no advantage is expected at this size.In eigenkit: pip install "eigenkit[router]", then provider=RouterConfig(device=...) (docs).

Questions

Can quantum computers calculate VaR faster than Monte Carlo?

Not today. Amplitude estimation needs quadratically fewer queries than Monte Carlo needs samples for the same error, and a simulated run confirms that scaling, but each query is a coherent circuit that loads the distribution and marks the tail. On a CPU, Monte Carlo reached the simulated estimator's accuracy sooner, an exact sum over the bins was faster than both, and no quantum device runs the deep circuits a tight target needs.

What is quantum about eigenkit's PortfolioRiskEstimator?

Only the tail probability P(loss >= VaR) and its confidence interval, which IQAE estimates on a circuit that loads the fitted loss distribution. VaR and CVaR are classical sums over the bins by default. Setting n_bisection_steps above zero locates the VaR with IQAE at every step of a bisection. CVaR is never estimated on the circuit.

How many qubits does quantum VaR need?

In eigenkit, n_qubits minus one qubits hold the bins and one is the ancilla, so 7 qubits give 64 bins. That is enough for a demonstration but adds a discretisation error, and a real multi-asset model also needs qubits for loading the joint distribution and computing the loss. Published end-to-end estimates for comparable financial workloads, such as derivative pricing, are in the thousands of error-corrected logical qubits.

How is CVaR computed with quantum amplitude estimation?

With a second oracle that rotates the ancilla by an angle that grows with the loss above VaR, so the ancilla's probability is the scaled expected shortfall. That amplitude is small, and the precision of amplitude estimation is additive, so at loose targets the quantum CVaR can be less accurate than Monte Carlo with the same number of queries. The advantage in queries appears only at tight targets.

Can quantum VaR be used for regulatory risk reporting?

No. Everything published so far runs on noiseless simulators or as toy models on small devices, and the internal-model approach in the Basel market-risk framework rests on expected shortfall models that must be validated and backtested. Use the quantum version to study the method and to judge claims, and keep your production engine for the numbers you report.

Sources

  1. S. Woerner, D. J. Egger. Quantum risk analysis. npj Quantum Information 5, 15, 2019. arXiv:1806.06893.
  2. D. Grinko, J. Gacon, C. Zoufal, S. Woerner. Iterative quantum amplitude estimation. npj Quantum Information 7, 52, 2021. arXiv:1912.05559.
  3. S. Herbert. The problem with Grover-Rudolph state preparation for quantum Monte Carlo. Physical Review E 103, 063302, 2021. arXiv:2101.02240.
  4. S. Chakrabarti, R. Krishnakumar, G. Mazzola, N. Stamatopoulos, S. Woerner, W. J. Zeng. A threshold for quantum advantage in derivative pricing. Quantum 5, 463, 2021. arXiv:2012.03819.
  5. R. E. Caflisch. Monte Carlo and quasi-Monte Carlo methods. Acta Numerica 7, 1–49, 1998.
  6. Basel Committee on Banking Supervision. Minimum capital requirements for market risk. Bank for International Settlements, 2019.

Run it yourself with eigenkit

eigenkit is EigenOrbit's open-source Python library: write a circuit once, run it on any simulator or QPU, and test it against a classical baseline on your own data before you invest in it or rule it out.

$ pip install eigenkit