Repository navigation
fix(em): rebuild virtual distillation as Hadamard test; release 2.0.0-beta.2 / 0.1.0-beta.2 - #51
Merged
Merged
Conversation
The copy-swap circuit inserted uncontrolled SWAPs between copies. Since S rho^⊗M S† = rho^⊗M, a bare permutation is a no-op on the product state, so neither Tr(O rho^M) nor Tr(rho^M) was ever measured and the mitigated estimate degenerated to <H>^copies (e.g. VD of <Z> on |1> returned +1 instead of -1). Replace it with the Hadamard-test circuit of Huggins et al. (PRX 11, 041036, App. C): copies preparations, one ancillary qubit prepared in |+>, and a ladder of ancilla-controlled SWAPs between adjacent copies realizing the derangement. The numerator observable is the original Hamiltonian on the first copy tensored with X on the ancilla; the denominator observable is X on the ancilla alone. BREAKING CHANGE: estimators now receive a Hamiltonian on the denominator call too (a single X on the ancilla) instead of None; distinguish numerator and denominator by observable content. The copy-swap circuit width grows from copies * base_width to copies * base_width + 1. Add exact density-matrix tests: |1> recovers <Z> = -1, pure states Ry(theta) are invariant for copies 2 and 3, and depolarizing noise matches the analytic Tr(Z rho^2)/Tr(rho^2). Update C/Python bindings and the CN/EN docs to the new contract.
Device::line, bidirectional_line, ring, star, grid, from_edges, and line_from_qubits previously accepted zero qubits and returned an empty device. Add DeviceError::EmptyDevice and validate the two construction entry points (line_from_qubits and from_u32_edges) so all factories reject empty input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes and release preparation for
2.0.0-beta.2(Python) /0.1.0-beta.2(Rust/C).Changes
<H>^copies(e.g. VD of<Z>on|1⟩returned+1instead of-1). Replaced with the Hadamard-test circuit of Huggins et al. (PRX 11, 041036, App. C), with exact density-matrix tests and updated C/Python bindings and docs. BREAKING CHANGE: estimators now receive an observable (ancillaX) on the denominator call instead ofNone; circuit width grows by one qubit.Device::line,ring,star,grid,from_edges, etc. previously accepted zero qubits and returned an empty device; all factories now returnDeviceError::EmptyDevice.science::physicscategory slug from both manifests.timeoutandpoll_interval.Test plan
cargo test --workspace --lockedpasses