Details proposed by Claude
Add Tutorial and Example Configuration Files for Common Use Cases
Summary
The QHAT analysis tool currently has two configuration files:
all_analyses.config - comprehensive reference showing all options
error_analysis_tutorial.config - pedagogical tutorial for error analysis
We need additional tutorial and example configurations to cover common use cases and help users learn the tool effectively. This issue proposes six new configuration files that fill important pedagogical and practical gaps.
Motivation
Current gaps:
-
No QPE tutorial: Quantum Phase Estimation is a major algorithm type but has no dedicated tutorial. Users learning QPE must figure it out from all_analyses.config comments.
-
No production templates: Researchers wanting to "just run a ground state energy calculation" have no clean, minimal template to copy-paste and modify.
-
No encoding comparison guide: Users must choose between Trotter, LCU, and Double Factorization without guidance on trade-offs or when to use each.
-
No parameter study examples: Researchers generating paper figures (error vs. cost plots) have no guidance on systematic parameter variation.
-
No large-system guidance: Systems >12 qubits hit memory limits, but there's no documentation on memory management strategies.
-
Numerical simulation not featured: State evolution is buried in comprehensive examples rather than highlighted as a standalone capability.
Impact: Users spend time rediscovering best practices, may choose inappropriate methods, or give up on using advanced features.
Proposed Solution
Add six new .config files to analysis/examples/:
High Priority (Implement First)
1. qpe_tutorial.config - Quantum Phase Estimation Tutorial
Purpose: Teach QPE algorithm usage with pedagogical progression.
Content:
- Introduction: QPE vs. time evolution, when to use each
- Phase qubit selection: Precision vs. cost trade-off
- Probability of failure parameter and its meaning
- Energy shift handling for QPE (why it's required)
- Resource scaling analysis
- Interpreting phase estimation results
- Comparison to time evolution tutorial
Learning objectives:
- Understand QPE-specific parameters (
num_phase_qubits, probability_of_failure)
- Choose appropriate phase precision for desired energy resolution
- Interpret QPE output (phases → energies)
Estimated size: 250-300 lines
2. ground_state_energy.config - Minimal Production Template
Purpose: Copy-paste template for the most common research task.
Content:
- Minimal configuration for ground state energy calculation
- Only essential analyses: resource estimation + eigenvalue errors
- Chemical accuracy context (kcal/mol, mH conversions)
- Clear comments on parameters to modify for your system
- Best practices for choosing error budgets in chemistry
- Production-ready file naming conventions
Target audience: Computational chemists, pragmatic users
Design principle: If it's not essential for ground state energy, it's not in this file.
Estimated size: 100-150 lines (deliberately minimal)
3. encoding_methods_comparison.config - When to Use Which Encoding
Purpose: Help users choose between Trotter, LCU, and Double Factorization.
Content:
- Template with all three encodings (two commented out)
- Clear instructions: "Uncomment the encoding you want to use"
- Comparison table in comments:
- Trotter: Pros (simple, widely used), Cons (many gates), Best for (all systems)
- LCU: Pros (good scaling), Cons (block encoding complexity), Best for (large systems)
- DF: Pros (optimal for molecules), Cons (requires structure), Best for (electronic structure)
- Resource estimation for comparison
- References to literature for each method
Format: Users uncomment one encoding block and run.
Estimated size: 200-250 lines
Medium Priority (Implement Second)
4. scaling_study.config - Systematic Parameter Studies
Purpose: Template for generating research data (plots for papers).
Content:
- How to systematically vary parameters (energy_error, Trotter order, system size)
- Recommended output file naming for parameter sweeps
- Comments showing Python wrapper pattern for automation
- What to measure: T-count, error metrics, memory usage
- Example data collection workflow
- Guidance on parallel execution
Target audience: Users writing papers with computational results
Estimated size: 200-250 lines
5. numerical_simulation_tutorial.config - State Evolution Focus
Purpose: Showcase state evolution as standalone capability.
Content:
- Creating and formatting input states
- Single vs. multiple state evolution
- Exact vs. approximate comparison
- Time series evolution (multiple timesteps)
- Analyzing evolved states (populations, overlaps)
- When to use this vs. error analysis
Use case: Users who want to evolve states, not analyze algorithms.
Estimated size: 200-250 lines
6. large_system_workflow.config - Memory Management for >12 Qubits
Purpose: Guidance on working with systems that exceed dense matrix limits.
Content:
- Memory threshold configuration
- Matrix-free operator strategies
- Which analyses work at large scale (eigenvalue errors: yes, matrix norms: no)
- Computational time expectations
- What to avoid (operations requiring full dense matrices)
- Alternative workflows when matrices are too large
Warning level: Mark as "advanced" - requires understanding trade-offs.
Estimated size: 200-250 lines
Detailed Scope
What Each File Must Include
All configuration files must have:
-
Comprehensive header docstring following the template from error_analysis_tutorial.config:
- PURPOSE section
- LEARNING OBJECTIVES or TARGET AUDIENCE
- USAGE command
- WHAT THIS FILE DEMONSTRATES
- NEXT STEPS or RELATED EXAMPLES
-
Step-by-step structure with numbered sections or clear progression
-
Inline pedagogical comments explaining:
- What each parameter does
- Why we chose particular values
- What happens if you change them
- Common pitfalls to avoid
-
"TRY THIS" experimentation prompts where appropriate
-
Expected output section explaining:
- What files are produced
- How to interpret results
- Sanity checks for validation
-
Valid Python syntax (runnable with python3.11 -m qhat.analysis.driver)
Directory Structure
analysis/examples/
├── all_analyses.config (existing - complete reference)
├── error_analysis_tutorial.config (existing - error analysis tutorial)
├── qpe_tutorial.config (new - QPE tutorial)
├── ground_state_energy.config (new - production template)
├── encoding_methods_comparison.config (new - encoding choice guide)
├── scaling_study.config (new - parameter studies)
├── numerical_simulation_tutorial.config (new - state evolution focus)
├── large_system_workflow.config (new - memory management)
└── config.py (existing - basic example)
Documentation Updates Required
Update analysis/README.md with new section:
## Tutorial and Example Configurations
The `examples/` directory contains configurations for learning and production use:
### Tutorials (Learning)
- **error_analysis_tutorial.config** - Error analysis from first principles
- **qpe_tutorial.config** - Quantum Phase Estimation algorithm
- **numerical_simulation_tutorial.config** - Evolving quantum states
### Production Templates
- **ground_state_energy.config** - Minimal template for chemistry calculations
- **encoding_methods_comparison.config** - Choose encoding method (Trotter/LCU/DF)
### Advanced Topics
- **scaling_study.config** - Parameter sweeps for research papers
- **large_system_workflow.config** - Memory management for >12 qubits
### Complete Reference
- **all_analyses.config** - Every available option (demonstration only)
- **config.py** - Basic minimal example
Success Criteria
Acceptance Criteria
For each configuration file:
For documentation:
Testing
Each configuration should be tested by:
- Running successfully on the example Be-H system
- Verifying all output files are created
- Checking that results make sense (sanity checks pass)
- Having someone unfamiliar with the code try to follow the tutorial
Implementation Plan
Phase 1: High Priority (Target: 1 week)
- Create
qpe_tutorial.config
- Create
ground_state_energy.config
- Create
encoding_methods_comparison.config
- Update
README.md for Phase 1 files
- Test all three files
Phase 2: Medium Priority (Target: 1 week)
- Create
scaling_study.config
- Create
numerical_simulation_tutorial.config
- Create
large_system_workflow.config
- Update
README.md for Phase 2 files
- Test all three files
Suggested Workflow
- Create new branch:
tutorial-configs or similar
- One commit per config file (easier to review)
- Final commit: README.md updates
- Merge request after Phase 1 complete (don't wait for Phase 2)
Out of Scope
The following are not included in this issue:
- Creating actual test systems for tutorials (use existing Be-H examples)
- Automated testing of configuration files (manual testing is sufficient)
- Python scripting examples for parameter sweeps (just comments/templates in configs)
- Web-based documentation (just README.md updates)
- Integration with CI/CD (configs are examples, not tests)
Alternatives Considered
Alternative 1: Jupyter Notebooks
Rejected because:
- Adds dependency on Jupyter
- Harder to version control
- Config files are already Python, just with domain-specific semantics
Alternative 2: Comprehensive Documentation in README Only
Rejected because:
- Users learn better from runnable examples
- README is reference material, not tutorial material
- Examples make it easier to get started quickly
Alternative 3: Single "tutorial.config" with Everything
Rejected because:
- Would be overwhelming (500+ lines)
- Different use cases need different focus
- Modular tutorials allow targeted learning
References
- Current tutorial structure:
analysis/examples/error_analysis_tutorial.config
- Current comprehensive reference:
analysis/examples/all_analyses.config
- Best practices source: This conversation and established patterns
Notes for Implementer
- Follow the header format from
error_analysis_tutorial.config - it's been well-received
- Keep production templates (
ground_state_energy.config) deliberately minimal
- Keep tutorials (
*_tutorial.config) comprehensive with lots of explanation
- Use consistent naming:
*_tutorial.config for pedagogical, *.config for production/reference
- All tutorials should reference each other ("see also X for...")
- Consider adding a "recommended learning path" comment in each tutorial
Estimated Effort
Total: 16-24 hours for all six files
Details proposed by Claude
Add Tutorial and Example Configuration Files for Common Use Cases
Summary
The QHAT analysis tool currently has two configuration files:
all_analyses.config- comprehensive reference showing all optionserror_analysis_tutorial.config- pedagogical tutorial for error analysisWe need additional tutorial and example configurations to cover common use cases and help users learn the tool effectively. This issue proposes six new configuration files that fill important pedagogical and practical gaps.
Motivation
Current gaps:
No QPE tutorial: Quantum Phase Estimation is a major algorithm type but has no dedicated tutorial. Users learning QPE must figure it out from
all_analyses.configcomments.No production templates: Researchers wanting to "just run a ground state energy calculation" have no clean, minimal template to copy-paste and modify.
No encoding comparison guide: Users must choose between Trotter, LCU, and Double Factorization without guidance on trade-offs or when to use each.
No parameter study examples: Researchers generating paper figures (error vs. cost plots) have no guidance on systematic parameter variation.
No large-system guidance: Systems >12 qubits hit memory limits, but there's no documentation on memory management strategies.
Numerical simulation not featured: State evolution is buried in comprehensive examples rather than highlighted as a standalone capability.
Impact: Users spend time rediscovering best practices, may choose inappropriate methods, or give up on using advanced features.
Proposed Solution
Add six new
.configfiles toanalysis/examples/:High Priority (Implement First)
1.
qpe_tutorial.config- Quantum Phase Estimation TutorialPurpose: Teach QPE algorithm usage with pedagogical progression.
Content:
Learning objectives:
num_phase_qubits,probability_of_failure)Estimated size: 250-300 lines
2.
ground_state_energy.config- Minimal Production TemplatePurpose: Copy-paste template for the most common research task.
Content:
Target audience: Computational chemists, pragmatic users
Design principle: If it's not essential for ground state energy, it's not in this file.
Estimated size: 100-150 lines (deliberately minimal)
3.
encoding_methods_comparison.config- When to Use Which EncodingPurpose: Help users choose between Trotter, LCU, and Double Factorization.
Content:
Format: Users uncomment one encoding block and run.
Estimated size: 200-250 lines
Medium Priority (Implement Second)
4.
scaling_study.config- Systematic Parameter StudiesPurpose: Template for generating research data (plots for papers).
Content:
Target audience: Users writing papers with computational results
Estimated size: 200-250 lines
5.
numerical_simulation_tutorial.config- State Evolution FocusPurpose: Showcase state evolution as standalone capability.
Content:
Use case: Users who want to evolve states, not analyze algorithms.
Estimated size: 200-250 lines
6.
large_system_workflow.config- Memory Management for >12 QubitsPurpose: Guidance on working with systems that exceed dense matrix limits.
Content:
Warning level: Mark as "advanced" - requires understanding trade-offs.
Estimated size: 200-250 lines
Detailed Scope
What Each File Must Include
All configuration files must have:
Comprehensive header docstring following the template from
error_analysis_tutorial.config:Step-by-step structure with numbered sections or clear progression
Inline pedagogical comments explaining:
"TRY THIS" experimentation prompts where appropriate
Expected output section explaining:
Valid Python syntax (runnable with
python3.11 -m qhat.analysis.driver)Directory Structure
Documentation Updates Required
Update
analysis/README.mdwith new section:Success Criteria
Acceptance Criteria
For each configuration file:
python3.11 -m py_compile)python3.11 -m qhat.analysis.driverFor documentation:
README.mdupdated with new section describing all tutorialsTesting
Each configuration should be tested by:
Implementation Plan
Phase 1: High Priority (Target: 1 week)
qpe_tutorial.configground_state_energy.configencoding_methods_comparison.configREADME.mdfor Phase 1 filesPhase 2: Medium Priority (Target: 1 week)
scaling_study.confignumerical_simulation_tutorial.configlarge_system_workflow.configREADME.mdfor Phase 2 filesSuggested Workflow
tutorial-configsor similarOut of Scope
The following are not included in this issue:
Alternatives Considered
Alternative 1: Jupyter Notebooks
Rejected because:
Alternative 2: Comprehensive Documentation in README Only
Rejected because:
Alternative 3: Single "tutorial.config" with Everything
Rejected because:
References
analysis/examples/error_analysis_tutorial.configanalysis/examples/all_analyses.configNotes for Implementer
error_analysis_tutorial.config- it's been well-receivedground_state_energy.config) deliberately minimal*_tutorial.config) comprehensive with lots of explanation*_tutorial.configfor pedagogical,*.configfor production/referenceEstimated Effort
Phase 1 (high priority): 8-12 hours total
qpe_tutorial.config: 3-4 hoursground_state_energy.config: 2-3 hours (minimal by design)encoding_methods_comparison.config: 3-4 hoursPhase 2 (medium priority): 8-12 hours total
Total: 16-24 hours for all six files