Skip to content

Magnets: modified Trotter expansion classes and added Cirq output.#3040

Merged
brad-lackey merged 2 commits intofeature/qrefrom
brlackey/refactor-trotter
Mar 23, 2026
Merged

Magnets: modified Trotter expansion classes and added Cirq output.#3040
brad-lackey merged 2 commits intofeature/qrefrom
brlackey/refactor-trotter

Conversation

@brad-lackey
Copy link
Copy Markdown

New features for Trotter expansions.

  • Main class is now TrotterExpansion.
  • TrotterStep represents a single Trotter step.
  • TrotterExpansion accepts a function the creates the target type of Trotter step.
  • Minor changes to the Model class and PauliString class to support changes.
  • Added cirq.Circuit output to TrotterStep instances.
  • Added cirq.CircuitOperation output to TrotterExpansion instances.
  • Updated unit tests.

},
)
oper = cirq.PauliStringPhasor(
pauli, exponent_neg=time / 3.141592653589793
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to replace constant with math.pi.

"""Iterate over ``(time, term_index)`` entries for this step."""
return iter(self.terms)

def cirq(self, model: Model) -> cirq.Circuit:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there simulation tests for the circuit to make sure all the arguments to PauliStringPhasor are correct (signs and factors).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a separate Jupyter notebook I use for testing. The Cirq "PauliStringPhasor" does use the correct angles after normalizing it appropriately (hence the pi). This implementation does introduce a global phase.

@brad-lackey brad-lackey merged commit 5de8ec1 into feature/qre Mar 23, 2026
9 checks passed
@brad-lackey brad-lackey deleted the brlackey/refactor-trotter branch March 23, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants