Loosely coupled quantum computing

Quantum computing applies the unique behavior of quantum physics to computing. This approach provides dramatically faster compute than classical computing, especially in areas like optimization, simulation, and machine learning. However, quantum computing components have a different operating model from that of classical software. There are typically one or more classical compute components that orchestrate the running of quantum components. This orchestration includes the following activities:

  • Preparation of input data
  • Submission of quantum computing jobs to a target quantum environment
  • Monitoring of job execution
  • Post-processing of job results

You can integrate this orchestration with classical applications in one of two ways:

  • Integration via loose coupling. Logic for the orchestration is exposed as an API that can be called by various classical software components. Use this approach in the following scenarios:
    • Quantum components are developed independently of any classical client application.
    • Quantum components will be reused by various applications.
  • Integration via tight coupling. Logic for the orchestration is integrated into the classical component. For more information about this integration approach, see Tightly coupled quantum computing. Use this approach in following scenarios:
    • Quantum components are developed by the team that develops the classical components.
    • Quantum components share the same lifecycle as the classical components.
    • Use of the quantum components is limited to a single application.

This article describes how to implement quantum applications that use the loosely coupled model. The architecture described here uses Azure Quantum, Azure API Management, and Azure Functions.

Potential use cases

Use this architecture when quantum computing jobs must be run as part of a classical application.

The loosely coupled approach is preferred in these cases:

  • You have a dedicated team of quantum specialists who centrally provide quantum functionality to other teams.
  • The quantum job represents a generic solution (for example, job scheduling) that's required in multiple applications.

Architecture

Architecture diagram that shows a hybrid app that contains a loosely coupled quantum computing job.

Download a PowerPoint file of this architecture.

Dataflow

  1. A signed-in user triggers quantum job execution via a classical application.
  2. The classical application calls the custom job API to submit the job.
  3. The API gateway triggers the job submission Azure function, which passes job input data.
  4. The function puts the input data into Azure Storage.
  5. The function submits the job to an Azure Quantum workspace, specifying the execution target or targets. The function identifies the workspace via data stored in Azure Key Vault and authenticates to the workspace via managed identity.
  6. A quantum provider runs the job on a target environment.
  7. The client application monitors job execution by polling job status via API calls.
  8. The API gateway monitors job execution by polling job status from the quantum provider.
  9. When the job finishes, the compute results are stored in Azure Storage. The client application gets the results by using an API that's implemented via the Azure function.

This workflow implements the Asynchronous Request-Reply pattern and the steps defined for the Azure Quantum job lifecycle.

Components

  • Azure Quantum provides a workspace, accessible from the Azure portal, for assets associated with running quantum or optimization jobs on various targets. Jobs are run on quantum simulators, quantum hardware, or optimization solvers, depending on the provider you choose.
  • Azure Active Directory coordinates user authentication and helps to protect access to the Azure Quantum workspace.
  • API Management is the API gateway that centrally exposes the API endpoints for quantum job management.
  • Azure Functions is used to forward the client requests to appropriate quantum resources.
  • Azure Key Vault safeguards and maintains control of keys and other secrets, like the Azure Quantum workspace name.
  • Azure Storage provides storage for input data and results from the quantum provider.

Alternatives

The architecture presented here is for business problems that require quantum computing resources for their compute tasks. For some compute challenges, existing services built to perform high-performance computing or provide AI functionality might be an alternative.

Considerations

Some of the quantum targets (especially quantum hardware) will be a limited resource for the foreseeable future. Access to these resources is implemented via a queueing mechanism. This pattern leads to fluctuating job execution run times. To calculate the full response time, you need to add the time spent waiting for an available resource to the job execution time.

Availability

Availability of the quantum compute functionality is highly dependent on the availability and install base of the quantum computing provider and optimization provider. Depending on the compute target, the classical client application might experience long delays or unavailability of the target.

SaleBestseller No. 1
HP Elite Desktop PC Computer Intel Core i5 3.1-GHz, 8 gb Ram, 1 TB Hard Drive, DVDRW, 19 Inch LCD Monitor, Keyboard, Mouse, Wireless WiFi, Windows 10 (Renewed)
  • This Certified Refurbished product is tested and...
  • HP Elite 6200 Small Form Factor Desktop PC, Intel...
  • Includes: USB Keyboard & Mouse, WiFi Adapter,...
  • Ports: USB 2.0, DisplayPort, VGA, PS/2 keyboard,...
  • Operating System: Windows 10 64 Bit –...
SaleBestseller No. 2
HP 2022 Newest All-in-One Desktop, 21.5" FHD Display, Intel Celeron J4025 Processor, 16GB RAM, 512GB PCIe SSD, Webcam, HDMI, RJ-45, Wired Keyboard&Mouse, WiFi, Windows 11 Home, White
  • 【High Speed RAM And Enormous Space】16GB DDR4...
  • 【Processor】Intel Celeron J4025 processor (2...
  • 【Display】21.5" diagonal FHD VA ZBD anti-glare...
  • 【Tech Specs】2 x SuperSpeed USB Type-A 5Gbps...
  • 【Authorized KKE Mousepad】Include KKE Mousepad

For the surrounding Azure services, the usual availability considerations apply:

  • For high-availability, you can deploy API Management to multiple zones or regions.
  • If you use geo-replication, you can provision Azure Functions in multiple regions.
  • Use the Key Vault redundancy options.
  • If necessary, consider using the replication options in Storage.

Performance and scalability

Application performance depends on the availability and performance of the underlying quantum computing targets. For information about the performance and scalability of the classical components, review the typical design patterns for scalability and the performance efficiency checklist.

Security

Unlike the architecture for the tightly coupled alternative, the architecture presented here is based on the assumption that multiple clients access the Azure Quantum workspace via the API. This scenario leads to the following configurations:

  • Clients must authenticate to the API. You can implement this authentication by using authentication policies.
  • You can implement authentication of the Azure functions via managed identities associated with the functions. You can use these identities to authenticate to the Azure Quantum workspace.
  • Multiple clients access the API. You can implement request throttling by using API Management request throttling to protect the quantum back end and limit the use of quantum resources.
  • Depending on the request pattern, you might be able to implement the caching of quantum computing results by using API Management caching policies.

In general, consider applying the typical design patterns for security when appropriate.

Resiliency

Keep in mind that quantum target environments are shared resources. Providers typically add submitted jobs to a queue. Jobs wait in the queue until previously submitted jobs finish.

Monitor job execution so you can inform the user about job status. When job execution fails because of a transient error, implement a retry pattern. Submit the jobs via asynchronous calls, with polling for the result, to avoid unnecessary blocking of the calling client.

DevOps

For a description of a continuous integration and continuous delivery (CI/CD) approach for this architecture, see CI/CD for quantum computing jobs.

Pricing

New
HP Stream 14 inch Laptop for Student and Business, Intel Quad-Core Processor, 16GB RAM, 64GB eMMC, 1-Year Office 365, Webcam, 12H Long Battery Life, Lightweight & Slim Laptop, Wi-Fi, Win 11 H in S
  • 【Processor】Intel Celeron N4120, 4 Cores & 4...
  • 【Display】14.0-inch diagonal, HD (1366 x 768),...
  • 【Storage】16GB high-bandwidth DDR4 Memory (2400...
  • 【Connectivity】1 x USB 3.1 Type-C ports, 2 x...
  • 【System】Windows 11 Home in S mode operating...
New
HAJAAN SuperX Gaming PC | Liquid Cooled | GeForce RTX 4060 8GB | AMD Ryzen 5 5600G | 32GB DDR4 | 1TB SSD | Windows 11 Pro | WiFi | Bluetooth - Black
  • Configured with AMD Ryzen 5 5600G Processor and...
  • 8GB GeForce RTX 4060 GDDR6 dedicated graphics card...
  • Liquid cooling system keeps internal components at...
  • Integrated PCIE Wi-Fi provides excellent wireless...
  • Includes USB Gaming RGB Mechanical Keyboard, Mouse...
New
Lenovo 2023 IdeaPad 1i Essential Laptop Computer, Intel Core i5-1235U 12th Gen, 15.6" FHD Anti-Glare Display, (16GB DDR4 RAM, 512GB SSD), HDMI, Bluetooth, Windows 11, Cloud Grey, W/GaLiMu
  • ✔【Display】 15.6" FHD (1920x1080) TN 220nits...
  • ✔【Memory & Storage】RAM Size 16GB 3200MHz...
  • ✔【Connectivity】 1x USB 2.0, 1x USB 3.2 Gen...
  • ✔【Processor & Graphics】 12th Generation...
  • ✔【Operating System】 Windows 11

The overall cost of this solution depends on the quantum computing target that you select to run the quantum job. Calculating estimated costs for the classical components is straightforward. You can use the Azure pricing calculator.

For the Azure Quantum service, consider these points:

  • Microsoft QIO solvers are billed via the Azure subscription bill. The cost depends on the SKU and your usage pattern. For details, see Azure Quantum pricing.
  • Other optimization providers are available on Azure Marketplace. For pricing details, see the appropriate reference page listed in Optimization providers on Azure Quantum.
  • Quantum computing providers can be consumed via an Azure Marketplace offering. Pricing depends on the type of resource (simulator or hardware), the SKU, and your usage. For details, see the reference page for the quantum computing provider needed for your scenario. These reference pages are listed in Quantum computing providers on Azure Quantum.

Next steps

Original Post>