qfi

Compute the Quantum Fisher Information matrix from parameterized quantum circuits using Qiskit.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Computing the Quantum Fisher Information (QFI) matrix for parameterized quantum states requires correctly deriving it from the Quantum Geometric Tensor (QGT), handling derivative types, phase-fix terms, and estimator precision — a process that is error-prone when done manually. ## Core Features & Use Cases - QFI via QGT backend: Wraps a BaseQGT backend (typically LinCombQGT) and extracts the real part of the QGT scaled by 4, using Qiskit's qiskit_algorithms.gradients module. - Reference and manual implementations: Includes a runnable Qiskit example plus a finite-difference manual implementation with symmetry and positive semi-definiteness checks. - Use Case: A researcher implementing quantum natural gradient descent needs the QFI matrix of a 2-qubit RY+CX ansatz at specific parameter values to precondition gradient updates in a variational optimization loop. ## Quick Start Ask the assistant to compute the QFI matrix for a two-qubit parameterized circuit with RY gates and a CX entangler at parameter values 0.5 and 1.0 using Qiskit's QFI class.

Frequently Asked Questions about qfi

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

FAQPage Schema
How do I compute the Quantum Fisher Information matrix in Qiskit?

Create a LinCombQGT backend with a StatevectorEstimator, pass it to the QFI class, then call qfi.run with your parameterized circuits and parameter values. The result's qfis field contains one real symmetric matrix per circuit.

What is the relationship between QFI and the Quantum Geometric Tensor?

The QFI matrix equals 4 times the real part of the Quantum Geometric Tensor. The QGT is complex-valued, while the QFI is always real, symmetric, and positive semi-definite, serving as the metric tensor of the quantum state manifold.

Which gates are supported by LinCombQGT for QFI computation?

LinCombQGT supports a fixed gate set including rx, ry, rz, cx, and h. Circuits containing unsupported gates must be decomposed or transpiled before being passed to the QGT backend, otherwise the run fails.

Why does my QFI result contain complex values?

QFI results should always be real because the QFI class temporarily forces the backend's derivative_type to REAL during execution. Complex values indicate the override was not applied, so verify your qiskit_algorithms version and backend configuration.

How does precision propagate from QFI to the estimator?

Setting QFI.precision propagates to the underlying BaseQGT and then to the estimator primitive at call time. Setting precision directly on the estimator may be overridden, so set it on the QFI object for consistent behavior.