vqd

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package vqd implements the Variational Quantum Deflation algorithm.

VQD finds multiple eigenvalues of a Hamiltonian by sequentially optimizing excited states. For each state k, it minimizes E(theta) + beta * sum_{j<k} |<psi_j|psi_k>|^2, where the overlap penalty deflates previously found eigenstates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Hamiltonian is the observable whose eigenvalues are sought.
	Hamiltonian pauli.PauliSum
	// Ansatz is the parameterized circuit template.
	Ansatz ansatz.Ansatz
	// Optimizer is the classical optimization method.
	Optimizer optim.Optimizer
	// Gradient is the gradient function. Nil means gradient-free.
	Gradient optim.GradientFunc
	// InitialParams are the starting parameters. Nil means zeros.
	InitialParams []float64
	// NumStates is the number of eigenstates to find. Default: 2.
	NumStates int
	// BetaPenalty is the overlap penalty weight. Zero means auto (2*|E_0|).
	BetaPenalty float64
}

Config specifies the VQD problem and solver.

type Result

type Result struct {
	// Energies are the eigenvalues found, one per state.
	Energies []float64
	// OptimalParams are the optimal parameters for each state.
	OptimalParams [][]float64
	// NumIters is the number of optimizer iterations for each state.
	NumIters []int
	// Converged indicates whether the optimizer converged for each state.
	Converged []bool
}

Result holds VQD output.

func Run

func Run(ctx context.Context, cfg Config) (*Result, error)

Run executes the VQD algorithm.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL