Skip to content

Commit

Permalink
Updated cirq.ionq to cirq_ionq throughout (#5496)
Browse files Browse the repository at this point in the history
Fixes out-of-date documentation. The correct import throughout is now `import cirq_ionq` rather than `import cirq.ionq`.
  • Loading branch information
dwiddows authored Jun 13, 2022
1 parent 75794cb commit 8539ad0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions docs/ionq/access.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
```
Expand All @@ -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()
```
Expand Down
6 changes: 3 additions & 3 deletions docs/ionq/calibrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions docs/ionq/circuits.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions docs/ionq/jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/ionq/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ 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.

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)
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/ionq/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"outputs": [],
"source": [
"import cirq\n",
"import cirq.ionq as ionq"
"import cirq_ionq as ionq"
]
},
{
Expand All @@ -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"
]
Expand Down Expand Up @@ -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."
]
},
{
Expand Down

0 comments on commit 8539ad0

Please sign in to comment.