{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Devices & Credentials\n", "\n", "Quantinuum Nexus provides an interface to many different quantum execution environments.\n", "\n", "Here we use the general term `Device` to mean a specific quantum computer, emulator or simulator.\n", "\n", "You can use `qnexus` to view the Devices you have available to you through the Nexus platform.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import qnexus as qnx" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Pull in all available devices and return a pandas dataframe\n", "qnx.devices.get_all().df()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# List Quantinuum devices\n", "qnx.devices.get_all(\n", " issuers=[qnx.devices.IssuerEnum.QUANTINUUM]\n", ").df()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# List IBMQ devices under a specific IBMQ hub, group, and project\n", "qnx.devices.get_all(\n", " issuers=[qnx.devices.IssuerEnum.IBMQ],\n", " ibmq_hub=\"ibm-q\",\n", " ibmq_group=\"open\",\n", " ibmq_project=\"main\", \n", ").df()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# List simulator and emulator devices that are hosted in the Nexus platform\n", "qnx.devices.get_all(\n", " nexus_hosted=True,\n", ").df()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Credentials\n", "\n", "Some devices require credentials, which can be set at https://nexus.quantinuum.com/settings/accounts\n", "\n", "By default you do not need to set credentials for Nexus-hosted simulators or for Quantinuum devices that you have access to. Once you have credentials saved you won't be able to view them again, but you will be able to identify them by name." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# List your saved credentials\n", "my_credentials = qnx.credentials.get_all()\n", "\n", "my_credentials.df()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Using saved credentials\n", "\n", "Saved credentials will be used automatically when listing devices or submitting jobs, however you can specify a set of credentials to use by passing their identifier or unique name." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "qnx.devices.get_all(\n", " credentials=[my_credentials[0]]\n", ").df()" ] } ], "metadata": { "kernelspec": { "display_name": "qnexus-Rou6F43i-py3.11", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.8" } }, "nbformat": 4, "nbformat_minor": 2 }