Skip to content

Stabilizer simulation example utilizing stim backend #211

Closed
@refraction-ray

Description

@refraction-ray

Task description

Add an example python script stabilizer_stim_sim.py in /examples which showcases stabilizer circuit simulation using tc interface with stim backend.

Implementation

The script includes:

  1. Clifford circuit with mid-circuit measurement defined in tc
  2. Transform the circuit object into Stim circuit object with the helper function defined in the same script (input: tc circuit, output: stim circuit)(can utilize c._qir and c._extra_qir, using c.measure_instruction to get the mid circuit measurement recorded in extra_qir and using c.mid_measurement for the real functionality)
  3. Simulate the circuit in stim and extract the stabilizer tableau
  4. Compute the entanglement entropy of the output state with the helper function defined in the same script (input: stabilizer tableau representation, output: entanglement entropy value) (see Ref 3, it would be better to try hard to accelerate this function)
  5. Validate the correctness by directly computing entanglement from tc (mid-circuit measurement results might require to be averaged)

References:

  1. Stabilizer simulator #159
  2. https://github.com/quantumlib/Stim
  3. https://quantumcomputing.stackexchange.com/questions/16718/measuring-entanglement-entropy-using-a-stabilizer-circuit-simulator
  4. https://arxiv.org/abs/quant-ph/0406196

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions