Skip to content

The beginning

QM Platform Overview

Feel free to use Closed Captions and adjust the playback speed to your comfort. ๐Ÿ˜Š

Take a peek

I know it's tempting to quickly skim or not watch the entire video. But, I encourage you to view it fully. ๐Ÿ˜„

Hello QUA

Hardware Deployment

If you have not had the opportunity to deploy your hardware and set up the python environment please follow the steps in our OPX+ installation guide or OPX1000 installation guide before proceeding. Note that inside of each OPX unit there is also an instance of the Hardware simulator.

Cloud Simulator Deployment

To set up the Cloud Simulator access please follow the instructions in the following link.

To begin, please follow the following steps:

  1. You will be needing to have pip install qm-qua qualang-tools qm-saas. You can find the qm-qua changelog in here. And this link will take you to qualang-tools github repository. Please verify that you installed the latest stable releases of qm-qua, qualang-tools, and qm-saas.
  2. Click and download OPXplusconfiguration.py or OPX1000configuration.py.
  3. To access a local OPX unit, update qop_ip and cluster_name values to reflect your hardware (these variables are located in the configuration file), find more information in the network configuration page.
  4. To access the Cloud Simulator, add new variables named cloud_username and cloud_password in the configuration file, and set in the code below simulation_in_cloud = True.
  5. Create a new python file called hello_qua.py.
  6. Copy and paste the code provided below.
hello_qua.py
import qm.qua as qua
from qm import QuantumMachinesManager 
from qm import SimulationConfig 
from OPX1000configuration import config, qop_ip, cluster_name, cloud_username, cloud_password # or OPXplusconfiguration, depending on your hardware
import matplotlib.pyplot as plt
from qm_saas import QmSaas
from qm_saas import QoPVersion

###################
# The QUA program #
###################
with qua.program() as hello_QUA:

    a = qua.declare(qua.fixed)

    with qua.for_(a, 0, a < 1.1, a + 0.05):  

        qua.play("pi" * qua.amp(a), "qubit")

#####################################
#  Open Communication with the QOP  #
#####################################

simulation_in_cloud = True

if simulation_in_cloud:
    client = QmSaas(email=cloud_username, password=cloud_password)
    instance = client.simulator(QoPVersion.v3_2_0)
    instance.spawn()
    qmm = QuantumMachinesManager(host=instance.host,
                                 port=instance.port,
                                 connection_headers=instance.default_connection_headers)
else:
    qmm = QuantumMachinesManager(host=qop_ip, cluster_name=cluster_name)

###########################
# Run or Simulate Program #
###########################

simulation_config = SimulationConfig(duration=1_000) # duration is in units of clock cycles, i.e., 4 nanoseconds
job = qmm.simulate(config, hello_QUA, simulation_config)
job.get_simulated_samples().con1.plot()
if simulation_in_cloud:
    instance.close()
plt.show()
Congratulations!

You have just run your first QUA program and made real-time amplitude modifications in it! ๐Ÿ˜„

The outcome figure (below) shows to you the pulse sequence created by the hello_QUA program. You will learn in later modules that this is the simulator outcome, and the details behind the QUA program itself.

intro_simulation

Coming Up

You've successfully viewed the entire video and run your first hello_QUA programโ€” but this is just the beginning. In the upcoming module, you'll delve into the core principles of the QM platform, empowering you to confidently design and execute your own experiments in the future.

Welcome to the Qubit Calibration Journey!