Q# helps quantum resource estimation for derivative pricing

Q# helps quantum useful resource estimation for spinoff pricing

Posted on

Goldman Sachs text-only company logo.

At Goldman Sachs, our Analysis and Growth staff is at all times trying to push ahead the leading edge in expertise for monetary companies. Whereas quantum computing stays in an early stage, the promise of the expertise signifies that we’re actively researching the place and the way it may be utilized sooner or later. A key method right here is for us to “work backward.” We begin with a helpful, well-defined mathematical drawback in finance that we will pair with a theoretical computational benefit for quantum computer systems. We then ask: what would the specs of an actual quantum pc should be to attain a sensible benefit for this drawback? In doing this useful resource estimation work we have to fill in sensible particulars and plug gaps in theoretical approaches. It additionally usually uncovers essential optimizations that may, for instance, cut back time to resolution or the required quantum reminiscence.

Useful resource estimation for quantum benefit in spinoff pricing

One instance that we now have centered on is the pricing of complicated derivatives. Derivatives are monetary contracts whose worth right this moment is predicated on some statistical mannequin of what is going to occur sooner or later. A standard instance of a monetary spinoff is a inventory possibility. When you have got an advanced contract or an advanced statistical mannequin then it may be computationally costly to compute the worth. Derivatives are so frequent in finance that even a small enchancment in pricing them, or in calculating associated portions, could possibly be very helpful.

Derivatives are a superb goal for useful resource estimation as a result of the underlying algorithm that’s usually used is Monte Carlo, and it’s identified that there’s a theoretical speedup accessible to quantum computer systems for pretty generic Monte Carlo algorithms. The algorithm builds on a subroutine known as amplitude estimation and provides a quadratic speedup. For example, to attain an accuracy ε within the worth a classical Monte Carlo algorithm must run for O(1/ε2) steps. Nevertheless, the quantum algorithm runs in solely O(1/ε) steps. For instance, if you’re concentrating on accuracy of 1 half per thousand (ε = 10-3) then the quantum algorithm may wish just one,000 steps vs. a classical algorithm that would wish 1,000,000.

In fact, that is simply the theoretical scaling and particulars should be crammed in to see if that is sensible. For instance, every step on a quantum pc may take for much longer than every step on a classical pc as a result of the clock fee is slower. There additionally could also be different overheads that affect the fixed elements within the algorithm.

In 2020, we labored with co-authors at IBM to provide the primary end-to-end useful resource estimate for spinoff pricing in our paper “A Threshold for Quantum Benefit in By-product Pricing.” We used two sensible examples of spinoff contracts in that paper: an autocallable and a Goal Accrual Redemption Ahead (TARF). These are examples which are sophisticated sufficient to cost right this moment that we want a speedup and which are traded in sufficient quantity that bettering their pricing issues. So as to make the useful resource estimate sensible, we launched some modifications to the algorithm known as the re-parameterization technique. This resulted within the following estimates for the sources wanted for the autocallable instance. We embrace the entire sources wanted in addition to the sources utilized in an essential subroutine of amplitude estimation, the Q operator:

  Complete Sources Q Operator
T-count 1.2 x 10^10 11.4M
T-depth 5.4 x 10^7 9.5k
Logical Qubits 8k 8k

We embrace three essential figures of advantage to explain the sources. The T-count offers the variety of T-gate operations wanted within the algorithm. The T-gate operation in lots of fault-tolerant quantum computing architectures requires considerably extra sources than different operations and so dominates the sources wanted by the computation. We additionally embrace the T-depth. That is the variety of T-gate operations that wanted to be executed sequentially. In some architectures, this depth quantity then determines the general runtime of the algorithm as different T-gates will be parallelized. Lastly, we embrace the quantity of quantum reminiscence wanted for the algorithm as measured by the variety of qubits.

Useful resource estimation with Q#

Useful resource estimation is difficult as all the small print matter. For instance, our paper makes use of totally combined precision within the implementation, the place every fixed-point register is optimized to make use of the correct variety of qubits. How can we make certain that we didn’t make errors after we can’t run a full implementation?

So as to take our useful resource estimate to the subsequent stage, we selected to make use of Q# and work with Mathias Soeken and Martin Roetteler on the Microsoft Azure Quantum staff to develop a full Q# implementation of our algorithm. Doing useful resource estimation this manner had many advantages:

  1. Dealing with complexity: We might use Q#’s options to robotically deal with the allocation and administration of quantum reminiscence. Additional, options like robotically producing managed and adjoint operations made it simpler for us to precise the algorithm at a better stage and let the compiler work out the small print.
  2. Utilizing libraries: A lot of the useful resource complexity in our spinoff pricing algorithm is utilized by reversible arithmetic on quantum registers. Q# already has many libraries for fixed-point arithmetic operations that we might import and invoke with no need to re-implement them ourselves.
  3. Discovering errors: Since a lot of the code in our implementation is coping with reversible variations of classical arithmetic, we had been in a position to make use of Q#’s Toffoli simulator to effectively check parts of our implementation for correctness. Whereas the entire algorithm can’t be straight simulated, we had been in a position to develop unit exams for key parts that we might effectively simulate to construct up confidence in our useful resource counts.
  4. Modular design: The general algorithm is sophisticated. Having a concrete implementation lets one deal with optimizing particular capabilities separately after which letting the system inform you the general impact on useful resource counts.

New updates to the algorithm from utilizing Q#

Whereas implementing the algorithm from our earlier work in Q# we made some enhancements and modifications.

Firstly, we eliminated the arcsine and square-root arithmetic operations (Step 3 of Algorithm 4.2) and changed them with the comparator technique (Part 2.2 of this work). This reduces the sources wanted for that step.

Secondly, we changed the piecewise polynomial implementation of the exponential operate with a lookup desk. A lookup desk can additional cut back sources over reversible fixed-point arithmetic that may be costly on quantum computer systems. This lookup desk implementation has been open sourced as a part of Q#. Within the useful resource estimate outcomes given under, the lookup desk for the exponential operate has a free parameter given by the variety of “swap” qubits used. Within the useful resource estimates under we quote sources for 3 completely different decisions of swap qubits. As we now have an implementation in Q# it’s simple to handle and compute completely different useful resource necessities for in a different way parameterized implementations.

Useful resource estimation outcomes

With these updates and the extra detailed implementation in Q#, we calculated the sources wanted for 3 key subroutines in spinoff pricing and in contrast them to our earlier work. The primary is for the Q operator, the important thing operator in amplitude estimation. The second is for the payoff operator that reversibly implements the spinoff payoff. The third is for the exponential operate itself, which is the most important useful resource client moreover the basic amplitude estimation itself.

The benchmark chosen is the three asset autocallable on 20 time steps. These parameters match actual situations that one might discover in follow.

Comparisons are made amongst three strategies:

  • Paper: the unique hand estimates from our work in Chakrabarti et al: https://quantum-journal.org/papers/q-2021-06-01-463/.
  • SWAP10: Q# implementation estimates the place the exponential lookup desk is about to make use of 10 swap bits.
  • SWAP5: Q# implementation estimates the place the exponential lookup desk is about to make use of 5 swap bits.
  • SWAP1: Q# implementation estimates the place the exponential lookup desk is about to make use of 1 swap bit.

Total Q Operator

  Paper SWAP10 SWAP5 SWAP1
T-count 11.4M 14.6M 2.9M 6.3M
T-depth 9.5k 16k 16.6k 36k
Logical Qubits 8k 3.8M 124k 19.2k

Payoff Operator

  Paper SWAP10 SWAP5 SWAP1
T-count 189k 77k 77k 77k
T-depth 3.2k 2.7k 2.7k 2.7k
Logical Qubits 1.6k 19.2k 19.2k 19.2k

Fastened Level Exponential

  Paper SWAP10 SWAP5 SWAP1
T-count 7M 12.3M 617k 3.9M
T-depth 1.2k 62 1.3k 20.5k
Logical Qubits 5.4k 3.8M 124k 11.5k

Broadly talking, our SWAP1 implementation outcomes are shut however not the identical as our by-hand estimates. Which means our by-hand estimates had been generally pessimistic (like for T-count) and different instances optimistic, however not by an excessive amount of.


By working with a Q# implementation we had been in a position to enhance the accuracy and suppleness of our useful resource estimates for quantum benefit in spinoff pricing. The implementation additionally offers us a basis to extra quickly iterate on up to date variations and on different algorithms that use comparable subroutines. We sit up for persevering with optimization of this algorithm and implementation by making the most of new concepts and developments within the Q# ecosystem.

 “Working straight with the Goldman Sachs staff has offered a unbelievable alternative to collaborate on useful resource estimation for an essential drawback within the finance trade, acquire insights to boost the choices throughout the Azure Quantum ecosystem, and share useful resource estimation methods and algorithm enhancements with the neighborhood. It’s thrilling to see the affect Q# can allow, from algorithm improvement to useful resource estimation and discount, and it’s been a pleasure working with Goldman Sachs to additional quantum affect.”—Dr. Krysta Svore, Distinguished Engineer and VP Quantum Software program for Azure Quantum

Supply hyperlink

Leave a Reply

Your email address will not be published. Required fields are marked *