Skip to content
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

Faster projective measurements #7

Open
Krastanov opened this issue Mar 21, 2022 · 1 comment
Open

Faster projective measurements #7

Krastanov opened this issue Mar 21, 2022 · 1 comment

Comments

@Krastanov
Copy link

Up until 0.4.1 QuantumClifford had only a general purpose project! that assumed the projection would be on a multi-qubit Pauli string. That is unnecessary slow when measuring a single qubit. In 0.4.1 new special purpose projection functions were implemented https://github.com/Krastanov/QuantumClifford.jl/blob/v0.4.1/src/project_trace_reset.jl#L612

Before/After benchmarks for an X measurement on 100 qubits:

BenchmarkTools.Trial: 10000 samples with 1 evaluation.
 Range (min … max):  11.882 μs …  35.537 μs  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     12.393 μs               ┊ GC (median):    0.00%
 Time  (mean ± σ):   12.533 μs ± 990.018 ns  ┊ GC (mean ± σ):  0.00% ± 0.00%

    ▄█▆▆▆█▇▆▅▂▂▁
  ▂▇████████████▇▆▅▅▄▄▃▃▃▃▂▃▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▂▂ ▄
  11.9 μs         Histogram: frequency by time         15.5 μs <

 Memory estimate: 14.53 KiB, allocs estimate: 411.

BenchmarkTools.Trial: 10000 samples with 1 evaluation.
 Range (min … max):  6.472 μs …  5.871 ms  ┊ GC (min … max):  0.00% … 99.25%
 Time  (median):     6.843 μs              ┊ GC (median):     0.00%
 Time  (mean ± σ):   8.195 μs ± 81.956 μs  ┊ GC (mean ± σ):  14.05% ±  1.40%

   █▆▄▅▅▁
  ▄██████▅▄▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▂
  6.47 μs        Histogram: frequency by time        11.7 μs <

 Memory estimate: 9.75 KiB, allocs estimate: 207.

This semi-related issue for a separate "circuit-like" interface might be of interest too: QuantumSavory/QuantumClifford.jl#24

@ChenZhao44
Copy link
Member

Thanks for the issue! I will update it soon.

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

No branches or pull requests

2 participants