Skip to content

More noise: measurement error, T1 T2 relaxation error #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

xoth42
Copy link
Collaborator

@xoth42 xoth42 commented Jun 9, 2025

Summary

This adds Measurement error and T1,T2 noise if asked for in optimizer config. The example scripts have been updated to include these errors as well as the pluto UI. An example of the T1T2 noise insertion is at test/view_T1T2_insertion.jl. Visualization of T1T2 noise with Quantikz requires an edit to the BPGates repo, which is done at https://github.com/xoth42/BPGates.jl. I will attach a large example at the bottom of before/after adding T1T2 noise to check if the logic holds up for larger circuits.

Changes

  • Add MeasurementError and T1T2Noise to examples (optimize.jl, no_plot_optimize.jl, pluto.jl)
  • T1T2 imports and exports, and MeasurementError export (src/QEPOptimize.jl)
  • noises.jl: MeasurementError, T1T2Noise noise structs and functions to apply them when calling noisify_circuit/noisify
  • noises.jl: T1T2 noise depends on 'op_time(op)' to get the gate time used in calculating error rates. Set placeholder values of 1.0 for most gates. The units are unspecified but are most likely in seconds. Also depends on 'is_only_noise(op)' to determine whether or not T1T2 errors should be placed between certain ops. Finally, the algorithm uses 'affectedqubits(op)' to find which qubits are being acted on when scheduling. This is essentially the same as how it is done in Quantikz.
  • Tests for the new noise methods: test/test_noise.jl

Example to check T1T2 logic:

Circuit before: QuantumClifford.AbstractOperation[CNOTPerm(2, 1, 2, 4), CNOTPerm(3, 5, 1, 2), CNOTPerm(5, 6, 2, 4), CNOTPerm(2, 4, 3, 1), CNOTPerm(5, 4, 3, 2), CNOTPerm(1, 3, 2, 3), CNOTPerm(2, 3, 4, 2), CNOTPerm(2, 1, 4, 1), BellMeasure(1, 1), CNOTPerm(5, 1, 3, 2)]

QC_Large_before

Circuit after inserting T1T2 noise: Any[CNOTPerm(2, 1, 2, 4), T1NoiseOp(1, 0.6321205588285577), T2NoiseOp(1, 0.6321205588285577), CNOTPerm(3, 5, 1, 2), T1NoiseOp(4, 0.6321205588285577), T2NoiseOp(4, 0.6321205588285577), CNOTPerm(5, 6, 2, 4), T1NoiseOp(3, 0.8646647167633873), T2NoiseOp(3, 0.8646647167633873), CNOTPerm(2, 4, 3, 1), CNOTPerm(5, 4, 3, 2), CNOTPerm(1, 3, 2, 3), T1NoiseOp(4, 0.8646647167633873), T2NoiseOp(4, 0.8646647167633873), CNOTPerm(2, 3, 4, 2), T1NoiseOp(1, 0.950212931632136), T2NoiseOp(1, 0.950212931632136), CNOTPerm(
2, 1, 4, 1), BellMeasure(1, 1), T1NoiseOp(3, 0.6321205588285577), T2NoiseOp(3, 0.6321205588285577), CNOTPerm(5, 1, 3, 2), T1NoiseOp(2, 0.6321205588285577), T2NoiseOp(2, 0.6321205588285577), T1NoiseOp(3, 0.6321205588285577), T2NoiseOp(3, 0.6321205588285577), T1NoiseOp(4, 0.6321205588285577), T2NoiseOp(4, 0.6321205588285577)]

QC_Large_after

P.S. I will squash commits when completing the pull request.

xoth42 and others added 6 commits June 5, 2025 18:19
… "test/view_T1T2_insertion.jl" which needs a small BPGates change to run
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 9 to 10.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](dawidd6/action-download-artifact@v9...v10)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
* pluto ui draft

* Pluto ui and sliders for optimization

* minor changes to what is shown by default

---------

Co-authored-by: Stefan Krastanov <[email protected]>
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

Attention: Patch coverage is 83.92857% with 9 lines in your changes missing coverage. Please review.

Project coverage is 49.14%. Comparing base (254b05a) to head (cbc669d).

Files with missing lines Patch % Lines
src/noises.jl 83.92% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
+ Coverage   45.01%   49.14%   +4.13%     
==========================================
  Files           7        7              
  Lines         471      527      +56     
==========================================
+ Hits          212      259      +47     
- Misses        259      268       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant