0

I have just installed Qiskit, Qutip, and Cirq in my Anaconda Enviornment. When I tried to run the test program:

import cirq
from cirq import *
print(cirq.google.Foxtail)
# should print:
# (0, 0)───(0, 1)───(0, 2)───(0, 3)───(0, 4)───(0, 5)───(0, 6)───(0, 7)───(0, 8)───(0, 9)───(0, 10)
# │        │        │        │        │        │        │        │        │        │        │
# │        │        │        │        │        │        │        │        │        │        │
# (1, 0)───(1, 1)───(1, 2)───(1, 3)───(1, 4)───(1, 5)───(1, 6)───(1, 7)───(1, 8)───(1, 9)───(1, 10)

But it's giving this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [2], in <cell line: 4>()
      1 import cirq
      2 from cirq import *
      ----> 4 print(cirq.google.Foxtail)
  AttributeError: module 'cirq' has no attribute 'google'

I am new to this field. Please Help.

Junye Huang
  • 662
  • 6
  • 16

1 Answers1

1

Cirq was modularized last year. cirq.google is now moved to its own module, cirq_google, try that.

import cirq_google
print(cirq_google.Foxtail)

If that's not working make sure the cirq-google pip package is installed.

Balint Pato
  • 971
  • 5
  • 13
  • 1
    Hey I successfully Installed cirq_google, but now it's saying- AttributeError: module 'cirq_google' has no attribute 'Foxtail' – DevilKillerAG Aug 06 '22 at 14:06
  • Can you try uninstalling all the cirq modules, í.e cirq, cirq-core, etc and then reinstalling? Sometimes, when you update on top of an old (pre modularization) cirq, it can cause this issue. – Balint Pato Aug 07 '22 at 10:38