algorithms

Route quantum algorithm tasks to UnitaryLab implementation guides across ten algorithm categories.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires unitarylab-algorithms, numpy, scipy, torch, pennylane, networkx, matplotlib, and includes scripts (resource) components.

What problem does it solve? Choosing the right quantum algorithm implementation and its correct usage pattern is difficult when a library spans dozens of algorithms across primitives, linear systems, cryptography, simulation, and machine learning. This Skill provides a structured index that routes each quantum computing request to the correct UnitaryLab algorithm guide before any code is written. ## Core Features & Use Cases - Algorithm Routing: Directs requests to ten categories — quantum primitives, linear systems, cryptography, Hamiltonian simulation, Schrodingerization, quantum machine learning, state preparation, eigensolvers, gradients, and quantum error correction. - Implementation Guidance: Each category links to detailed leaf guides with parameters, return contracts, validation rules, and runnable examples for UnitaryLab, with Qiskit, PennyLane, and Classiq reference extensions. - Safe Workflow Rules: Enforces install-only-when-needed behavior for the unitarylab-algorithms package and treats bundled scripts as reference-only material, never runtime dependencies. - Use Case: A user asks to solve a linear system with HHL or estimate ground-state energy with VQE; the Skill routes to the exact leaf guide, then generates standalone validated code with the documented parameters and return fields. ## Quick Start Ask the assistant to implement a specific quantum algorithm such as VQE ground-state estimation or Shor's factoring using the algorithms skill, and it will route to the correct guide and generate runnable code.

Frequently Asked Questions about algorithms

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

FAQPage Schema
How do I implement quantum algorithms like VQE or HHL in Python?▼

Install the unitarylab-algorithms package with pip, then use the algorithm class matching your task, such as VQEAlgorithm for ground-state energy estimation. Each algorithm guide documents its parameters, return fields, and a runnable example.

What quantum algorithms does UnitaryLab cover?▼

It covers ten categories: primitives like QPE and amplitude estimation, linear-system solvers like HHL and VQLS, cryptography algorithms like Shor and Simon, Hamiltonian simulation methods, Schrodingerization PDE solvers, quantum machine learning, state preparation, eigensolvers, gradient methods, and quantum error correction.

How do I choose between Trotter, QDrift, and QSP for Hamiltonian simulation?▼

Trotter-Suzuki is a deterministic product formula, QDrift uses randomized sampling of Pauli terms, and QSP-HS block-encodes the Hamiltonian for polynomial spectral transformation. The Hamiltonian simulation guide compares all five methods with their key parameters.

Can I use Qiskit or PennyLane instead of UnitaryLab?▼

Yes, selected guides include Qiskit and PennyLane reference examples, such as Qiskit VQE with estimator and optimizer abstractions and a PennyLane-based qLDPC tutorial. UnitaryLab remains the primary implementation path.

Why do I get No module named unitarylab_algorithms?▼

The package is not installed in your current environment. Run pip install unitarylab-algorithms, then re-run your script; only install when you actually execute code that imports the package.

Should I import the skill's scripts directory in generated code?▼

No, the bundled scripts are reference-only material for troubleshooting, API comparison, and validation. Generate standalone task code first and consult the scripts only to understand intended behavior when generated code fails.