question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`_Pauli{X,Y,Z}` maybe shouldn't be private

See original GitHub issue

Unlike every other gate, with cirq.X, cirq.Y, and cirq.Z, it’s very easy to end up with an instance of a class that is not importable from top-level-cirq

x1 = cirq.X
x2 = cirq.X**0.99
type(x1)
Out[6]: cirq.ops.pauli_gates._PauliX
type(x2)
Out[7]: cirq.ops.common_gates.XPowGate

consider renaming to PauliX and exposing as cirq.PauliX

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mpharrigancommented, Aug 22, 2019

I’d generally push back against any further consolidation into them being gate-like. I’m still not fully convinced that there shouldn’t be two separate things: X-the-gate and X-the-operator. It’s pretty rare to have a case where you want to take one thing and use it both as an operator (Hermitian) and a gate (unitary). In fact, most of the time when you have an X-the-operator, you convert to an associated gate by exp[i t X-the-operator].

The only commonality is the matrix representation, so you’d want to call cirq.unitary(X-the-gate) or cirq.unitary(X-the-operator) and get the same answer; but this also gets confusing in the latter case because you’re not requesting a unitary matrix. You really need a Hermitian matrix.

0reactions
mpharrigancommented, Feb 16, 2021

I think it’s fine that they’re private

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pauli spin matrices are traceless. What does that mean? - Quora
Pauli matrices are the dimensionless versions of spin in the x, y, z directions. ... Technically no, but probably you are thinking of...
Read more >
Pauli matrices - Wikipedia
In mathematical physics and mathematics, the Pauli matrices are a set of three 2 × 2 complex matrices which are Hermitian, involutory and...
Read more >
Pauli - Qiskit
An n -qubit Pauli may be represented by a string consisting of n characters from ['I', 'X', 'Y', 'Z'] , and optionally phase...
Read more >
Gates, States, and Circuits - Gavin E. Crooks
3.1 Pauli gates. The simplest 1-qubit gates are the 4 gates represented by the Pauli operators, I, X, Y, and Z. These operators...
Read more >
Mel Schwartz: The Possibility Principle - Sounds True
That possibility would be maybe I don't have to have fear. ... I want to make sure that I'm loved, and so confronting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found