cartan

Simulate quantum time evolution using Cartan decomposition and Lax flow iteration.

18|3|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/unitarylab/quantum-practices --skill cartan-unitarylab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cartan
Source: https://github.com/unitarylab/quantum-practices/tree/main/algorithms/hamiltonian-simulation/cartan
Command: npx skills add https://github.com/unitarylab/quantum-practices --skill cartan-unitarylab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, scipy, unitarylab, and includes scripts (resource) components.

What problem does it solve? Computing the time-evolution operator U(t) = e^{-iHt} for a quantum Hamiltonian requires decomposing the problem into circuit-constructible pieces. This Skill guides you through Cartan decomposition Hamiltonian simulation, which splits the Hamiltonian's Lie algebra into symmetric and antisymmetric subalgebras and uses a Lax flow to build an approximate evolution circuit with controllable error. ## Core Features & Use Cases - Cartan-Lax Simulation: Run time-evolution simulations on real symmetric Hamiltonians via the cartan-lax method in unitarylab.library.hamiltonian, with tunable error tolerance, learning rate, and iteration budgets. - Exact Benchmarking: Automatically compares the approximate unitary against the exact result computed with scipy.linalg.expm, reporting achieved error and runtime. - Debugging and Reimplementation Support: Includes a manual Lax flow implementation, Pauli decomposition utilities, and known test cases for validation and troubleshooting. - Use Case: Given a 2x2 real symmetric Hamiltonian like H = [[2,1],[1,2]], run the algorithm with t=1.0 and error=1e-3 to obtain the approximate evolution unitary, the exact reference, and the achieved Frobenius-norm error. ## Quick Start Ask the assistant to simulate the time evolution of the Hamiltonian [[2,1],[1,2]] for t=1.0 with error tolerance 1e-3 using Cartan decomposition.

Frequently Asked Questions about cartan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I simulate Hamiltonian time evolution with Cartan decomposition in Python?

Create a CartanDecompositionAlgorithm instance and call run() with your Hamiltonian matrix H, evolution time t, and error tolerance. The result dictionary contains the approximate unitary under 'Evolution result', the exact reference under 'Exact evolution', and the achieved error under 'Final total error'.

What types of Hamiltonians does Cartan decomposition simulation support?

The current implementation supports real symmetric Hermitian matrices passed as 2D numpy arrays through the matrix path only. Pauli-string input is not yet supported, so verify symmetry with np.allclose(H, H.T) before running.

Why does my Cartan-Lax simulation fail to converge?

Convergence failure usually happens when max_steps is exhausted before the error tolerance is met, often caused by a small learning rate lr combined with a tight error threshold. Increase max_steps, relax the error tolerance, or adjust lr starting from the default 1e-3.

What are the limitations of Cartan decomposition for large quantum systems?

The exact reference computation via scipy.linalg.expm scales cubically with Hilbert-space dimension, so classical overhead dominates beyond about 4 qubits. The method is suited for small-to-medium systems, and tight error tolerances with small lr significantly increase runtime.

How do error tolerance and learning rate affect Cartan simulation accuracy?

The error parameter sets the stopping tolerance for the off-h component norm, with tighter values producing lower final error but longer runtimes. If lr is too large the Lax flow may oscillate or diverge, so halve lr and re-run if the final error is worse than expected.