Although quantum computers promise to solve some of the most intractable problems our society faces, such as climate change and food security, commercially viable solutions will require large-scale, fault-tolerant quantum computers. Solving these problems will also require algorithms and quantum applications capable of executing solutions at a scale, and in a timeframe, that is practical. But how do you know how long a given quantum application will take to run, or how many physical qubits it will require? In quantum computing, Resource Estimation is the process used to answer these questions. Resource Estimation can help you determine the number of qubits, quantum gates, processing time, and other resources needed to run a quantum program assuming specific hardware characteristics.
Azure Quantum Resource Estimation
In November 2022, Azure Quantum announced the release of the Azure Quantum Resource Estimator, a tool to help quantum innovators prepare their solutions for future, scaled quantum systems. The Resource Estimator does this by helping to ascertain how many resources it will take to run a quantum application on a fault tolerant quantum machine. Using the Resource Estimator, quantum developers can understand the number of logical and physical qubits and runtime required to execute a given quantum program. The developer or researcher can then iterate, progressively bringing down the cost required to run the solution. Knowing how long it will take to run a specific algorithm, and which qubit technologies are better suited to solving a specific problem, can guide the developer towards beneficial implementation changes that will improve resource consumption.
The Azure Quantum Resource Estimator is designed specifically for future, fault-tolerant quantum systems. Starting from well-known pre-defined qubit parameter settings and Quantum Error Correction (QEC) schemes, a developer can submit an application or algorithm to the Resource Estimator to understand how choices such as qubit technology, or assumed error correction scheme, will impact overall runtime. More advanced users can review the formulas and values used to derive each estimate and can configure settings across a wide range of machine characteristics such as operation error rates, operation speeds, and error correction schemes. Running comparisons across configurations can help quantum developers refine their solutions to run efficiently on future, scaled quantum machines.
To learn more about Resource Estimation, including how to get started with the Azure Quantum Resource Estimator, check out the Azure Quantum release announcement.
Resource Estimator Capabilities
The Azure Quantum Resource Estimator has been designed with capabilities to help you analyze and optimize your quantum applications.
Capabilities to facilitate application analysis:
- Quantum Chemistry: Using Resource Estimator, you can explore the requirements needed to perform accurate chemistry simulations on fault-tolerant quantum computers. Resource Estimator offers a built-in double-factorized qubitization algorithm and default Hamiltonians to enable easy experimentation, or you can supply your own Hamiltonians using FCIDUMP files. You can learn more about Resource Estimation and quantum chemistry by trying the following tutorial Estimate the resources of a quantum chemistry problem and GitHub sample.
- Space and time visualizations: A quantum program relies heavily on two primary resources: space (quantified by the number of qubits) and time (measured by the execution time of the algorithm). These resources are influenced qubits and the operations, T-factories, and T-states used to execute the program. The Resource Estimator includes visualizations to help you quickly understand how resources are allocated among these components, helping you to design trade-offs between space and time. The use of Space-time diagrams is explained further in the Azure Quantum documentation. You can also try the profiling sample notebook in GitHub.
- Understanding the influence of sub operations using resource estimation profiles: Profiling with flame graphs provides a visual representation of how an the application is spending its resources. Flame graphs show which operations take longest to execute and can help identify bottlenecks. Using this information you can optimize code and improve the overall application performance. Additionally, flame graphs help identify dependencies and calling patterns. You can learn more about profiles by reading this Azure Quantum tutorial or trying out the following notebook in GitHub: Resource estimation profiling in quantum adders.
Resource Estimator space diagram
Capabilities to help you quickly run and retrieve Resource Estimation jobs:
- Caching operations: The Resource Estimator offers a variety of caching operations to speed analysis. For example, the Q# operation FactoringFromLogicalCounts allows you to import logical resource estimates and the EstimateCaching function allows you to identify and cache estimates for frequently repeated code blocks. Resource Estimator caching is further documented in the following Azure Quantum article and notebook: Get the most out of the Azure Quantum Resource Estimator, Resource Estimation for Integer Factoring.
- Batching: Using the Azure Quantum Python API you can batch jobs to significantly expedite estimation. The API allows you to pass numerous input parameter configurations as a unified submission. Results, including summary tables and space/time plots, are received side-by-side for easy analysis. You can explore batching in the Azure Quantum documentation or by trying the Quantum dynamics resource estimation notebook on GitHub.
Capabilities to improve your estimate:
- Component-level space/time optimization: The resource estimator offers adjustable parameters for controlling execution speed and the number of T-factory copies. This enables trade-offs between space and time, since running an algorithm at a slower pace necessitates fewer T factory copies. Additionally, precise control over the error budget is possible with granular management of individual error sources, which can improve both space and time requirements. The Azure Quantum documentation article Customize resource estimates to machine characteristics has further information on how to use this capability. Or you can try it for yourself using the Quantum dynamics resource estimation sample notebook in GitHub.
- Modelling custom distillation units: T-factories play a crucial role in producing T-states that are utilized in executing the algorithm, and they can significantly impact overall resource estimates. During execution, a T-factory undergoes several rounds of distillation, with each round involving a distillation circuit. These are highly optimized quantum circuits that generate higher quality T-states from input T-states. The Resource Estimator provides default distillation units, or you can provide custom distillation units for T-factory optimization. More information on custimizing distillation units is available in the following article: Resource Estimator input and output parameters.
Note: All GitHub samples referenced above are available as hosted notebooks from your Azure Quantum Workspace. Login to the Azure Portal to try them today. For more information on getting started with Azure Quantum, check out the following article on Microsoft Learn: Create an Azure Quantum workspace.