From 8539ad06b0837507e86a2b92b667bcfd781415df Mon Sep 17 00:00:00 2001 From: Dominic Widdows Date: Mon, 13 Jun 2022 13:08:40 -0700 Subject: [PATCH] Updated cirq.ionq to cirq_ionq throughout (#5496) Fixes out-of-date documentation. The correct import throughout is now `import cirq_ionq` rather than `import cirq.ionq`. --- docs/ionq/access.md | 6 +++--- docs/ionq/calibrations.md | 6 +++--- docs/ionq/circuits.md | 8 ++++---- docs/ionq/jobs.md | 12 ++++++------ docs/ionq/service.md | 6 +++--- docs/tutorials/ionq/getting_started.ipynb | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/ionq/access.md b/docs/ionq/access.md index 842ec0f4dba..10216c19aa0 100644 --- a/docs/ionq/access.md +++ b/docs/ionq/access.md @@ -11,9 +11,9 @@ To use Cirq with the IonQ API, one needs an API key. This is a random looking s Given that you have the API key, there are two ways to use these to get an object in python to access the API. The object that you construct to access -the API are instances of the `cirq.ionq.Service` class. You can directly use the API key in constructing this instances of this class. Here is an example of this pattern: +the API are instances of the `cirq_ionq.Service` class. You can directly use the API key in constructing this instances of this class. Here is an example of this pattern: ```python -import cirq.ionq as ionq +import cirq_ionq as ionq service = ionq.Service(api_key='tomyheart') ``` @@ -24,7 +24,7 @@ export IONQ_API_KEY=tomyheart ``` In the case that you have set these environment variables, you can just perform ```python -import cirq.ionq as ionq +import cirq_ionq as ionq service = ionq.Service() ``` diff --git a/docs/ionq/calibrations.md b/docs/ionq/calibrations.md index d43d9b0113e..3dc8d711da7 100644 --- a/docs/ionq/calibrations.md +++ b/docs/ionq/calibrations.md @@ -5,11 +5,11 @@ at a given moment of time. The IonQ quantum computers are continuously calibrated, and measurements are taken of the performance of the machine periodically. -In this section, we assume a `cirq.ionq.Service` object has been instantiated and is -called `service` and `cirq` and `cirq.ionq` have been imported: +In this section, we assume a `cirq_ionq.Service` object has been instantiated and is +called `service` and `cirq` and `cirq_ionq` have been imported: ```python import cirq -import cirq.ionq as ionq +import cirq_ionq as ionq service = ionq.Service() ``` See [IonQ API Service](service.md) for how to set up the service. diff --git a/docs/ionq/circuits.md b/docs/ionq/circuits.md index fbbcee0c31b..4b3c94ea012 100644 --- a/docs/ionq/circuits.md +++ b/docs/ionq/circuits.md @@ -5,11 +5,11 @@ for the service. In other words, not every `cirq.Circuit` that you can construct will be able to run on the IonQ API, either against hardware or on the IonQ simulator. Here we describe the restrictions on these circuits. -In this section we assume a `cirq.ionq.Service` object has been instantiated and is -called `service` and `cirq` and `cirq.ionq` have been imported: +In this section we assume a `cirq_ionq.Service` object has been instantiated and is +called `service` and `cirq` and `cirq_ionq` have been imported: ```python import cirq -import cirq.ionq as ionq +import cirq_ionq as ionq service = ionq.Service() ``` See [IonQ API Service](service.md) for how to set up the service. @@ -96,7 +96,7 @@ these gates are one or two qubit gates which support the `unitary` protocol for the gate) there is support for compiling these into API supported gates. This conversion may not be optimal, but it does produce a valid API circuit. -This support is given by the `cirq.ionq.IonQAPIDevice` and its +This support is given by the `cirq_ionq.IonQAPIDevice` and its `decompose_operation` method. On way to use this is to pass the device to a circuit, and these decompositions will be automatically applied while the circuit is being constructed: diff --git a/docs/ionq/jobs.md b/docs/ionq/jobs.md index 18a4ae3e4e4..3e0e6a6b87d 100644 --- a/docs/ionq/jobs.md +++ b/docs/ionq/jobs.md @@ -3,11 +3,11 @@ Here we detail how to run jobs on the IonQ API against the IonQ QPU and the IonQ simulator. -In this section we assume a `cirq.ionq.Service` object has been instantiated and is -called `service` and `cirq` and `cirq.ionq` have been imported: +In this section we assume a `cirq_ionq.Service` object has been instantiated and is +called `service` and `cirq` and `cirq_ionq` have been imported: ```python import cirq -import cirq.ionq as ionq +import cirq_ionq as ionq service = ionq.Service() ``` See [IonQ API Service](service.md) for how to set up the service. @@ -28,7 +28,7 @@ Here we describe these different methods. ### Via Run -The first method for running is to do so via the `run` method on `cirq.ionq.Service`. +The first method for running is to do so via the `run` method on `cirq_ionq.Service`. ```python qubit = cirq.LineQubit(0) @@ -97,9 +97,9 @@ circuit = cirq.Circuit( job = service.create_job(circuit=circuit, target='qpu', repetitions=100) print(job) ``` -which shows that the returned object is a `cirq.ionq.Job`: +which shows that the returned object is a `cirq_ionq.Job`: ``` -cirq.ionq.Job(job_id=93d111c1-0898-48b8-babe-80d182f8ad66) +cirq_ionq.Job(job_id=93d111c1-0898-48b8-babe-80d182f8ad66) ``` One difference between this approach and the run and sampler methods diff --git a/docs/ionq/service.md b/docs/ionq/service.md index 32d03a0af2c..8d52a0a5d2b 100644 --- a/docs/ionq/service.md +++ b/docs/ionq/service.md @@ -6,13 +6,13 @@ See [Access and Authentication](access.md) for details of access. ## Service class -The main entrance for accessing IonQ's API are instances of the `cirq.ionq.Service` class. +The main entrance for accessing IonQ's API are instances of the `cirq_ionq.Service` class. These objects need to be initialized with an api key, see [Access and Authentication](access.md) for details. The basic flow of running a quantum circuit in a blocking manner is 1. Create a circuit to run. -1. Create a `cirq.ionq.Service` with proper authentication and endpoints. +1. Create a `cirq_ionq.Service` with proper authentication and endpoints. 3. Submit this circuit to run on the service and await the results of this call. (Or alternatively use asynchronous jobs and processing) 4. Transform the results in a form that is most useful for your analysis. @@ -20,7 +20,7 @@ The basic flow of running a quantum circuit in a blocking manner is Here is a simple example of this flow ```python import cirq -import cirq.ionq as ionq +import cirq_ionq as ionq # A circuit that applies a square root of NOT and then a measurement. qubit = cirq.LineQubit(0) diff --git a/docs/tutorials/ionq/getting_started.ipynb b/docs/tutorials/ionq/getting_started.ipynb index eeec12181b8..a3a2d6fd225 100644 --- a/docs/tutorials/ionq/getting_started.ipynb +++ b/docs/tutorials/ionq/getting_started.ipynb @@ -80,7 +80,7 @@ "outputs": [], "source": [ "import cirq\n", - "import cirq.ionq as ionq" + "import cirq_ionq as ionq" ] }, { @@ -98,7 +98,7 @@ "id": "11b21e6193ae" }, "source": [ - "The main object that you use to access the IonQ API is an instance of the `cirq.ionq.Service` class. To construct this you need an API key. Both should be supplied to partners. Please be careful when using notebooks and version control to not save your API key in a public location!\n", + "The main object that you use to access the IonQ API is an instance of the `cirq_ionq.Service` class. To construct this you need an API key. Both should be supplied to partners. Please be careful when using notebooks and version control to not save your API key in a public location!\n", "\n", "Given these bits of information you get a service object by simply running" ] @@ -251,7 +251,7 @@ "id": "8ac6188f9053" }, "source": [ - "Or if you only have the job id, you can use this to get the job and create a new `cirq.ionq.Job` object to query." + "Or if you only have the job id, you can use this to get the job and create a new `cirq_ionq.Job` object to query." ] }, {