Skip to content

Commit 4ebe5ea

Browse files
authored
Merge branch 'master' into mh-fix-403
2 parents 5fa047b + 83e16ec commit 4ebe5ea

File tree

9 files changed

+133
-18
lines changed

9 files changed

+133
-18
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Bug report
2+
description: Report a problem with this software or project
3+
type: Bug
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out this bug report!
9+
10+
- type: textarea
11+
attributes:
12+
label: Describe the issue
13+
description: >-
14+
Please explain clearly and in detail what the issue is. What led up
15+
to it, or how did you encounter it?
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
attributes:
21+
label: How can the issue be reproduced?
22+
description: >-
23+
Explain in a step-by-step fashion what someone else would need to
24+
do in order to reproduce the issue. If possible, include literal
25+
examples of commands or code using [Markdown fenced code
26+
blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks).
27+
For long output, paste the text into [collapsed
28+
sections](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections)
29+
or attach text files.
30+
validations:
31+
required: false
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Feature request
2+
description: Request a new feature or change
3+
type: Enhancement
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out this feature request form!
9+
10+
- type: textarea
11+
attributes:
12+
label: Is your feature request related to a use case or problem?
13+
description: >-
14+
Please tell us the context of your request. Is it to help you do
15+
something that you currently cannot due to limitations in the software,
16+
or is it an idea for an enhancement or new functionality, or something
17+
else?
18+
validations:
19+
required: true
20+
21+
- type: textarea
22+
attributes:
23+
label: What solution or approach do you envision?
24+
description: >-
25+
If you have ideas or preferences for the solution, you can let us know
26+
here. If you are aware of other similar or related work, please let us
27+
know about it here.
28+
validations:
29+
required: false
30+
31+
- type: dropdown
32+
attributes:
33+
label: How urgent is this for you?
34+
description: >-
35+
Please choose from among the following options. If the lack of this
36+
feature is blocking important work, please choose from among P0–P2.
37+
options:
38+
- P0 – needed no later than a week
39+
- P1 – needed by the next release
40+
- P2 – needed within two quarters
41+
- P3 – not blocked; it's an idea
42+
validations:
43+
required: false

.github/ISSUE_TEMPLATE/3-task.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Task
2+
description: Describe a task that needs to be done
3+
type: Task
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thank you for taking the time to fill out this feature request form!
9+
10+
- type: textarea
11+
attributes:
12+
label: What is the task?
13+
validations:
14+
required: true
15+
16+
- type: textarea
17+
attributes:
18+
label: (Optional) Do you have ideas or preferences for the approach?
19+
validations:
20+
required: false
21+
22+
- type: dropdown
23+
attributes:
24+
label: How urgent is this for you?
25+
description: >-
26+
Please choose from among the following options. If the lack of this
27+
feature is blocking important work, please choose from among P0–P2.
28+
options:
29+
- P0 – needed no later than a week
30+
- P1 – needed by the next release
31+
- P2 – needed within two quarters
32+
- P3 – not blocked; it's an idea
33+
validations:
34+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true

.github/SECURITY.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
# Reporting security issues
22

3-
The ReCirq developers and community take security bugs in ReCirq seriously.
4-
We appreciate your efforts to responsibly disclose your findings, and will make
5-
every effort to acknowledge your contributions.
3+
This project's developers and community are committed to addressing security
4+
bugs promptly and effectively. We appreciate your efforts to disclose your
5+
findings responsibly, and will make every effort to acknowledge your
6+
contributions.
67

78
Please **do not** use GitHub issues to report security vulnerabilities; GitHub
89
issues are public, and doing so could allow someone to exploit the information
9-
before the problem can be addressed. Instead, please use the GitHub ["Report
10-
a Vulnerability"](https://github.com/quantumlib/recirq/security/advisories/new)
11-
interface from the _Security_ tab of the ReCirq repository.
10+
before the problem can be addressed. Instead, please use the *Report a
11+
vulnerability* interface from the *Security* tab at the top of this GitHub
12+
repository page.
13+
14+
<div align="center">
15+
<img width="75%" alt="Location of the report button on the repository page"
16+
src="/.github/report-vulnerability-button.png">
17+
</div>
1218

1319
Please report security issues in third-party modules to the person or team
14-
maintaining the module rather than the project stewards, unless you
15-
believe that some action needs to be taken with ReCirq in order to guard
16-
against the effects of a security vulnerability in a third-party module.
20+
maintaining the module rather than this project's stewards, unless you believe
21+
that some action needs to be taken specifically with this project in order to
22+
guard against the effects of a security vulnerability in third-party software.
1723

1824
## Responses to security reports
1925

@@ -27,4 +33,4 @@ announcement, and may ask for additional information or guidance.
2733
Please contact the project stewards at Google Quantum AI via email at
2834
[email protected] if you have questions or other concerns. If
2935
for any reason you are uncomfortable reaching out to the project stewards,
30-
please email [email protected].
36+
please email [email protected] instead.
37.5 KB
Loading

docs/guide/data_analysis.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
" all_bitstrings = [ba.bits for ba in record['all_bitstrings']]\n",
176176
" \n",
177177
" # Compute <Z>\n",
178-
" record['z_vals'] = [np.mean((-1)**bitstrings, axis=0).item() for bitstrings in all_bitstrings]\n",
178+
" record['z_vals'] = [np.mean((-1)**bitstrings.astype(np.int8), axis=0).item() for bitstrings in all_bitstrings]\n",
179179
" \n",
180180
" # Don't need to carry around the full array of bits anymore\n",
181181
" del record['all_bitstrings']\n",

recirq/cluster_state_mipt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The circuit is constructed on a 6x6 grid of qubits. Let $L$ be the system linear
3939

4040
After these steps, projective measurement in the $Z$ basis is performed on the preparation qubits (solid red in the figure below) to prepare the probe qubits' states (solid green). Shadow measurements are then performed on the probe qubits using the $X$, $Y$, and $Z$ bases with equal probability to collect data.
4141

42-
The nearest-neighbor gate $e^{i(\pi/4)\sum_{\langle j,k \rangle} Z_j Z_k}$ is implemented by first applying a controlled-$Z$ ($\mathrm{CZ}$) gate between each pair of qubits, followed by local $Z^{-1/2}$ on both qubits, i.e., $\mathrm{CZ}_{jk}Z_j^{-1/2}Z_k^{-1/2}$. All nearest-neighbor two-qubit gates are applied in the following sequence to maintain constant circuit depth as the system size scales up: first, odd horizontal links; then, even horizontal links; followed by odd vertical links and finally even vertical links.
42+
The nearest-neighbor gate $e^{i(\pi/4)\sum_{\langle j,k \rangle} Z_j Z_k}$ is implemented by first applying a controlled-$Z$ ($\mathrm{CZ}$) gate between each pair of qubits, followed by local $Z^{-1/2}$ on both qubits, i.e., $Z_j^{-1/2}Z_k^{-1/2}\mathrm{CZ}_{jk}$. All nearest-neighbor two-qubit gates are applied in the following sequence to maintain constant circuit depth as the system size scales up: first, odd horizontal links; then, even horizontal links; followed by odd vertical links and finally even vertical links.
4343

4444
![Experimental realization of the circuit on quantum chip with 6x6 lattice at d=5.](grid_d=5.png)
4545

recirq/hfvqe/analysis.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def compute_opdm(
9292

9393
variance_dict['xy_even'][circuit_idx] = even_cov_mat
9494
w, _ = np.linalg.eigh(even_cov_mat * len(data[q0_a]))
95-
if not np.alltrue(w >= 0):
95+
if not np.all(w >= 0):
9696
raise ValueError(
9797
"covariance matrix for xy_even:{} not postiive semidefinite"
9898
.format(circuit_idx))
@@ -111,11 +111,11 @@ def compute_opdm(
111111

112112
variance_dict['xy_odd'][circuit_idx] = odd_cov_mat
113113
w, _ = np.linalg.eigh(odd_cov_mat * len(data[q0_a]))
114-
if not np.alltrue(w >= 0):
114+
if not np.all(w >= 0):
115115
raise ValueError(
116116
"covariance matrix for xy_odd:{} not postiive semidefinite".
117117
format(circuit_idx))
118-
assert np.alltrue(w >= 0)
118+
assert np.all(w >= 0)
119119

120120
if circuit_idx == 0: # No re-ordering
121121
for qubit_idx, q in enumerate(qubits):
@@ -168,7 +168,7 @@ def cov_func(i, j, p, q):
168168
cov_func(j, i, p, q) + cov_func(j, i, q, p))
169169

170170
w, _ = np.linalg.eigh(even_cov_mat)
171-
if not np.alltrue(w >= 0):
171+
if not np.all(w >= 0):
172172
raise ValueError(
173173
"covariance matrix for xy_even:{} not postiive semidefinite".
174174
format(circuit_idx))
@@ -183,7 +183,7 @@ def cov_func(i, j, p, q):
183183
cov_func(i, j, p, q) + cov_func(i, j, q, p) +
184184
cov_func(j, i, p, q) + cov_func(j, i, q, p))
185185
w, _ = np.linalg.eigh(odd_cov_mat)
186-
if not np.alltrue(w >= 0):
186+
if not np.all(w >= 0):
187187
raise ValueError(
188188
"covariance matrix for xy_odd:{} not postiive semidefinite".
189189
format(circuit_idx))
@@ -196,7 +196,7 @@ def cov_func(i, j, p, q):
196196
for cidx, p in enumerate(range(num_qubits)):
197197
z_cov_mat[ridx, cidx] = cov_func(i, i, p, p)
198198
w, _ = np.linalg.eigh(z_cov_mat)
199-
if not np.alltrue(w >= -1.0E-15):
199+
if not np.all(w >= -1.0E-15):
200200
raise ValueError(
201201
"covariance matrix for z:{} not postiive semidefinite".
202202
format(circuit_idx))

0 commit comments

Comments
 (0)