numyeigensolver

Computes lowest k eigenvalues and eigenstates of quantum operators via NumPy and SciPy diagonalization.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? It provides an exact classical reference for computing eigenvalues and eigenstates of quantum operators, letting you benchmark quantum eigensolvers and validate results without building any quantum circuits. ## Core Features & Use Cases - Exact Eigendecomposition: Converts a Qiskit BaseOperator (e.g., SparsePauliOp) to sparse or dense matrix form and selects the appropriate NumPy/SciPy solver (eigh, eigsh, eig, eigs) automatically. - Filtering and Auxiliary Operators: Supports a filter_criterion predicate for post-selecting eigenpairs and evaluates auxiliary operator expectation values on each returned eigenstate. - Use Case: You are testing a variational quantum eigensolver on a small Hamiltonian. Use this skill to compute the exact ground-state energy of H = ZZ + 0.5XI + 0.3IX with k=2, then compare the quantum result against the exact eigenvalues. ## Quick Start Ask the assistant to compute the two lowest eigenvalues of the SparsePauliOp operator ZZ + 0.5XI + 0.3IX using the NumPy eigensolver and print the eigenvalues and eigenstates.

Frequently Asked Questions about numyeigensolver

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

FAQPage Schema
How do I compute eigenvalues of a quantum operator in Qiskit?

Use NumPyEigensolver from qiskit_algorithms.eigensolvers with a BaseOperator such as SparsePauliOp. Call compute_eigenvalues(operator) with k set to the number of eigenvalues you want, and read result.eigenvalues and result.eigenstates.

What is NumPyEigensolver used for in quantum computing?

NumPyEigensolver is a classical exact eigensolver that diagonalizes a qubit operator using NumPy and SciPy. It serves as a reference baseline for benchmarking quantum eigensolvers like VQE, with no quantum circuit construction involved.

How do I filter eigenvalues with NumPyEigensolver?

Pass a filter_criterion callable with signature filter_criterion(eigenstate, eigenvalue, aux_values) returning a boolean. Only eigenpairs passing the predicate are returned, so the result may contain fewer than k entries.

What is the maximum qubit count for classical eigensolvers?

The dense matrix scales as 2^n by 2^n, so memory grows exponentially. Around 10-12 qubits is the practical dense limit (about 128 MB complex128 at n=12); beyond that, dense diagonalization may exhaust memory.

Why does NumPyEigensolver return complex eigenvalues?

Complex eigenvalues appear when the input operator is not Hermitian. In that case the solver uses numpy.linalg.eig or scipy.sparse.linalg.eigs instead of the Hermitian eigh/eigsh paths, and sorting is by real part.