Skip to content

Support for Projectors in Expectation Calculations #357

Open
@MichaelBroughton

Description

@MichaelBroughton

Right now Cirq does not allow such things as:

a = cirq.Z(q0) * cirq.Z(q0) + projector(0111011001)
a.expectation_from_wavefunction(a, ...)

One must manually write out the projection operators like:

a = (1 - cirq.Z(q)) / 2 * (1 + cirq.Z(q2)) / 2 . . .

Storing such a large paulisum can quickly grow to be prohibitive despite the matrix having just one entry in the end and the post-processing step being very simple to implement on a real device. It would be nice if we could have this feature put into Cirq and then relayed up and supported in TFQ. What do people think ? @zaqqwerty .

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions