【创新应用】SU(2) color-chain quantum simulation tutorial#17
Open
Suxeca wants to merge 3 commits intoOriginQ:developfrom
Open
【创新应用】SU(2) color-chain quantum simulation tutorial#17Suxeca wants to merge 3 commits intoOriginQ:developfrom
Suxeca wants to merge 3 commits intoOriginQ:developfrom
Conversation
新增自包含 SU(2) color-chain 教程,展示 sector diagnostics、局域 quench、OpenQASM 与 pyQPanda CPUQVM 示例。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
统一 quench theta 在数值扫描、OpenQASM 与 CPUQVM 示例中的使用,并拆分 pyQPanda 可选依赖。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a self-contained SU(2) “color-chain” quantum simulation tutorial package to the repository, including a NumPy exact-diagonalization reference workflow, OpenQASM circuit exports, and an optional pyQPanda CPUQVM runnable example to demonstrate circuit execution.
Changes:
- Introduces
SU2ColorChainTutorial/src/su2_toy/toy-model implementation (Hamiltonian construction, sector diagnostics, quench, correlation, scan + summary). - Adds runnable entrypoints (
run_demo.py,make_plots.py,pyqpanda_demo.py) plus tutorial wrappers underTutorials/SU2ColorChainTutorial/. - Adds basic tests and documentation/checklists, and splits pyQPanda into an optional dependency list.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/run_tutorial.py | Tutorial wrapper to run the main scan with a default output directory. |
| SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/README.md | Tutorial-facing readme explaining workflow, outputs, and how to run. |
| SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/pyqpanda_cpuqvm_example.py | Tutorial wrapper for running the pyQPanda CPUQVM example with a default output path. |
| SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/PR_DESCRIPTION.md | PR body draft describing the contribution and test plan. |
| SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/make_tutorial_plots.py | Tutorial wrapper for generating plots from summary.json. |
| SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/DERIVATION.md | Model derivation and observable definitions for the tutorial. |
| SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/CONTRIBUTION_NOTE.md | Contribution note and local verification commands. |
| SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/.gitignore | Ignores tutorial outputs and Python caches within the tutorial folder. |
| SU2ColorChainTutorial/tests/test_su2_toy.py | Adds basic tests for Hermiticity, normalization, sector diagnostics, and QASM shape. |
| SU2ColorChainTutorial/SUBMISSION_CHECKLIST.md | Submission checklist and suggested local validation commands. |
| SU2ColorChainTutorial/src/su2_toy/scan.py | Implements parameter scans, sector extraction, fidelities/slopes, and summary generation. |
| SU2ColorChainTutorial/src/su2_toy/qasm_export.py | Exports OpenQASM 2.0 circuits for singlet-pair prep and the central quench probe. |
| SU2ColorChainTutorial/src/su2_toy/operators.py | Defines Pauli matrices, Kronecker helpers, expectation/normalize utilities. |
| SU2ColorChainTutorial/src/su2_toy/model.py | Core toy-model Hamiltonian, SU(2) operators, quench, correlations, and helper diagnostics. |
| SU2ColorChainTutorial/src/su2_toy/io_utils.py | JSON/CSV/text writers and ASCII chart helpers for scan outputs. |
| SU2ColorChainTutorial/src/su2_toy/init.py | Exposes a small public surface for the toy model module. |
| SU2ColorChainTutorial/run_demo.py | CLI entrypoint for the NumPy scan producing CSV/JSON/QASM and ASCII charts. |
| SU2ColorChainTutorial/requirements.txt | Base dependencies for numeric tutorial/plotting. |
| SU2ColorChainTutorial/requirements-pyqpanda.txt | Optional dependency set adding pyQPanda on top of base requirements. |
| SU2ColorChainTutorial/README.md | Project-level readme covering purpose, workflow, outputs, and run commands. |
| SU2ColorChainTutorial/pyqpanda_demo.py | CLI entrypoint to run the singlet-pair/quench circuit on pyQPanda CPUQVM. |
| SU2ColorChainTutorial/make_plots.py | Plot generator reading summary.json and writing diagnostic figures. |
| SU2ColorChainTutorial/contest_pitch.txt | Short contest pitch summarizing highlights and use cases. |
| SU2ColorChainTutorial/.gitignore | Ignores caches and outputs for the tutorial package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
修正 S² expectation 命名、类型标注和教程运行目录说明,提升示例代码与文档清晰度。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Test plan
🤖 Generated with Claude Code