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

  • Wolfram Quantum Computation Framework

Tech Notes

  • Bell's Theorem
  • Circuit Diagram
  • 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

Backend and Devices

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:
In[1256]:=
qc=
QuantumCircuitOperator
​​"H"{1,2,3},​​"CZ"{1,2},"CZ"{2,3},​​"RZ"
π
3
2,"RZ"
2π
3
3,​​"H"{1,2,3},​​{1,2,3}​​;​​qc["Diagram"]
Out[1257]=
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:
    In[137]:=
    qiskit=qc["Qiskit"]["Decompose"];
    Out[138]=
    QiskitCircuit
    Qubits: 3
    Depth: 9
    
    Check the qiskit circuit Diagram:
    In[140]:=
    qiskit["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

    Jobs

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

    Job Status

    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