NavigationContentFooter

Quantum as a Service API

Introduction

Quantum as a Service (QaaS) allows you access to dedicated sessions to run and monitor jobs on simulated quantum processing units (QPU).

Quickstart

  1. Configure your environment variables.

    Note

    This is an optional step that seeks to simplify your usage of the APIs

    export ACCESS_KEY="<access-key>"
    export SECRET_KEY="<secret-key>"
  2. List the available Quantum as a service platforms. A platform is a combination of hardware and software forming a simulated QPU, you can select the one that better fits your use-case from our list.

    curl -X GET \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    -H "Content-Type: application/json" \
    "https://api.scaleway.com/qaas/v1alpha1/platforms"

    You should get a response like the following:

    Important

    Take note of the UUID of your platform of choice, as it will be used in the next step.

    {
    "total_count": 2,
    "platforms": [
    {
    "id": "282e9874-1761-499d-b0dc-004d0e334837",
    "version": "0.9.2",
    "name": "sim:sampling:p100",
    "provider_name": "quandela",
    "type": "simulator",
    "technology": "photonic",
    "max_qubit_count": 20,
    "metadata": "{\"constraints\": {\"max_photon_count\": 20, \"min_photon_count\": 2}, \"pcvl_version\": \"0.9.2\", \"documentation\": \"\", \"available_commands\": [\"samples\", \"probs\"]}"
    },
    {
    "id": "5e52c364-03fd-4bf7-93e2-e1597e28fb83",
    "version": "0.9.2",
    "name": "sim:sampling:h100",
    "provider_name": "quandela",
    "type": "simulator",
    "technology": "photonic",
    "max_qubit_count": 28,
    "metadata": "{\"constraints\": {\"max_photon_count\": 28, \"min_photon_count\": 2}, \"pcvl_version\": \"0.9.2\", \"documentation\": \"\", \"available_commands\": [\"samples\", \"probs\"]}"
    }
    ]
    }
  3. Run the following command to create a session. A session is a time interval where a user can execute quantum jobs on a specific platform.

    curl -X POST \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "project_id": "3j336ee9-dff0-4732-8c5a-bc4f2031ddd3",
    "platform_id": "5e52c364-03fd-4bf7-93e2-e1597e28fb83"
    }'\
    "https://api.scaleway.com/qaas/v1alpha1/sessions"

    You can edit the request payload according to the information below:

    ParameterDescription
    project_idREQUIRED The ID of the Project you want to create your Database Instance in. To find your Project ID you can list the projects or consult the Scaleway console.
    platform_idID of your selected platform.

    If the operation was successful you will see a response like the following:

    {
    "id": "6a134dca-5743-4ba6-9999-b84c295d591c",
    "name": "Justina",
    "platform_id": "5e52c364-03fd-4bf7-93e2-e1597e28fb83",
    "started_at": {
    "seconds": "-62135596800",
    "nanos": 0
    },
    "updated_at": {
    "seconds": "1700063831",
    "nanos": 389384664
    },
    "terminated_at": {
    "seconds": "-62135596800",
    "nanos": 0
    },
    "max_idle_duration": {
    "seconds": "600",
    "nanos": 0
    },
    "max_duration": {
    "seconds": "1800",
    "nanos": 0
    },
    "waiting_job_count": "0",
    "finished_job_count": "0",
    "status": "starting",
    "project_id": "3j336ee9-dff0-4732-8c5a-bc4f2031ddd3",
    "tags": {
    "value": []
    },
    "deduplication_id": "",
    "created_at": {
    "seconds": "1700063831",
    "nanos": 389384664
    }
    }
    Important

    Take note of the UUID of your session, as it will be used in the next step.

  4. Create a job to execute your quantum cirtuit.

    curl -X POST \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "circuit": {
    "perceval_circuit": ":PCVL:zip:eJyzCnAO87FydM4sSi7NLLFydfTM9K9wdI7MSg52DsyO9AkNCtWu9DANqMj3cg50hAPP9GwvBM+xEKgWwXPxRFELAAdTHXM="
    },
    "name": "my_job",
    "session_id": "3j336ee9-dff0-4732-8c5a-bc4f2031ddd3"
    }'\
    "https://api.scaleway.com/qaas/v1alpha1/jobs"

    You can edit the request payload according to the information below:

    ParameterDescription
    perceval_circuitYour Perceval circuit
    nameThe name of your job.
    session_idThe UUID of the session created in the previous step.

    If the operation was successful you will see a response like the following:

    {
    "id": "f0febf59-14b8-4759-b342-09ab061691a3",
    "name": "Loremipsumconsequatdo",
    "tags": {
    "value": []
    },
    "session_id": "f49a7157-93e9-4125-bd3c-b864bb93f6bc",
    "created_at": {
    "seconds": "1700064966",
    "nanos": 251006133
    },
    "updated_at": {
    "seconds": "1700064966",
    "nanos": 251006133
    },
    "started_at": {
    "seconds": "-62135596800",
    "nanos": 0
    },
    "status": "waiting",
    "progress_message": {
    "value": ""
    },
    "job_duration": {
    "seconds": "0",
    "nanos": 0
    },
    "result_distribution": {
    "value": ""
    }
    }
  5. Terminate your session once the job is complete. Make sure you specify the session_ID in the endpoint.

    Note

    This is an optional step, as all sessions have by default a set timeout of 30 minutes.

    curl -X POST \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    -H "Content-Type: application/json" \
    "https://api.scaleway.com/qaas/v1alpha1/sessions/$SESSION_ID/terminate"

    If the operation was successful you will see a response like the following:

    {
    "id": "6a134dca-5743-4ba6-9999-b84c295d591c",
    "name": "Justina",
    "platform_id": "5e52c364-03fd-4bf7-93e2-e1597e28fb83",
    "started_at": {
    "seconds": "1700064968",
    "nanos": 219871003
    },
    "updated_at": {
    "seconds": "1700064975",
    "nanos": 489339876
    },
    "terminated_at": {
    "seconds": "1700064975",
    "nanos": 489339876
    },
    "max_idle_duration": {
    "seconds": "600",
    "nanos": 0
    },
    "max_duration": {
    "seconds": "1800",
    "nanos": 0
    },
    "waiting_job_count": "0",
    "finished_job_count": "0",
    "status": "stopping",
    "project_id": "3j336ee9-dff0-4732-8c5a-bc4f2031ddd3",
    "tags": {
    "value": []
    },
    "deduplication_id": "",
    "created_at": {
    "seconds": "1700063831",
    "nanos": 389384664
    }
    }
Requirements

To perform the following steps, you must first ensure that:

  • you have an account and are logged into the Scaleway console
  • you have created an API key and that the API key has sufficient IAM permissions to perform the actions described on this page.
  • you have installed curl

Technical Information

Regions

Scaleway Quantum as a Service is currently available globally. Refer to our product availability documentation page for more information.

0% SLA

We strive to provide you with the best possible experience on our Quantum as a Service. However, this is an experimental service. This is why we are not able to contractually commit to a level of service, hence an SLA of 0%. The guarantees of Labs offers are detailed in our special conditions for BETA services.

Client

The Scaleway Quantum as a Service is available from Perceval. Perceval is a quantum photonic development kit in Python to design, display and run circuits on your local machine or on a remote computer.

Platforms

A platform is a combination of hardware and software forming a simulated QPU

GET
/qaas/v1alpha1/platforms
GET
/qaas/v1alpha1/platforms/{platform_id}

Sessions

A session is a time interval where a user can execute quantum jobs on a specific platform

GET
/qaas/v1alpha1/sessions
POST
/qaas/v1alpha1/sessions
GET
/qaas/v1alpha1/sessions/{session_id}
PATCH
/qaas/v1alpha1/sessions/{session_id}
DELETE
/qaas/v1alpha1/sessions/{session_id}
POST
/qaas/v1alpha1/sessions/{session_id}/terminate

Jobs

A job is your quantum circuit that is executed during a session on a simulated QPU

GET
/qaas/v1alpha1/jobs
POST
/qaas/v1alpha1/jobs
GET
/qaas/v1alpha1/jobs/{job_id}
PATCH
/qaas/v1alpha1/jobs/{job_id}
DELETE
/qaas/v1alpha1/jobs/{job_id}
POST
/qaas/v1alpha1/jobs/{job_id}/cancel
GET
/qaas/v1alpha1/jobs/{job_id}/circuit
GET
/qaas/v1alpha1/jobs/{job_id}/results

Applications

An application is a pre-defined quantum algorithm to solve specific task

GET
/qaas/v1alpha1/applications
GET
/qaas/v1alpha1/applications/{application_id}

Processes

A process is a started application with specific user inputs on a given platform

GET
/qaas/v1alpha1/processes
POST
/qaas/v1alpha1/processes
GET
/qaas/v1alpha1/processes/{process_id}
PATCH
/qaas/v1alpha1/processes/{process_id}
DELETE
/qaas/v1alpha1/processes/{process_id}
POST
/qaas/v1alpha1/processes/{process_id}/cancel
GET
/qaas/v1alpha1/processes/{process_id}/results
Docs APIScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCarreer
© 2023-2024 – Scaleway