Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@
"## Creating and executing a feature extractor on a physical QPU\n",
"\n",
"Once you have checked that low qubit sequences provide the results you expect on an emulator, you will generally want to move to a QPU.\n",
"For this, you will need either physical access to a QPU, or an account with [PASQAL Cloud](https://docs.pasqal.com/cloud), which provides\n",
"you remote access to QPUs built and hosted by Pasqal. In this section, we'll see how to use the latter.\n",
"For this, you will need a connection to a remote quantum device. QEK accepts any Pulser\n",
"[`RemoteConnection`](https://pulser.readthedocs.io/en/stable/apidoc/backend.html), so it works with any provider that\n",
"ships one. In this section, we'll use [PASQAL Cloud](https://docs.pasqal.com/cloud), which provides remote access to\n",
"QPUs built and hosted by Pasqal, through `pasqal_cloud.PasqalCloudConnection`, which implements Pulser's `RemoteConnection`.\n",
"\n",
"If you don't have an account, just skip to the next section!"
]
Expand All @@ -180,19 +182,28 @@
"outputs": [],
"source": [
"from pathlib import Path\n",
"import qek.data.extractors_v2 as qek_extractors_v2\n",
"\n",
"\n",
"HAVE_PASQAL_ACCOUNT = False # If you have a PASQAL Cloud account, fill in the details and set this to `True`.\n",
"\n",
"if HAVE_PASQAL_ACCOUNT:\n",
" # Use the QPU Extractor.\n",
" extractor = qek_extractors.RemoteQPUExtractor(\n",
" from pasqal_cloud import PasqalCloudConnection\n",
"\n",
" # Open a connection to the remote device. Any Pulser `RemoteConnection` will do here.\n",
" connection = PasqalCloudConnection(\n",
" project_id = \"XXXX\", # Replace this with your project id on the PASQAL Cloud\n",
" username = \"XXX\", # Replace this with your username on PASQAL Cloud\n",
" # Security note: we deliberately do not pass a password here. Leaving it out means\n",
" # you will be prompted for it, instead of writing it down in your code.\n",
" )\n",
"\n",
" # Use the remote extractor. By default, it runs on a QPU.\n",
" extractor = qek_extractors_v2.RemoteExtractorV2(\n",
" # Once computing is complete, data will be saved in this file.\n",
" path=Path(\"saved_data.json\"),\n",
" compiler = compiler,\n",
" project_id = \"XXXX\", # Replace this with your project id on the PASQAL Cloud\n",
" username = \"XXX\", # Replace this with your username on PASQAL Cloud\n",
" password = None, # Replace this with your password on PASQAL Cloud or enter it on the command-line\n",
" connection = connection,\n",
" )\n",
"\n",
" # Add the graphs, exactly as above.\n",
Expand Down Expand Up @@ -221,11 +232,12 @@
"\n",
"There are two main ways to deal with this:\n",
"\n",
"1. `RemoteQPUExtractor` can be attached to an ongoing job from batch ids, so that you can resume your work\n",
"1. `RemoteExtractorV2` can be attached to an ongoing job by passing `batch_ids`, so that you can resume your work\n",
" e.g. after turning off your computer.\n",
"2. Pasqal CLOUD offers access to high-performance hardware-based emulators, with dramatically\n",
" shorter waiting lines. For instance, in the snippet above, you may replace `RemoteQPUExtractor`\n",
" with `RemoteEmuMPSExtractor` to use the emu-mps emulator.\n",
" shorter waiting lines. For instance, in the snippet above, you may pass\n",
" `backend_class=pasqal_cloud.RemoteMPSBackend` to run on the emu-mps emulator instead of a QPU.\n",
" Any Pulser remote backend compatible with your connection works the same way.\n",
"\n",
"See [the documentation](https://pqs.pages.pasqal.com/quantum-evolution-kernel/) for more details."
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"Once you have checked that the compiled graphs work on an emulator, you will probably want to move to a QPU. Execution on a QPU takes\n",
"resources polynomial in the number of qubits, which hopefully means an almost exponential speedup for large number of qubits.\n",
"\n",
"To experiment with a QPU, you will need either physical access to a QPU, or an account with [PASQAL Cloud](https://docs.pasqal.com/cloud), which provides you remote access to QPUs built and hosted by Pasqal. In this section, we'll see how to use the latter.\n",
"To experiment with a QPU, you will need a connection to a remote quantum device: QEK accepts any Pulser [`RemoteConnection`](https://pulser.readthedocs.io/en/stable/apidoc/backend.html). In this section, we'll use [PASQAL Cloud](https://docs.pasqal.com/cloud), which provides remote access to QPUs built and hosted by Pasqal, through `pasqal_cloud.PasqalCloudConnection`, which implements Pulser's `RemoteConnection`.\n",
"\n",
"If you don't have an account, just skip to the next section!"
]
Expand All @@ -253,20 +253,20 @@
"source": [
"HAVE_PASQAL_ACCOUNT = False # If you have a PASQAL Cloud account, fill in the details and set this to `True`.\n",
"\n",
"if HAVE_PASQAL_ACCOUNT: \n",
"if HAVE_PASQAL_ACCOUNT:\n",
" from pasqal_cloud import PasqalCloudConnection\n",
" from qek.target.backends import RemoteQPUBackend\n",
" processed_dataset = []\n",
"\n",
" # Initialize connection\n",
" # Open a connection to the remote device. Any Pulser `RemoteConnection` will do here.\n",
" connection = PasqalCloudConnection(\n",
" project_id = \"your_project_id\", # Replace this value with your project_id on the PASQAL platform.\n",
" username = \"your_username\", # Replace this value with your username or email on the PASQAL platform.\n",
" # Security note: we deliberately do not pass a password here. Leaving it out means\n",
" # you will be prompted for it, instead of writing it down in your code.\n",
" )\n",
"\n",
" my_project_id = \"your_project_id\"# Replace this value with your project_id on the PASQAL platform.\n",
" my_username = \"your_username\" # Replace this value with your username or email on the PASQAL platform.\n",
" my_password = \"your_password\" # Replace this value with your password on the PASQAL platform.\n",
" # Security note: In real life, you probably don't want to write your password in the code.\n",
" # See the documentation of PASQAL Cloud for other ways to provide your password.\n",
"\n",
" # Initialize the cloud client\n",
" backend = RemoteQPUBackend(username=my_username, project_id=my_project_id, password=my_password)\n",
" backend = RemoteQPUBackend(connection=connection)\n",
"\n",
" # Fetch the specification of our QPU\n",
" device = await backend.device()\n",
Expand Down Expand Up @@ -301,9 +301,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"There are other ways to use the SDK. For instance, you can enqueue a job and check later whether it has completed. Also, to work around the long waiting lines, Pasqal provides high-performance distributed and hardware-accelerated emulators, which you can access through the SDK.\n",
"There are other ways to use a remote connection. For instance, you can enqueue a job and check later whether it has completed. Also, to work around the long waiting lines, Pasqal provides high-performance distributed and hardware-accelerated emulators, which you can reach over the same connection by picking another Pulser remote backend (e.g. `pasqal_cloud.RemoteMPSBackend`).\n",
"\n",
"For more details, [take a look at the documentation of the SDK](https://docs.pasqal.com/cloud).\n"
"For more details, [take a look at the Pulser documentation](https://pulser.readthedocs.io/en/stable/apidoc/backend.html).\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@
"Once you have checked that the pulses work on an emulator, you will probably want to move to a QPU. Execution on a QPU takes\n",
"resources polynomial in the number of qubits, which hopefully means an almost exponential speedup for large number of qubits.\n",
"\n",
"To experiment with a QPU, you will need either physical access to a QPU, or an account with [PASQAL Cloud](https://docs.pasqal.com/cloud), which provides you remote access to QPUs built and hosted by Pasqal. In this section, we'll see how to use the latter.\n",
"To experiment with a QPU, you will need a connection to a remote quantum device: QEK accepts any Pulser [`RemoteConnection`](https://pulser.readthedocs.io/en/stable/apidoc/backend.html). In this section, we'll use [PASQAL Cloud](https://docs.pasqal.com/cloud), which provides remote access to QPUs built and hosted by Pasqal, through `pasqal_cloud.PasqalCloudConnection`, which implements Pulser's `RemoteConnection`.\n",
"\n",
"If you don't have an account, just skip to the next section!\n",
"\n",
"> There are other ways to use the SDK. For instance, you can enqueue a job and check later whether it has completed. Also, to work around the long waiting lines, Pasqal provides high-performance distributed and hardware-accelerated emulators, which you can access through the SDK. For more details, [take a look at the documentation of the SDK](https://docs.pasqal.com/cloud)."
"> There are other ways to use a remote connection. For instance, you can enqueue a job and check later whether it has completed. Also, to work around the long waiting lines, Pasqal provides high-performance distributed and hardware-accelerated emulators, which you can reach over the same connection by picking another Pulser remote backend (e.g. `pasqal_cloud.RemoteMPSBackend`). For more details, [take a look at the Pulser documentation](https://pulser.readthedocs.io/en/stable/apidoc/backend.html)."
]
},
{
Expand All @@ -333,20 +333,20 @@
"source": [
"HAVE_PASQAL_ACCOUNT = False # If you have a PASQAL Cloud account, fill in the details and set this to `True`.\n",
"\n",
"if HAVE_PASQAL_ACCOUNT: \n",
"if HAVE_PASQAL_ACCOUNT:\n",
" from pasqal_cloud import PasqalCloudConnection\n",
" from qek.target.backends import RemoteQPUBackend\n",
" processed_dataset = []\n",
"\n",
" # Initialize connection\n",
" # Open a connection to the remote device. Any Pulser `RemoteConnection` will do here.\n",
" connection = PasqalCloudConnection(\n",
" project_id = \"your_project_id\", # Replace this value with your project_id on the PASQAL platform.\n",
" username = \"your_username\", # Replace this value with your username or email on the PASQAL platform.\n",
" # Security note: we deliberately do not pass a password here. Leaving it out means\n",
" # you will be prompted for it, instead of writing it down in your code.\n",
" )\n",
"\n",
" my_project_id = \"your_project_id\"# Replace this value with your project_id on the PASQAL platform.\n",
" my_username = \"your_username\" # Replace this value with your username or email on the PASQAL platform.\n",
" my_password = \"your_password\" # Replace this value with your password on the PASQAL platform.\n",
" # Security note: In real life, you probably don't want to write your password in the code.\n",
" # See the documentation of PASQAL Cloud for other ways to provide your password.\n",
"\n",
" # Initialize the cloud client\n",
" executor = RemoteQPUBackend(username=my_username, project_id=my_project_id, password=my_password)\n",
" executor = RemoteQPUBackend(connection=connection)\n",
"\n",
" # Fetch the specification of our QPU\n",
" device = await executor.device()\n",
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ classifiers = [
dependencies = [
"networkx",
"numpy",
"pulser~=1.5",
"pulser~=1.8",
"rdkit",
"scikit-learn",
"torch",
"torch_geometric",
"matplotlib",
"emu-mps~=2.2.0",
"pasqal-cloud",
"emu-mps~=2.7",
"pasqal-cloud>=0.23.0",
]

[tool.hatch.metadata]
Expand Down
Loading
Loading