Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

QuantumFramework

Tutorials

  • Getting Started

Guides

  • QuantumPhaseSpaceTranform
  • Wolfram Quantum Computation Framework

Tech Notes

  • Bell's Theorem
  • Circuit Diagram
  • Quantum Optimization
  • Exploring Fundamentals of Quantum Theory
  • QPU Service Connection
  • Quantum object abstraction
  • Quantum Optimization
  • Second Quantization Functions
  • Tensor Network
  • Quantum Computation

Symbols

  • QuantumBasis
  • QuantumChannel
  • QuantumCircuitMultiwayGraph [EXPERIMENTAL]
  • QuantumCircuitOperator
  • QuantumDistance
  • QuantumEntangledQ
  • QuantumEntanglementMonotone
  • QuantumEvolve
  • QuantumMeasurement
  • QuantumMeasurementOperator
  • QuantumMeasurementSimulation
  • QuantumMPS [EXPERIMENTAL]
  • QuantumOperator
  • QuantumPartialTrace
  • QuantumPhaseSpaceTransform
  • QuantumShortcut [EXPERIMENTAL]
  • QuantumStateEstimate [EXPERIMENTAL]
  • QuantumState
  • QuantumTensorProduct
  • QuantumWignerMICTransform [EXPERIMENTAL]
  • QuantumWignerTransform [EXPERIMENTAL]
  • QuditBasis
  • QuditName
QPU Service Connection
First time users
AWS-Bracket
IBM-Quantum
​
The Wolfram Quantum Framework is a toolkit for Wolfram Language that offers quantum simulations. The Framework brings quantum experimentation to anyone and opens the door for more research and development of quantum algorithms.
This can also be used to connect with external cloud services such as
IBM Quantum
for an even closer look at what running on quantum hardware could be.
In[1]:=
<<Wolfram`QuantumFramework`
First time users
Connections to external services (such as quantum hardware access) can be utilized by establishing a service connection.

IBM-Quantum Connection

If you want to use an IBM backend, create an
IBM Quantum account
. To create a new connection to IBMQ, you can use the following code:
In[2]:=
ibmq=ServiceConnect["IBMQ","New"]
Out[2]=
ServiceObject
IBMQ
Not Connected

The first time you attempt to connect to a service that requires an API token, you will see the following window appear:
If you choose to save the connection, you can simply use
ServiceConnect
[“IBMQ”] the next time that you want to connect on the same system.
To make sure you are connected, request your account info:
In[15]:=
ibmq["Account"][3;;6]
Out[15]=
userType
Standard
firstName
Sebastian
lastName
Rodriguez
institution
Wolfram Research
If the outcome was not what you expected, it means you are not connected. Try repeating the same steps.

Amazon Braket Connection

Let’s jump in and explore how to utilize the power of Amazon Braket’s quantum computing resources using Wolfram Language.
Connect to AWS using your credentials (using your access key ID and secret access key) so the following code will evaluate correctly in your own notebook.
In[6]:=
aws=ServiceConnect["AWS","New"]
Out[6]=
ServiceObject
AWS
Not Connected

If you choose to save the connection, you can simply use
ServiceConnect
[“AWS”] the next time that you want to connect on the same system.
For more details on this step, such as the creation of credentials files, refer to the Wolfram documentation page “
Authenticate with Amazon Web Services
.”
Execute S3 on AWS (if you do not have an account set up with S3, you will need to
create one
):
In[203]:=
s3=ServiceExecute[aws,"GetService",{"Name""S3"}]
Out[203]=
ServiceObject
AWS-S3
Not Connected

Execute Amazon Braket on AWS:
In[204]:=
braket=ServiceExecute[aws,"GetService",{"Name""Braket"}]
Out[204]=
ServiceObject
AWS-Braket
Not Connected

At this point, you will be connected to Amazon Braket and able to run quantum algorithms on both simulators and QPUs. To make sure you are connected, request devices info:
In[273]:=
braket["SearchDevices","Filters"{}]["Devices",All,2;;5]
Out[273]=
DeviceName
ProviderName
DeviceType
DeviceStatus
Aria 1
IonQ
QPU
ONLINE
Aquila
QuEra
QPU
ONLINE
Harmony
IonQ
QPU
RETIRED
TN1
Amazon Braket
SIMULATOR
ONLINE
Aria 2
IonQ
QPU
OFFLINE
SV1
Amazon Braket
SIMULATOR
ONLINE
Borealis
Xanadu
QPU
RETIRED
dm1
Amazon Braket
SIMULATOR
ONLINE
Forte 1
IonQ
QPU
ONLINE
If the outcome was not what you expected, it means you are not connected. Try repeating the same steps.
IBM-Quantum
Using your token, you can connect to IBM-quantum:
In[1251]:=
ibmq=ServiceConnect["IBMQ"]
Out[1251]=
ServiceObject
IBMQ
Not Connected

ServiceConnect with IBM-Quantum offers the following options:
In[17]:=
ibmq["Requests"]
Out[17]=
{Account,Authentication,Backend,BackendQueue,Backends,Devices,ID,Information,JobResults,Jobs,JobStatus,Name,RawRequests,RunCircuit}

Service-information options

The following options are used to retrieve basic information from the service account:
"Account"
Retrieve account information
"ID"
Connection ID
"Information"
Service information
"Name"
Service name

Examples

The "Account" option collects the following information from your account service:
In[40]:=
ibmq["Account"]//Keys
Out[40]=
email
username
userType
firstName
lastName
institution
citizenshipCountry
roles
ibmQNetwork
qNetworkRoles
canScheduleBackends
applications
urls
subscriptions
needsRefill
needsCitizenCountry
emailVerified
terms
loginAccounts
readOnly
id
Here is an example of the information. Please note that some of the output may be sensitive:
In[38]:=
ibmq["Account"][3;;6]
Out[38]=
userType
Standard
firstName
Sebastian
lastName
Rodriguez
institution
Wolfram Research

Backend and Devices

Use the following options to gather information about the available backends and devices in your service. You can also retrieve details for specific QPUs.
"Backends"||"Devices"
List of backends or devices , including real QPU and simulators.
"Backend"
Information of one specific backend
"BackendQueue"
Total pending workloads (number of jobs)
"Devices"
List of devices, including real QPU and simulators
Gather information about the various devices and backends available through your service:
Verify the pending workload of each QPU, measured by the number of jobs in the queue:

QPU Properties

ServiceConnect offers multiple options to explore different QPU backends and devices:
Check the specifications of a specific QPU backend using its corresponding ID:
Properties
In this case, the default output for an specific Backend corresponds to the table of properties:
This are the following properties available:
You can easily retrieve the information from each property using the following query:
Configuration
Obtain the selected backend configuration:
Retrieve information about backend basis gates:
Retrieve information about backend Hamiltonian:
Status & Defaults
Obtain the selected backend status:

Run Quantum Circuit

There are two methods in order to run a circuit in a QPU using Wolfram Quantum Framework, using the ServiceConnect or QuantumCircuitOperator object. First of all, we need a quantum circuit:
Users should pay attention to specification of each QPUs, for example:
◼
  • Accepted gates
  • ◼
  • Number of qubits
  • ServiceConnect

    Transform the circuit into qiskit object, then decompose it:
    Check the qiskit circuit Diagram:
    Turn the Qiskit object into bytes by specifying the corresponding provider and backend on the IBM system:
    Send the circuit to an IBM QPU:

    QuantumCircuitOperator

    With the service connection established, running a circuit can be as simple as the following code structure:
    However, this simplest method requires waiting for the job to complete and receiving a response before proceeding with any further computations. This will mean your kernel is busy waiting for a response from the hardware provider.
    If you want to do other local computations while waiting for the submitted job to complete, one method is to use a separate kernel to send the request and handle the response. The following code does this and assigns the result to the variable QPU in the current kernel session:
    Note that the wait time for QPU providers to provide responses can vary quite a lot, and is dependent on the queue for the specific backend.

    Jobs

    ServiceConnect offers multiple options to explore QPU's requested jobs:
    Check all the jobs requested in your service:

    Job Status

    It is possible to check the specified job’s status during evaluation or when it is already finished:
    Retrieve the creation time of a job:

    Job Results

    Once the job is done, you can also check on results using the service connection and the appropriate job ID:

    Results

    If you already know the job is done and want to store the results, you can use the appropriate job ID and perform some post-processing to get the data into shape:
    Calculate the theoretical results using the defined QuantumCircuitOperator:
    Plot the results and compare:
    As observed, there have been some errors in the hardware, possibly due to environmental noise or other factors.
    ​
    AWS-Bracket
    Using your token, you can connect to AWS:

    Devices

    Gather information about the various devices available through your service:
    Verify the device status of each QPU:

    QPU Properties

    Check the specifications of a specific QPU device:

    Run Quantum Circuit

    There are two methods in order to run a circuit in a QPU using Wolfram Quantum Framework, using the ServiceConnect or QuantumCircuitOperator object. First of all, we need a quantum circuit:
    Users should pay attention to specification of each QPUs, for example:
    ◼
  • Accepted gates
  • ◼
  • Number of qubits
  • ServiceConnect

    Transform the quantum circuit into Qiskit and find its OpenQASM code using AWSProvider:
    Using this OpenQASM code, we can send the query to the Amazon simulator and our personal "OutputS3Bucket":

    Task

    Check all the jobs requested in your service:
    Check the status of the task:

    Job Results

    Once the job is done, you can also check on results:

    Results

    The results of the requested updates are saved in S3. We can find these by locating their directories:
    Given the previous directory, the measurement result can be obtained as follows:
    Based on the generated results for IonQ, we can then calculate the probabilities:
    We can then chart results for the IonQ QPU (100 shots) and the Wolfram Quantum Framework (exact probabilities as predicted by quantum theory):
    As observed, there have been some errors in the hardware, possibly due to environmental noise or other factors.
    ​

    © 2025 Wolfram. All rights reserved.

    • Legal & Privacy Policy
    • Contact Us
    • WolframAlpha.com
    • WolframCloud.com