Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updat with latest version #1

Merged
merged 19 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
eddb2d9
Add caching to `value_equality_values` decorator for auto generated m…
tanujkhattar Sep 6, 2023
e235642
Variable spacing QROM should depend upon structure of different data …
tanujkhattar Sep 6, 2023
6fae409
Delete `SelectionRegisters` and replace uses of Registers with `Tuple…
tanujkhattar Sep 6, 2023
deedb45
Changed FakeQuantumRunStream to support arbitrary response and except…
verult Sep 8, 2023
6c14cfa
StreamManager: Add mechanism to close the request iterator (#6263)
verult Sep 11, 2023
cf005c2
add to ionq code owners (#6273)
splch Sep 13, 2023
432d57a
Add serialization support for InsertionNoiseModel (#6282)
suyashdamle Sep 14, 2023
f715527
Fix documentation of FSimGate (#6288)
bramathon Sep 15, 2023
b630298
Fix matplotlib typing (#6290)
dstrain115 Sep 18, 2023
1366494
Apply minor doc fixes (#6289)
dstrain115 Sep 18, 2023
d805d82
Make InternalGate hashable if all gate args are hashable (#6294)
maffoo Sep 19, 2023
907ec3a
Try to make docstring render correctly (#6283)
eliottrosenberg Sep 20, 2023
188bb94
Add registry sweep documentation to cirq_google (#6291)
dstrain115 Sep 20, 2023
8e4e7d1
Add bitsize field to Cirq-FT Registers (#6286)
tanujkhattar Sep 20, 2023
acbc624
Do not allow creating registers with bitsize 0 (#6298)
tanujkhattar Sep 25, 2023
61d9671
Fix stream_manager_test type warnings (#6299)
verult Sep 25, 2023
c696323
Rename `cirq_ft.Registers` to `cirq_ft.Signature` to match data types…
tanujkhattar Sep 25, 2023
1948e73
Change signature of `cirq_ft.And` gate to use directional registers l…
tanujkhattar Sep 26, 2023
fd18da5
Make `OpIdentifier` serializable for all inputs (#6295)
epelaaez Sep 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply minor doc fixes (quantumlib#6289)
- quirk_url_to_circuit and quirk_json_to_circuit had weird
HTML in them.
- concat_ragged had a bunch of pre tags in the output.

I believe these changes fix the markdown generation.
  • Loading branch information
dstrain115 authored Sep 18, 2023
commit 13664940f44e1bee9be3bb5129046f1a951c8be9
16 changes: 8 additions & 8 deletions cirq-core/cirq/circuits/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1465,14 +1465,14 @@ def concat_ragged(

Beware that this method is *not* associative. For example:

>>> a, b = cirq.LineQubit.range(2)
>>> A = cirq.Circuit(cirq.H(a))
>>> B = cirq.Circuit(cirq.H(b))
>>> f = cirq.Circuit.concat_ragged
>>> f(f(A, B), A) == f(A, f(B, A))
False
>>> len(f(f(f(A, B), A), B)) == len(f(f(A, f(B, A)), B))
False
>>> a, b = cirq.LineQubit.range(2)
>>> A = cirq.Circuit(cirq.H(a))
>>> B = cirq.Circuit(cirq.H(b))
>>> f = cirq.Circuit.concat_ragged
>>> f(f(A, B), A) == f(A, f(B, A))
False
>>> len(f(f(f(A, B), A), B)) == len(f(f(A, f(B, A)), B))
False

Args:
*circuits: The circuits to concatenate.
Expand Down
78 changes: 40 additions & 38 deletions cirq-core/cirq/interop/quirk/url_to_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,39 +77,40 @@ def quirk_url_to_circuit(
a billion laughs attack in the form of nested custom gates.

Examples:
>>> print(cirq.quirk_url_to_circuit(
... 'http://algassert.com/quirk#circuit={"cols":[["H"],["•","X"]]}'
... ))
0: ───H───@───
1: ───────X───

>>> print(cirq.quirk_url_to_circuit(
... 'http://algassert.com/quirk#circuit={"cols":[["H"],["•","X"]]}',
... qubits=[cirq.NamedQubit('Alice'), cirq.NamedQubit('Bob')]
... ))
Alice: ───H───@───
Bob: ─────────X───

>>> print(cirq.quirk_url_to_circuit(
... 'http://algassert.com/quirk#circuit={"cols":[["iswap"]]}',
... extra_cell_makers={'iswap': cirq.ISWAP}))
0: ───iSwap───
1: ───iSwap───

>>> print(cirq.quirk_url_to_circuit(
... 'http://algassert.com/quirk#circuit={"cols":[["iswap"]]}',
... extra_cell_makers=[
... cirq.interop.quirk.cells.CellMaker(
... identifier='iswap',
... size=2,
... maker=lambda args: cirq.ISWAP(*args.qubits))
... ]))
0: ───iSwap───

>>> print(cirq.quirk_url_to_circuit(
... 'http://algassert.com/quirk#circuit={"cols":[["H"],["•","X"]]}'
... ))
0: ───H───@───
1: ───iSwap───
1: ───────X───

>>> print(cirq.quirk_url_to_circuit(
... 'http://algassert.com/quirk#circuit={"cols":[["H"],["•","X"]]}',
... qubits=[cirq.NamedQubit('Alice'), cirq.NamedQubit('Bob')]
... ))
Alice: ───H───@───
Bob: ─────────X───

>>> print(cirq.quirk_url_to_circuit(
... 'http://algassert.com/quirk#circuit={"cols":[["iswap"]]}',
... extra_cell_makers={'iswap': cirq.ISWAP}))
0: ───iSwap───
1: ───iSwap───

>>> print(cirq.quirk_url_to_circuit(
... 'http://algassert.com/quirk#circuit={"cols":[["iswap"]]}',
... extra_cell_makers=[
... cirq.interop.quirk.cells.CellMaker(
... identifier='iswap',
... size=2,
... maker=lambda args: cirq.ISWAP(*args.qubits))
... ]))
0: ───iSwap───
1: ───iSwap───

Returns:
The parsed circuit.
Expand Down Expand Up @@ -172,12 +173,13 @@ def quirk_json_to_circuit(
a billion laughs attack in the form of nested custom gates.

Examples:
>>> print(cirq.quirk_json_to_circuit(
... {"cols":[["H"], ["•", "X"]]}
... ))
0: ───H───@───
1: ───────X───

>>> print(cirq.quirk_json_to_circuit(
... {"cols":[["H"], ["•", "X"]]}
... ))
0: ───H───@───
1: ───────X───

Returns:
The parsed circuit.
Expand Down
15 changes: 9 additions & 6 deletions cirq-core/cirq/protocols/apply_channel_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ class ApplyChannelArgs:
r"""Arguments for efficiently performing a channel.

A channel performs the mapping
$$
X \rightarrow \sum_i A_i X A_i^\dagger
$$

$$
X \rightarrow \sum_i A_i X A_i^\dagger
$$

for operators $A_i$ that satisfy the normalization condition
$$
\sum_i A_i^\dagger A_i = I.
$$

$$
\sum_i A_i^\dagger A_i = I.
$$

The receiving object is expected to mutate `target_tensor` so that it
contains the density matrix after multiplication, and then return
Expand Down