Skip to content

Create a gate to represent a PauliRotation #6598

Description

@NoureldinYosri

Is your feature request related to a use case or problem? Please describe.
The operation $e^{i \theta P}$ where $P$ is a pauli string, appears a lot in discussions around rotations and magic states. Cirq has a a general way for representing exponentials of pauli strings $e^{i \theta \sum_k P_k}$ called PauliSumExponential however the pauli strings are stored as sparse strings (i.e. dropping identitiy operations) which results in the wrong unitary.

Example P=XI $\theta = \frac{\pi}{4}$ correct unitary should be

$$ \frac{1}{\sqrt{2}} (I_4 + i X \otimes I_2) $$

but cirq gives

>>> cirq.unitary(cirq.PauliSumExponential(cirq.DensePauliString('XI')(*cirq.LineQubit.range(2)), exponent=np.pi/4))
array([[0.70710678+0.j        , 0.        +0.70710678j],
       [0.        +0.70710678j, 0.70710678+0.j        ]])

Describe the solution you'd like
ideally a fix to the PauliSumExponential operation or a new gate for representing the exponential of one pauli string

What is the urgency from your perspective for this issue? Is it blocking important work?
P2 - we should do it in the next couple of quarters

Metadata

Metadata

Assignees

Labels

area/gatesgood for learningFor beginners in QC, this will help picking up some knowledge. Bit harder than "good first issues"help wantedContributors welcomekind/feature-requestDescribes new functionalitypriority/after-1.7Leave for after the Cirq 1.7 releasepriority/p3Should be done in the next 6 monthstriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked on

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions