Skip to content

PauliMeasurementGate fails to construct when given an empty observable #6136

Open
@Strilanc

Description

@Strilanc

The following should not raise an exception. It should produce a circuit which, when sampled, samples a=0 and b=1.

import cirq
circuit = cirq.Circuit(
    cirq.PauliMeasurementGate(cirq.DensePauliString(""), key="a").on(),
    cirq.PauliMeasurementGate(-cirq.DensePauliString(""), key="b").on(),
)

Failing to measure the empty pauli string is sort of like failing to search for matches to the empty string. It's a corner case but it should still work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug-reportSomething doesn't seem to work.status/needs-agreed-designWe want to do this, but it needs an agreed upon design before implementationtriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions