-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathinstall.md
215 lines (167 loc) · 10.6 KB
/
install.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Install
Choose your operating system:
- [Installing on Linux](#installing-on-linux)
- [Installing on Mac OS X](#installing-on-mac-os-x)
- [Installing on Windows](#installing-on-windows)
If you want to create a development environment, see the [development page](/cirq/dev/development).
---
## Alpha disclaimer
**Cirq is currently in alpha.**
We may change or remove parts of Cirq's API when making new releases.
To be informed of deprecations and breaking changes, subscribe to the
[cirq-announce google group mailing list](https://groups.google.com/forum/#!forum/cirq-announce).
## Python version supprt
Cirq currently supports python 3.7 and later.
We follow numpy's schedule for python version support defined in [NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html),
though we may deviate from that schedule by extending support for older python
versions if they are needed by [Colab](https://colab.research.google.com/)
or internal Google systems.
## Installing on Linux
0. Make sure you have python 3.7.0 or greater.
See [Installing Python 3 on Linux](https://docs.python-guide.org/starting/install3/linux/) @ the hitchhiker's guide to python.
1. Consider using a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).
2. Use `pip` to install `cirq`:
```bash
python -m pip install --upgrade pip
python -m pip install cirq
```
3. (Optional) install other dependencies.
Install dependencies of features in `cirq.contrib`.
```bash
python -m pip install cirq-core[contrib]
```
Install system dependencies that pip can't handle.
```bash
sudo apt-get install texlive-latex-base latexmk
```
- Without `texlive-latex-base` and `latexmk`, pdf writing functionality will not work.
4. Check that it works!
```bash
python -c 'import cirq_google; print(cirq_google.Sycamore)'
# should print:
# (0, 5)───(0, 6)
# │ │
# │ │
# (1, 4)───(1, 5)───(1, 6)───(1, 7)
# │ │ │ │
# │ │ │ │
# (2, 3)───(2, 4)───(2, 5)───(2, 6)───(2, 7)───(2, 8)
# │ │ │ │ │ │
# │ │ │ │ │ │
# (3, 2)───(3, 3)───(3, 4)───(3, 5)───(3, 6)───(3, 7)───(3, 8)───(3, 9)
# │ │ │ │ │ │ │ │
# │ │ │ │ │ │ │ │
# (4, 1)───(4, 2)───(4, 3)───(4, 4)───(4, 5)───(4, 6)───(4, 7)───(4, 8)───(4, 9)
# │ │ │ │ │ │ │ │
# │ │ │ │ │ │ │ │
# (5, 0)───(5, 1)───(5, 2)───(5, 3)───(5, 4)───(5, 5)───(5, 6)───(5, 7)───(5, 8)
# │ │ │ │ │ │ │
# │ │ │ │ │ │ │
# (6, 1)───(6, 2)───(6, 3)───(6, 4)───(6, 5)───(6, 6)───(6, 7)
# │ │ │ │ │
# │ │ │ │ │
# (7, 2)───(7, 3)───(7, 4)───(7, 5)───(7, 6)
# │ │ │
# │ │ │
# (8, 3)───(8, 4)───(8, 5)
# │
# │
# (9, 4)
```
## Installing on Mac OS X
0. Make sure you have python 3.7.0 or greater.
See [Installing Python 3 on Mac OS X](https://docs.python-guide.org/starting/install3/osx/) @ the hitchhiker's guide to python.
1. Consider using a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).
2. Use `pip` to install `cirq`:
```bash
python -m pip install --upgrade pip
python -m pip install cirq
```
3. (Optional) install dependencies of features in `cirq.contrib`.
```bash
python -m pip install cirq-core[contrib]
```
Install system dependencies that pip can't handle.
```bash
brew cask install mactex
```
- Without `mactex`, pdf writing functionality will not work.
4. Check that it works!
```bash
python -c 'import cirq_google; print(cirq_google.Sycamore)'
# should print:
# (0, 5)───(0, 6)
# │ │
# │ │
# (1, 4)───(1, 5)───(1, 6)───(1, 7)
# │ │ │ │
# │ │ │ │
# (2, 3)───(2, 4)───(2, 5)───(2, 6)───(2, 7)───(2, 8)
# │ │ │ │ │ │
# │ │ │ │ │ │
# (3, 2)───(3, 3)───(3, 4)───(3, 5)───(3, 6)───(3, 7)───(3, 8)───(3, 9)
# │ │ │ │ │ │ │ │
# │ │ │ │ │ │ │ │
# (4, 1)───(4, 2)───(4, 3)───(4, 4)───(4, 5)───(4, 6)───(4, 7)───(4, 8)───(4, 9)
# │ │ │ │ │ │ │ │
# │ │ │ │ │ │ │ │
# (5, 0)───(5, 1)───(5, 2)───(5, 3)───(5, 4)───(5, 5)───(5, 6)───(5, 7)───(5, 8)
# │ │ │ │ │ │ │
# │ │ │ │ │ │ │
# (6, 1)───(6, 2)───(6, 3)───(6, 4)───(6, 5)───(6, 6)───(6, 7)
# │ │ │ │ │
# │ │ │ │ │
# (7, 2)───(7, 3)───(7, 4)───(7, 5)───(7, 6)
# │ │ │
# │ │ │
# (8, 3)───(8, 4)───(8, 5)
# │
# │
# (9, 4)
```
## Installing on Windows
0. If you are using the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/about), use the [Linux install instructions](#installing-on-linux) instead of these instructions.
1. Make sure you have python 3.7.0 or greater.
See [Installing Python 3 on Windows](https://docs.python-guide.org/starting/install3/win/) @ the hitchhiker's guide to python.
2. Use `pip` to install `cirq`:
```bash
python -m pip install --upgrade pip
python -m pip install cirq
```
3. (Optional) install dependencies of features in `cirq.contrib`.
```bash
python -m pip install cirq-core[contrib]
```
4. Check that it works!
```bash
python -c "import cirq_google; print(cirq_google.Sycamore)"
# should print:
# (0, 5)───(0, 6)
# │ │
# │ │
# (1, 4)───(1, 5)───(1, 6)───(1, 7)
# │ │ │ │
# │ │ │ │
# (2, 3)───(2, 4)───(2, 5)───(2, 6)───(2, 7)───(2, 8)
# │ │ │ │ │ │
# │ │ │ │ │ │
# (3, 2)───(3, 3)───(3, 4)───(3, 5)───(3, 6)───(3, 7)───(3, 8)───(3, 9)
# │ │ │ │ │ │ │ │
# │ │ │ │ │ │ │ │
# (4, 1)───(4, 2)───(4, 3)───(4, 4)───(4, 5)───(4, 6)───(4, 7)───(4, 8)───(4, 9)
# │ │ │ │ │ │ │ │
# │ │ │ │ │ │ │ │
# (5, 0)───(5, 1)───(5, 2)───(5, 3)───(5, 4)───(5, 5)───(5, 6)───(5, 7)───(5, 8)
# │ │ │ │ │ │ │
# │ │ │ │ │ │ │
# (6, 1)───(6, 2)───(6, 3)───(6, 4)───(6, 5)───(6, 6)───(6, 7)
# │ │ │ │ │
# │ │ │ │ │
# (7, 2)───(7, 3)───(7, 4)───(7, 5)───(7, 6)
# │ │ │
# │ │ │
# (8, 3)───(8, 4)───(8, 5)
# │
# │
# (9, 4)
```