taylor

Simulate quantum time evolution using truncated Taylor series and LCU circuits.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Approximating the quantum time-evolution operator e^{-iHt} requires a controllable, error-bounded method; this Skill implements Taylor series truncation with time-slicing and Linear Combination of Unitaries (LCU) circuit construction, returning both approximate and exact evolution matrices with a Frobenius error metric. ## Core Features & Use Cases - Adaptive truncation: Automatically computes the number of time slices r and Taylor degree K from the spectral norm of H, evolution time t, and target error, with the degree hard-capped at 15. - LCU circuit construction: Decomposes the Hamiltonian into Pauli strings, builds the truncated series via dynamic programming, elevates it to the r-th power, and assembles a single LCU circuit. - Validation against exact evolution: Compares the approximation against scipy.linalg.expm and reports the Frobenius norm of the error. - Use Case: A researcher comparing Hamiltonian simulation methods runs the Taylor algorithm on a 2x2 Hermitian matrix with t=1.0 and degree=15, then sweeps degree and t to study how slicing and truncation order affect accuracy versus Trotter or QSP approaches. ## Quick Start Ask the assistant to run Taylor Hamiltonian simulation on a 2x2 Hermitian matrix H=[[2,1],[1,3]] with t=1.0, error 1e-8, and degree 15, then report the Frobenius error.

Frequently Asked Questions about taylor

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

FAQPage Schema
How do I simulate Hamiltonian time evolution with a Taylor series in Python?

Create a TaylorAlgorithm instance and call run() with a Hermitian NumPy matrix H, evolution time t, target error, and degree. It returns the approximate and exact evolution matrices plus the Frobenius norm of their difference.

Taylor series vs Trotter vs QSP for Hamiltonian simulation?

Taylor truncation suits LCU-based simulation with controllable truncation order when H decomposes into few Pauli terms. For large evolution times, slicing costs grow linearly, so Trotter or QSP may be more efficient.

What inputs does the Taylor simulation algorithm require?

It requires a square Hermitian NumPy matrix (checked to atol=1e-12, zero-padded to power-of-2 dimensions), a finite evolution time t, a positive target error, and an optional degree capped at 15.

Why is my Taylor simulation error not decreasing with higher degree?

The degree is hard-capped at 15, so error saturation usually means the bottleneck is time-slicing or LCU normalization rather than truncation. Check the adaptive slice count r and consider increasing slices for large t.

What are the limitations of Taylor series Hamiltonian simulation?

The LCU term count grows exponentially with degree and the number of Pauli terms, raising memory use for large Hamiltonians. The degree cap of 15 and linear slice growth make very large evolution times costly.