Skip to content

【创新应用】SU(2) color-chain quantum simulation tutorial#17

Open
Suxeca wants to merge 3 commits intoOriginQ:developfrom
Suxeca:feature/su2-color-chain-tutorial
Open

【创新应用】SU(2) color-chain quantum simulation tutorial#17
Suxeca wants to merge 3 commits intoOriginQ:developfrom
Suxeca:feature/su2-color-chain-tutorial

Conversation

@Suxeca
Copy link
Copy Markdown

@Suxeca Suxeca commented May 7, 2026

Summary

  • 新增自包含 SU(2) color-chain 量子模拟教程,覆盖 singlet/triplet sector diagnostics、局域 quench 与 connected color correlation。
  • 提供 NumPy reference scan、OpenQASM circuit prototype 和 pyQPanda CPUQVM 可运行示例。
  • 补充基础测试、本地验证说明,并将 pyQPanda 拆为可选依赖。

Test plan

  • Compile all Python entrypoints with py_compile
  • Run 6-qubit tutorial scan with 17 parameter points
  • Generate tutorial plots from summary.json
  • Run basic SU(2) toy-model tests
  • Run pyQPanda CPUQVM example with 100 shots

🤖 Generated with Claude Code

Suxeca and others added 2 commits May 7, 2026 14:30
新增自包含 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>
Copilot AI review requested due to automatic review settings May 7, 2026 06:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 under Tutorials/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.

Comment thread SU2ColorChainTutorial/src/su2_toy/operators.py Outdated
Comment thread SU2ColorChainTutorial/src/su2_toy/model.py Outdated
Comment thread SU2ColorChainTutorial/src/su2_toy/scan.py Outdated
Comment thread SU2ColorChainTutorial/Tutorials/SU2ColorChainTutorial/README.md Outdated
Comment thread SU2ColorChainTutorial/src/su2_toy/model.py Outdated
修正 S² expectation 命名、类型标注和教程运行目录说明,提升示例代码与文档清晰度。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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