Skip to content

Qho decapitation shim#2

Open
mbahram wants to merge 1614 commits into
KirillBelovTest:mainfrom
WolframResearch:qho-decapitation-shim
Open

Qho decapitation shim#2
mbahram wants to merge 1614 commits into
KirillBelovTest:mainfrom
WolframResearch:qho-decapitation-shim

Conversation

@mbahram
Copy link
Copy Markdown
Contributor

@mbahram mbahram commented Apr 30, 2026

decapitation of hamiltonian operator

BrunoQNF and others added 30 commits September 4, 2025 12:41
Adding new operators: beam-splitter and phase shift
clarify what is TN in Wolfram quantum framework
Phase space quasiprobability distributions
adding doc page, with 2 basis examples
more examples added
added more examples
sebrodfal and others added 30 commits February 25, 2026 11:25
minor update
some updates and cleaning up
more edits on text
Add a new Mathematica notebook exploring the double-cover relationship between SU(2) and SO(3) (double-cover-SU2-SO3.nb). Also update the existing course notebook (introduction-to-QIS.nb) with revisions to the Introduction to QIS material. These are binary notebook changes containing content and formatting updates.
Training notebooks
Add the /nisq-critique-papers entry to .gitignore to prevent that directory (likely local/generated critique papers) from being tracked by git.
Changing Re such that it does not appear for symbolic states
Changing MaTeX and adding references plus minor edits
Keeping option to have non-normalized coherent states, since in some cases it is useful for symbolic manipulations. By default it is normalized
replacing definition with Norm[..,F]
Conversion from LaTex to display formula in all chapters, Chapter 2 minor updates
Line 379: ConfirmBy[..., QuantumOperartorQ] in the Controlled0 dispatch
called an undefined predicate, silently failing for non-operator args.

Line 855: QuantumOperator["HeisenbergWeyl"] returned QuantumOperartor[...]
unevaluated instead of dispatching to the {"HeisenbergWeyl", 2} entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add '/.claude' to .gitignore to prevent committing the Claude config directory.
Delete Kernel/QuantumHamiltonianOperator/ (4 files, 281 LOC). Audit
showed it was an orphan: not in PacletInfo.wl Symbols, zero kernel .m
references outside its own subdir, only stale notebook menus referenced
the symbol. The QuantumHamiltonianOperator[] wrapper added no
functionality beyond QuantumOperator[..., "ParameterSpec" -> spec].

Migrate the two named constructors with no QuantumOperator equivalent
into Kernel/QuantumOperator/NamedOperators.m after the "Hamiltonian"
definition:
  - QuantumOperator[{"Ising", J}, order : {1, 2}, opts___]
  - QuantumOperator[{"TransverseIsing", J}, order : {1, 2}, opts___]
The unused {parameter, t0, tf} placeholder from the QHO signature is
dropped; users pass "ParameterSpec" -> {s, 0, 1} via opts when J is
symbolic. Both constructors verified in a Wolfram kernel: Hermitian
matrices match by-hand calculation; symbol registration in
$QuantumOperatorNames confirmed.

Skip migration of:
  - "LinearInterpolation"  (3-line user code)
  - {"EvolutionOperator", U_matrix} inverse (no callers in audited tree)
  - ["Gap"] / ["MinimumGap"] family (shallow utility on top of
    qo["Eigenvalues"]; the 100-point default was a known perf trap)

Replacement guide for evolution work (already in active code):
  - qo["EvolutionOperator"]   -> QuantumEvolve[qo, None] / DSolveValue
  - qo["NEvolutionOperator"]  -> NDSolveValue (recommended)
  - QuantumOperator[{"Hamiltonian", H, Ls, gammas}] -> packs H + jumps

Top-level CHANGELOG.md created with the user-facing migration table.

PacletInfo.wl needs no edit -- the QHO context was never registered.

See audit/qho-deprecation-audit.md and audit/CHANGELOG.md 2026-04-30.
Builds on remove-quantum-hamiltonian-operator (a727501). That branch
hard-deleted the QHO subsystem; this branch instead re-introduces
QuantumHamiltonianOperator as a single-file deprecation shim that
emits Message[QuantumHamiltonianOperator::deprecated] and forwards to
the equivalent QuantumOperator call. Old user code keeps working with
a warning; the "Ising" and "TransverseIsing" named constructors still
live as new constructors on QuantumOperator.

Synthesis with origin/DecapitateHamiltonianOperator (upstream branch
27 days old, bundled with much larger refactor we do not want to
merge):
  - Shim pattern adopted from upstream a8a4a7c.
  - Test file structure adapted from upstream Tests/QuantumHamiltonianDecapitation.wlt.
  - Kept this branch surgical scope -- no other files touched.
  - Kept the order-second + opts signature for the new named
    constructors (more idiomatic; ParameterSpec optional). The shim
    translates the legacy QHO-style positional spec into a
    "ParameterSpec" option attached to the forwarded call.

Test runner output:
  PASS QuantumDistance.wlt:                32/32
  PASS QuantumHamiltonianDecapitation.wlt: 18/18
  Total: 50/50 (100%)

The shim file lives at Kernel/QuantumHamiltonianOperator.m (single
file, ~50 lines, replacing the original 4-file subdir at the same
path). PacletInfo.wl needs no change -- the symbol context was never
registered, and content-based loading picks up the file via its
Package declaration.
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.

4 participants