Call cirq.testing.assert_equivalent_repr for cirq.SingleQubitCliffordGate and cirq.CliffordTableau#5664
Merged
CirqBot merged 13 commits intoquantumlib:masterfrom Jul 7, 2022
Merged
Conversation
viathor
reviewed
Jul 6, 2022
viathor
approved these changes
Jul 7, 2022
| assert splitted_represent_string[n] == expected_string | ||
|
|
||
|
|
||
| def test_tableau_ivalid_initial_state(): |
| else: | ||
| raise ValueError( | ||
| f"The value you passed for rs is not the correct shape and/or type. " | ||
| f"Please confirm that it's 1 row, of even length and of type bool." |
Collaborator
There was a problem hiding this comment.
It isn't enough for the length to be even. It actually needs to be twice the number of qubits. Suggestion:
f"Please ensure that it's a single row with two bool entries per qubit."(The message in your other exception, raised on line 197, already reflects this.)
rht
pushed a commit
to rht/Cirq
that referenced
this pull request
May 1, 2023
…ordGate` and `cirq.CliffordTableau` (quantumlib#5664) `cirq.CliffordTableau` is represented by `rs`, `xs` and `zs` yet these can't be passed into the `__init__` but are instead calculated and/or set in the class. This PR adds `xs`, `xs`, and `zs` as `Optional` arguments so that the `CliffordTableau` can be reconstructed from the `__repr__`. Fixes: quantumlib#5641
harry-phasecraft
pushed a commit
to PhaseCraft/Cirq
that referenced
this pull request
Oct 31, 2024
…ordGate` and `cirq.CliffordTableau` (quantumlib#5664) `cirq.CliffordTableau` is represented by `rs`, `xs` and `zs` yet these can't be passed into the `__init__` but are instead calculated and/or set in the class. This PR adds `xs`, `xs`, and `zs` as `Optional` arguments so that the `CliffordTableau` can be reconstructed from the `__repr__`. Fixes: quantumlib#5641
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cirq.CliffordTableauis represented byrs,xsandzsyet these can't be passed into the__init__but are instead calculated and/or set in the class. This PR addsxs,xs, andzsasOptionalarguments so that theCliffordTableaucan be reconstructed from the__repr__.Fixes: #5641