Skip to content

QubitWire / Self-directed portfolio project

PennyLane pathway: audit the cost and uncertainty of a quantum gradient

Build a gradient audit that counts samples and explains when an update becomes unreliable.

Reviewed

Starting skills
Python, elementary differentiation, expectation values
Portfolio output
Gradient-cost notebook with repeated-trial error analysis
A useful completion check
Reference derivative reproduced; sample count and uncertainty documented
Hardware needed
No; simulator and analytical reference are sufficient
Software version
Pin PennyLane and numerical-library versions

A useful quantum-software portfolio can begin with a narrow question: what does it cost to estimate the gradient used by a variational algorithm? PennyLane’s official gradient tutorial compares parameter-shift evaluation with simulator backpropagation, and its related material discusses finite-sample estimates. This pathway uses those resources to build an original audit of gradient accuracy, execution count and uncertainty. It is a self-directed learning project, not a current Xanadu vacancy or an assignment endorsed by the project maintainers.

Start with a small parameterised circuit whose expectation value can be checked analytically or with a high-accuracy classical reference. Choose one parameter and state the derivative convention explicitly. Then compare an exact reference with a sampled estimate over several shot budgets. Preserve the random seeds and report the distribution of estimation errors across repeated trials. A single estimate that happens to be close to the reference should not be presented as the typical outcome. The central skill is designing an experiment that separates mathematical correctness from statistical reliability.

The second part is resource accounting. Record the number of circuit evaluations required to obtain one gradient, the shots per evaluation and the total number of samples. Treat compilation and simulator work as separate costs. Backpropagation through a classical simulator can exploit information unavailable through a hardware sampling interface, so the comparison must name the access model. The goal is not to declare one differentiation method universally superior. It is to explain which method fits a particular execution environment and why the same word gradient can conceal different computational work.

Add a failure case that makes the audit informative. For example, choose a parameter regime with a small true derivative and examine how the sign of the estimate changes across repetitions. Then ask whether an optimiser using those estimates would make consistent updates. Keep the experiment small enough that a reviewer can rerun it quickly. A good report includes the circuit, expected derivative, sample budget, error plot and one decision about when more samples would be justified. This is a proposed exercise; no completed run is claimed.

Questions to take with you

What would make this more than a copied tutorial?

Add a clearly chosen small-gradient regime, repeated-trial uncertainty and a resource table that counts all circuit evaluations. Explain how those observations would change an optimiser’s sampling decision.

Does backpropagation performance predict hardware performance?

Not directly. A simulator can expose internal classical state information that a hardware sampling interface does not. The report must preserve that access-model distinction.

Self-directed project; no vacancy, completed execution, certification or employer endorsement is implied. Pin the software environment before presenting runnable code.

Sources and what they show (2)
  • Quantum gradients with backpropagation ↗PennyLane / Xanadu · Updated 2026-04-16

    Parameter-shift and simulator-backpropagation comparison

    Examples are versioned software guidance, not a hardware-speed guarantee.

  • Stochastic parameter-shift rule ↗PennyLane / Xanadu · Accessed 2026-10-17

    Finite sampling and gradient-estimation discussion

    Do not generalize a specific shift rule to arbitrary generators without checking assumptions.

Explore other portfolio projects