Skip to content

Merge cirq.Pauli.X and cirq.X into one object (do same for Y and Z) #1041

@Strilanc

Description

@Strilanc

Currently, there is an unnecessary distinction between cirq.Pauli.X (an instance of cirq.Pauli) and cirq.X (an instance of cirq.RotXGate). Some code wants the pauli x, some wants the x rotation. We need to unify these two things into one thing.

I'm not exactly sure how this should be done.

One way would be to introduce a PauliXGate that is the unification of both concepts, and falls back into one or the other as methods are applied (e.g. cirq.X would be a PauliGate but cirq.X**0.5 would again be a RotXGate).

Another way is to destroy the Pauli class and replace it with a type such as Union[cirq.X, cirq.Y, cirq.Z], and all the class methods because just functions that can be applied to that type.

I'm labelling this "good part time project" because I think it's reasonably "meaty" design-wise and amount-of-touched-code-wise. I expect it to require iteration to hit something that works well.

Metadata

Metadata

Assignees

Labels

good part-time projectA meaty non-urgent issue with a substantial amount of work to be done.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions