Skip to content

Feature/joint measurement#20

Open
Bloooman wants to merge 38 commits into
QuantumSavory:masterfrom
Bloooman:feature/Joint_Measurement
Open

Feature/joint measurement#20
Bloooman wants to merge 38 commits into
QuantumSavory:masterfrom
Bloooman:feature/Joint_Measurement

Conversation

@Bloooman
Copy link
Copy Markdown

@Bloooman Bloooman commented Apr 29, 2026

Edit this message to describe your submission -- delete the instruction content and put in your own.

Please address only one topic or issue per pull request! Many small PRs are much easier to review and merge than one large PR.

If this is your first submission to this organization and you are not a developer known in the Julia ecosystem, do not use LLMs -- we need to trust you first before we trust the LLM under your control.

If you want to submit an unfinished piece of work in order to get comments and discuss, please mark the pull request as a draft and ping the repository maintainer.

Before merging, all changes and new functionality should be marked in the CHANGELOG file, but feel free to just leave your CHANGELOG notes in the PR description, to avoid merge conflicts with other requests modifying that file. The maintainer will add these CHANGELOG notes for you if you do so.

Before considering your pull request ready for review and merging, make sure that all of the following are completed (please keep the clecklist as part of your PR):

  • The code is properly formatted and commented.
  • Substantial new functionality is documented within the docs.
  • All new functionality is tested.
  • All of the automated tests on github pass.
  • We recently started enforcing formatting checks. If formatting issues are reported in the new code you have written, please correct them. There will be plenty of old code that is flagged as we are slowly transitioning to enforced formatting. Please do not worry about or address older formatting issues -- keep your PR just focused on your planned contribution.

If you are submitting for a bug bounty:

If possible, keep your git history not too wild (rebase and squash commits, keep commits small and semantically separated) so that review is easier.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Benchmark Results (Julia v1)

Time benchmarks
master 2417425... master / 2417425...
traversal/combine/10 2.83 ± 0.2 μs 2.85 ± 0.2 μs 0.993 ± 0.098
traversal/combine/100 30.9 ± 1.5 μs 31.3 ± 1.5 μs 0.989 ± 0.067
traversal/combine/1000 0.311 ± 0.013 ms 0.317 ± 0.013 ms 0.983 ± 0.058
traversal/direction/left_100 0.19 ± 0.01 μs 12.2 ± 0.031 μs 0.0156 ± 0.00082
traversal/direction/right_100 0.201 ± 0.02 μs 0.21 ± 0.011 μs 0.957 ± 0.11
traversal/mixed/noop_100 0.16 ± 0.01 μs 0.16 ± 0.001 μs 1 ± 0.063
traversal/mixed/swap_100 0.21 ± 0.02 μs 0.21 ± 0.02 μs 1 ± 0.13
traversal/noop/10 0.06 ± 0 μs 0.06 ± 0 μs 1 ± 0
traversal/noop/100 0.16 ± 0.011 μs 0.16 ± 0.011 μs 1 ± 0.097
traversal/noop/1000 1.18 ± 0.069 μs 1.18 ± 0.021 μs 1 ± 0.061
traversal/swap/10 0.07 ± 0.01 μs 0.07 ± 0.001 μs 1 ± 0.14
traversal/swap/100 0.22 ± 0.011 μs 0.22 ± 0.011 μs 1 ± 0.071
traversal/swap/1000 1.49 ± 0.03 μs 1.49 ± 0.02 μs 1 ± 0.024
time_to_load 2.18 ± 0.0034 s 2.27 ± 0.0091 s 0.961 ± 0.0041
Memory benchmarks
master 2417425... master / 2417425...
traversal/combine/10 0.207 k allocs: 6.75 kB 0.207 k allocs: 6.75 kB 1
traversal/combine/100 2.28 k allocs: 0.0725 MB 2.28 k allocs: 0.0725 MB 1
traversal/combine/1000 23 k allocs: 0.732 MB 23 k allocs: 0.732 MB 1
traversal/direction/left_100 0 allocs: 0 B 0 allocs: 0 B
traversal/direction/right_100 0 allocs: 0 B 0 allocs: 0 B
traversal/mixed/noop_100 0 allocs: 0 B 0 allocs: 0 B
traversal/mixed/swap_100 0 allocs: 0 B 0 allocs: 0 B
traversal/noop/10 0 allocs: 0 B 0 allocs: 0 B
traversal/noop/100 0 allocs: 0 B 0 allocs: 0 B
traversal/noop/1000 1 allocs: 16 B 1 allocs: 16 B 1
traversal/swap/10 0 allocs: 0 B 0 allocs: 0 B
traversal/swap/100 0 allocs: 0 B 0 allocs: 0 B
traversal/swap/1000 1 allocs: 16 B 1 allocs: 16 B 1
time_to_load 0.149 k allocs: 11.1 kB 0.149 k allocs: 11.1 kB 1

Bloooman added 29 commits May 17, 2026 21:40
…urn in get_measurement_result to a tuple contain result and anticommute stabilizer
…measure the first measurement in current circuit and update CompState
@Bloooman Bloooman force-pushed the feature/Joint_Measurement branch from 6a2dd2f to ff137ba Compare May 18, 2026 01:40
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 39.78495% with 224 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.35%. Comparing base (b0be3fc) to head (2417425).

Files with missing lines Patch % Lines
src/PBCCompiler.jl 32.20% 80 Missing ⚠️
src/joint_measurement_check.jl 0.00% 63 Missing ⚠️
src/Random_Circuit.jl 0.00% 30 Missing ⚠️
src/preprocess.jl 55.00% 27 Missing ⚠️
src/pair_transformation.jl 76.00% 24 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master      #20       +/-   ##
===========================================
- Coverage   78.26%   55.35%   -22.92%     
===========================================
  Files           4        8        +4     
  Lines         184      542      +358     
===========================================
+ Hits          144      300      +156     
- Misses         40      242      +202     

☔ 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.

Comment thread src/joint_measurement_check.jl Outdated
0x00 denotes +1 eigenvalue, 0x02 denotes -1 eigenvalue
0 denotes +1 eigenvalue, 1 denotes -1 eigenvalue
false denotes +1 eigenvalue, true denotes -1 eigenvalue
"""
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.

should be comment

Comment on lines +30 to +33
"""
Perform Joint Measurement on CircuitOp if it's a CircuitOp.Measurement
Store results as corresponding measurement type: classical_random_result, classical_deterministic_result, quantum_result
"""
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.

needs a better docstring

Comment thread src/joint_measurement_check.jl Outdated
Perform Joint Measurement on CircuitOp if it's a CircuitOp.Measurement
Store results as corresponding measurement type: classical_random_result, classical_deterministic_result, quantum_result
"""
function get_measurement_result(s::Stabilizer, op::CircuitOp.Type, num_qubits::Int)
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.

why is num_qubits an argument -- isn't it known in one of the other arguments

Comment thread src/joint_measurement_check.jl Outdated
end

function quantum_measurement(op::CircuitOp.Type)
print("Enter quantum measurement result: ")
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.

logs, not prints, and probably not even logs anyway

Comment thread src/PBCCompiler.jl Outdated

"""TODO docstring"""
"""Struct that contains information describing current quantum state"""
struct test_MemoryState
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.

memory state should hold a clear distinction between "classical memory" and "quantum memory".

  • have stabilizer refer only to pauli_qubits and always have nqubits(stabilizer)==length(pauli_qubits)
  • have magic_qubits only refer to qubits that are in a very specific magic state (or is that it?)
  • have all three of these datafields updated on each iteration -- magic qubit might become a pauli qubit or it might just be neither a pauli qubit nor a magic qubit

Comment thread src/joint_measurement_check.jl Outdated
end

"""Resolve conditional circuit operations defined by CircuitOp.BitConditional"""
function resolve_conditionals(compstate::ComputerState)
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.

this should probably be structured in terms of a traversal/kernel/filter

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