June 09, 2025
Collaborating with top researchers: How Yale's Quantum Institute created new PennyLane features to fuel their research
Breakthrough research and collaboration drives PennyLane development. In this blog post, Isaac De Vlugt walks through how researchers at Yale's Quantum Institute collaborated with the PennyLane team to bring their latest research results to users of PennyLane.
How do breakthroughs break through? Sometimes it's an ironclad result that dethrones the current state-of-the-art, like Shor's factoring algorithm. Other times, research is put on the shelf for a period of time, only to be rediscovered years later as being foundationally critical to commercial applications, like much of the early machine learning research was to the current AI revolution.
However they happen, two things are invaluable for facilitating breakthroughs: having the right tools at your disposal and collaboration.
Professor Yongshan Ding's group at Yale's Quantum Institute was able to use PennyLane to develop useful software that helped their research. But, they were interested in taking their bespoke code and turning it into something more broadly shareable—this is what collaboration with the PennyLane team helped solve!
Their research, outlined in a recent pre-print titled Efficient Quantum Gradient and Higher-order Derivative Estimation via Generalized Hadamard Test outlines hardware-compatible ways to calculate gradients of circuits by refactoring how the Hadamard gradient method works.
As these gradient methods weren't available with PennyLane, Dantong Li, one of Professor Ding's PhD students, had to, and successfully did, implement these new gradient methods. But, reusing this code for subsequent research was going to be challenging, as their implementations were not resilient to future unknowns of their research and newer versions of PennyLane.
"PennyLane has always been our go-to for hybrid quantum-classical work," said Dantong, "so it made perfect sense to demonstrate our new gradient techniques there. Our early prototype ran smoothly, but as PennyLane kept adding cool features like queue-time reductions for real hardware jobs, our code drifted out of sync. Folding the gradients straight into the core library was the best way to keep everything current and let users tap into PennyLane's full variational toolbox with zero friction."
Recently, we teamed up with Professor Ding's group directly to co-develop their gradient methods into existence in PennyLane, giving them the stable software they need to have their research future-proofed 😎. You can now access these features, too!
A peek into the research 👀
Calculating the gradients of parameterized quantum circuits (PQCs) is an important facet of quantum computing research, most notably in quantum machine learning. Existing gradient methods for PQCs have their limitations:
- Hardware-compatibility: Some differentiation methods like backpropagation and adjoint differentiation are not compatible with hardware; if we want to use these methods, they are only deployable on simulations of hardware. Hardware itself is not directly compatible with those gradient methods.
- Scalability: For existing gradient methods that are compatible with hardware, like the parameter-shift rule, they can result in issues such as large circuit depth when a circuit is decomposed into hardware-compatible gates. On top of this, existing methods can produce many repeated terminal measurements or scale exponentially when calculating higher-order partial derivatives.
In their pre-print (Efficient Quantum Gradient and Higher-order Derivative Estimation via Generalized Hadamard Test), Professor Yongshan Ding's group demonstrate how one can extend the Hadamard gradient method, a hardware-compatible gradient method, to reduce repeated terminal measurements and provide better scaling with higher-order derivatives of PQCs.
Variants of the Hadamard gradient method
With PennyLane v0.41, three novel differentiation methods outlined in Professor Ding's group's paper are accessible as valid values for diff_method
in a QNode. These differentiation methods offer tradeoffs that could be advantageous in certain cases:
"reversed-hadamard"
: the observable being measured at the end of a circuit and the generators of the unitary operations in the circuit are reversed; the generators are now the observables, and the Pauli decomposition of the observables are now gates in the circuit."direct-hadamard"
: the additional auxiliary qubit needed in the standard Hadamard gradient method is exchanged for additional circuit executions."reversed-direct-hadamard"
: a combination of the"direct"
and"reversed"
modes, where the role of the observable and the generators of the unitary operations in the circuit swap, and the additional auxiliary qubit is exchanged for additional circuit executions.
import pennylane as qml dev = qml.device("default.qubit") @qml.qnode(dev, diff_method="reversed-hadamard") def circuit(x): qml.RX(x, 0) return qml.expval(qml.Z(0))
>>> qml.grad(circuit)(qml.numpy.array(0.5)) np.float64(-0.47942553860420284)
More information on what these gradient methods are doing can be found in our documentation. Try out these gradient methods and share your feedback with us on the PennyLane Discussion Forum!
How can I collaborate with PennyLane developers?
"Working with the PennyLane team was refreshingly straightforward," Dantong posited. "They covered the CI, testing, and packaging, so I could focus on wiring our paper’s gradient methods straight into the core. Along the way I got a much better feel for PennyLane’s internals and how a research idea becomes production-ready features. The PennyLane team stayed quick with feedback, open to design tweaks, and kept the whole process surprisingly fun."
If your group is interested in collaborating with us to create features for PennyLane to help your research along, let us know at support@pennylane.ai 📩.
Seldomly are challenges with breakthroughs overcome without having the right tools at your disposal and collaborating with others. We want researchers in quantum computing to turn to PennyLane to achieve breakthroughs—not just PennyLane the software, but also the team behind the scenes that makes it.
Be sure to check out the most recent release of PennyLane and stay up-to-date with what we're doing on X (formerly Twitter) and LinkedIn!
About the authors
Isaac De Vlugt
My job is to help manage the PennyLane and Catalyst feature roadmap... and spam lots of emojis in the chat 🤠
Dantong Li
I am a CS Ph.D. student at the Yale Quantum System Lab. My research interests are in the inter-discipline of Quantum Computing and Machine Learning, to explore quantum advantages and their applications in the near-term future. My free time is mostly ...