I'm just ttrying to run the simple example code in Google's Cirq startup page: https://cirq.readthedocs.io/en/stable/google/engine.html

I think I have the access authorized correctly via Google's Console, but can someone help me understand where I would find the information for the PROCESSOR_ID? Thanks.

Code cut/paste from their webpage here:

import cirq
import cirq.google as cg

# A simple sample circuit
qubit = cirq.GridQubit(5, 2)
circuit = cirq.Circuit(
    cirq.X(qubit)**0.5,                 # Square root of NOT.
    cirq.measure(qubit, key='result')   # Measurement.

# Create an Engine object to use.
# Replace YOUR_PROJECT_ID with the id from your cloud project.
engine = cg.Engine(project_id=YOUR_PROJECT_ID, proto_version=cg.ProtoVersion.V2)

# Create a sampler from the engine
sampler = engine.sampler(processor_id='PROCESSOR_ID', gate_set=cg.SYC_GATESET)

# This will run the circuit and return the results in a 'TrialResult'
results = sampler.run(circuit, repetitions=1000)

# Sampler results can be accessed several ways

# For instance, to see the histogram of results

# Or the data itself

2 Answers 2


There is a method list_processors on the engine object that will return a list of processor objects which include a processor id:

for p in engine.list_processors():

That being said, as mentioned in the cirq docs you linked, Google's quantum computing service isn't publicly available yet. So the most likely result of running that code is an access error, or an empty list (meaning you have access to no processors). If you want to watch someone using the service (plus some neat hardware build stuff) you can watch the second half of the "Google's Quantum Computing Service" presentation at the 2020 quantum summer symposium.

  • $\begingroup$ Thanks for that info. I swear I looked up and down that document to get clarity on whether it was available but couldn't find it. Hoping they open it up soon. $\endgroup$
    – cere
    Sep 12, 2020 at 18:23

Do you have access specifically given by Google? See the second paragraph in the link you sent:

Note that the Quantum Engine API is not yet open for public access.

Likely their chips are only being used for internal testing now, and the docs are being prepped for public release / public chip access.

  • $\begingroup$ Thanks. I swear I looked for this everywhere but could not find it. Any guesses on when this will ever be open to the public? $\endgroup$
    – cere
    Dec 21, 2020 at 10:38
  • $\begingroup$ I'm guessing somewhat soon? Maybe a better question for our Google friends on the SE, but AWS/Azure have their comparables up. And, it seems like they have opened the device to approved projects + made a simulator on gcp (quantumai.google/software) $\endgroup$
    – C. Kang
    Dec 21, 2020 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.