【创新应用】QSEncode-Insight:面向误差预算的资源感知量子态制备与审计工具 - #53
Open
Mack-blip-space wants to merge 6 commits into
Open
Conversation
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.
参赛方向:创新应用类
关联赛题:#13
团队名称:这很量子
团队成员:@Mack-blip-space、@totoy0312
Summary
This PR adds QSEncode-Insight alongside the existing
QSpare_CodeAPI. It turnserror-budgeted coefficient truncation into an end-to-end, resource-aware state
preparation workflow and preserves the legacy implementation unchanged.
QSEncode-Insight is submitted as an innovation-application tool. It does not
claim to invent the PyQPanda3
amplitude_encode,sparse_isometry, ords_quantum_state_preparationprimitives. Its contribution is the reproducibledecision and audit layer around those primitives: fidelity-budgeted truncation,
capability filtering, compiled-resource comparison, deterministic selection,
semantic verification, attribution, and an explicit refusal path.
This differs from PR #51, which focuses on legacy QSEncode tests and
documentation, and PR #52, which optimizes Walsh/Top-K implementation details
inside the legacy module. This PR leaves
QSpare_Code.pybyte-for-byteunchanged and contributes a separate end-to-end application and public API.
Motivation
A fixed coefficient cut does not directly express a fidelity requirement, and a
smaller coefficient set does not necessarily produce a cheaper compiled circuit.
Different state-preparation methods also have different compatibility and resource
profiles. QSEncode-Insight therefore evaluates the complete path from fidelity
budget to compiled resource selection and can explicitly decline compression when
no candidate improves on the dense baseline.
What changed
hashes.
O(N log N)FWHT implementation and an orthonormal Fourier mode.k*analysis and the frozen neighboring-candidatepolicy.
amplitude_encode,sparse_isometry, andDS_quantum_state_preparation.deterministic resource-aware selection.
COMPRESS/DO_NOT_COMPRESSresults and truncation/preparationresource attribution.
QSEncodeInsight.analyze()andprepare()facade withresult/input/config binding checks.
evidence boundaries, and regression coverage.
DO_NOT_COMPRESSdecisions instead of presenting only the pooled headline.Validation
environment and a clean Python 3.12.10 compatibility environment, using
PyQPanda3 0.3.5, NumPy 2.4.6, SciPy 1.17.1, and SymPy 1.14.0.
build/install passed, and installed-wheel API, CLI, and notebook Run-All
smoke checks passed.
N=8regression:k*=4,DO_NOT_COMPRESS, dense baseline about 21 two-qubit gates / 37depth.
k*=4, selectssparse_isometry, about 37 two-qubit gates / 61-62depth versus the dense baseline's about 114 / 205.
1 - 1e-10.covered by tests.
Reproduction commands from the repository root:
python -m pip install -r pyqpanda-algorithm/requirements-qseencode-insight-test.txt python -m pytest -c pyqpanda-algorithm/pytest-qseencode.ini python -m pytest -c test/pytest.ini -o "addopts=-q -p no:cacheprovider"The preregistered 480-cell generalization benchmark completed all cells and reached
strong_passin both explicitly selected basis modes under the selector-all metric:These are compiled-resource results within the declared test scope; they are not a
claim of quantum advantage or hardware runtime acceleration.
Backward compatibility
QSpare_Code.pyis byte-for-byte unchanged.QSpare_Codeexport remains available.artifacts at runtime.
Scope and limitations
fidelity_target=0.99, explicitly chosenWalsh or Fourier mode,
N in {8,16,32,64}, default method order, five technicalrepetitions, and the frozen compiler profile on PyQPanda3 0.3.5.
filtering and fallback are expected product behavior.
families, and
DO_NOT_COMPRESSremains a normal result.outside_validated_scope.