Choosing a quantum algorithm starts with the problem, not the hardware or SDK. This guide compares practical algorithm families for search, optimisation, simulation, sampling, linear algebra and machine learning, then shows how to select a defensible proof of concept with a suitable classical baseline.
Overview
Quantum algorithm selection is often presented as a catalogue of famous names: Grover's algorithm for search, Shor's algorithm for factoring, the variational quantum eigensolver (VQE) for chemistry, or the quantum approximate optimisation algorithm (QAOA) for combinatorial problems. That list is useful for orientation, but it is not enough to choose an approach for a real project.
The first question should be: what computational task must the system perform? Is the input a graph, a vector, a probability distribution, a Hamiltonian, a database oracle or labelled training data? Is the required output an exact answer, an approximate solution, an expectation value, a sample from a distribution or a classification? These details determine which algorithm family is even relevant.
A second question is whether the proposed quantum method has a credible comparison point. A proof of concept should normally include a classical algorithm, a small reproducible dataset, a defined quality metric and a resource budget. Quantum hardware access alone is not evidence of advantage. For many current experiments, simulation and hybrid quantum-classical workflows are the most practical way to test assumptions before using a device.
The table below is a starting point rather than a ranking. Resource requirements depend on encoding, circuit construction, connectivity, error rates, precision targets and the implementation available in the chosen SDK.
| Problem type | Quantum families to investigate | Typical input | Output | Classical baseline | Main practical constraint |
|---|---|---|---|---|---|
| Unstructured search | Amplitude amplification, including Grover-style methods | Oracle or predicate marking valid items | Marked item or candidate | Linear scan or indexed search | Oracle construction and the cost of loading or accessing data |
| Optimisation | QAOA, quantum annealing or other variational approaches | Cost function, graph or constraint model | Candidate bit string or approximate solution | Integer programming, local search, simulated annealing or specialised heuristics | Ansatz quality, sampling overhead, noise and fair objective comparisons |
| Simulation and chemistry | VQE, phase-estimation-based methods and Hamiltonian simulation | Hamiltonian or operator decomposition | Energy, eigenvalue or evolved state information | Exact diagonalisation, tensor networks or classical chemistry methods | Precision, circuit depth, measurement cost and state preparation |
| Sampling | Quantum walks, circuit-based sampling and generative circuits | Probability model, circuit or distribution | Samples or estimated probabilities | Monte Carlo, Markov-chain methods or classical generative models | Verifying distribution quality and obtaining enough useful samples |
| Linear algebra | Quantum linear-system methods and amplitude-estimation-related methods | Structured matrix, vector and access model | Encoded state, expectation or numerical estimate | Direct, iterative or sparse numerical solvers | State preparation, readout, conditioning and assumptions about data access |
| Machine learning | Quantum kernels, variational quantum circuits and quantum-enhanced sampling | Feature vectors, labels or a generative target | Prediction, kernel value, parameters or samples | Linear models, tree methods, kernel methods and neural networks | Encoding overhead, trainability, data volume and generalisation evidence |
How to compare options
1. Define the problem mathematically
Translate the business or engineering requirement into a formal task before selecting an algorithm. For optimisation, write down the variables, constraints, objective function and acceptable approximation. For simulation, specify the Hamiltonian, initial state, observable and required precision. For machine learning, define the feature representation, labels, split strategy and evaluation metric.
This step prevents a common mismatch: choosing an algorithm because it is associated with a promising application area while the actual project has a different input or output structure. A scheduling problem, for example, may be expressible as a quadratic unconstrained binary optimisation model, but that does not automatically make a variational quantum approach the right first experiment.
2. Separate algorithmic promise from implementation feasibility
Some algorithms are attractive in theory but require capabilities that a near-term experiment cannot provide economically or reliably. Check the required qubit count, circuit depth, number of repetitions, connectivity, precision and classical post-processing. Include the cost of state preparation and measurement, not just the central circuit.
A useful resource checklist should cover width, depth, two-qubit gates, shots, memory, queue time and execution cost. The quantum circuit resource estimation guide provides a practical framework for making those assumptions explicit. If a circuit becomes much deeper after transpilation, the original algorithm comparison may no longer be meaningful.
3. Choose the right classical baseline
Compare against the strongest reasonable classical method for the same instance, data and stopping condition. A weak baseline can make a quantum prototype appear successful without demonstrating useful value. Select the baseline according to the task: a conventional numerical solver for linear systems, a classical optimiser for scheduling, a tensor-network or exact method for small simulations, and a standard machine-learning model for classification.
Record quality, runtime, memory, preprocessing, post-processing and implementation effort. If the quantum method uses repeated parameter optimisation, include the optimiser's full loop rather than reporting only circuit execution time.
4. Decide whether a proof of concept is justified
A good proof of concept has a narrow hypothesis. Examples include testing whether a particular ansatz can represent low-energy states on a small structured Hamiltonian, whether a quantum kernel separates a carefully chosen dataset, or whether a circuit sampler reproduces a target distribution under a defined noise model. Avoid broad claims such as “quantum will improve optimisation” without specifying the instance class and success metric.
Start with a simulator when you need rapid iteration, debugging and controlled comparisons. Move to hardware when device behaviour, noise, calibration, transpilation or execution variability is part of the question. For an end-to-end design, see the guide to hybrid quantum-classical workflows.
Feature-by-feature breakdown
Search and amplitude amplification
Grover-style methods are relevant when a problem can be expressed as finding marked items through an oracle. The theoretical speedup does not remove the need to build that oracle or load the search space. For a practical test, define the predicate clearly, measure oracle construction cost and compare against the actual classical search procedure. This family is a poor fit when data loading dominates the experiment or when the search structure is already efficiently indexed classically.
Optimisation and QAOA
Variational optimisation methods encode an objective into a parameterised circuit and use a classical optimiser to improve its parameters. They can be explored for graph and constraint problems, but performance is highly dependent on the encoding, ansatz, optimiser, parameter initialisation and instance structure. Compare solution quality at matched budgets, not just the best result found after unlimited tuning.
Constraint penalties also deserve attention. Poorly scaled penalties can distort the objective or make training difficult. Test whether the output is feasible before comparing objective values, and report how many samples are required to obtain useful candidates.
Simulation, VQE and phase estimation
VQE can be a reasonable near-term starting point when the target is an expectation value or low-energy estimate and a manageable Hamiltonian decomposition is available. Its hybrid loop makes it compatible with noisy experiments, but measurement overhead, ansatz expressiveness and optimisation stability can dominate the workflow.
Phase-estimation-based approaches may offer a different accuracy-resource trade-off, but they generally impose stronger requirements on state preparation, controlled operations and coherent circuit execution. Select between these families by working backwards from the precision target and available resources rather than treating one as universally superior.
Linear algebra
Quantum linear-system algorithms are often described using matrix inversion, but their usefulness depends on access assumptions, matrix structure, conditioning and how the answer will be read out. If the project requires a full classical vector, extracting it may remove the intended benefit. Begin by identifying the specific quantity needed: an expectation, a scalar estimate or a complete solution. Compare it with an iterative classical solver on the same sparse or structured matrices.
Quantum machine learning
Quantum machine-learning experiments should begin with the data pipeline, not the circuit. Decide how features will be encoded, whether the encoding cost is included and whether the dataset is large enough to support a meaningful evaluation. Quantum kernels and variational classifiers can be useful research vehicles, but they must be compared with simple classical baselines and tested for sensitivity to circuit depth, noise and training instability.
The quantum data encoding guide is useful when the representation itself is the main design decision. For all variational methods, maintain separate training and evaluation data and report repeated runs rather than a single favourable result.
Best fit by scenario
- You have a small combinatorial optimisation model: formulate the objective and constraints, then test a QAOA-style circuit against integer programming and heuristic baselines. Treat feasibility rate and solution quality as primary metrics.
- You need a small molecular or physical-system simulation: start with a Hamiltonian representation and compare VQE or another simulation method with exact or approximate classical calculations on the same reduced instance.
- You are investigating a search problem: establish whether an oracle can be implemented without excessive overhead. If not, improve the classical indexing or filtering method before considering amplitude amplification.
- You have a machine-learning dataset: build a classical reference pipeline first, then test a quantum kernel or variational model on a narrowly defined feature set. Include encoding and training cost in the comparison.
- You need a numerical estimate from a structured system: examine whether the output is a compact expectation value or a full vector. This distinction often determines whether a quantum linear-algebra approach is worth prototyping.
- You are unsure which category applies: create a small decision record containing the input type, output type, resource estimate, baseline, metric and reason for testing quantum hardware. That record is more valuable than selecting an algorithm name prematurely.
Implementation choice comes after this analysis. Qiskit, Cirq and PennyLane can support different workflow preferences, but an SDK cannot compensate for an unsuitable formulation. Compare tools only after the algorithm, data model and evaluation plan are clear; the SDK comparison and migration checklist can then help with the engineering decision.
When to revisit
Revisit the algorithm choice whenever the problem definition changes, the classical baseline improves, the data representation is redesigned or the proof-of-concept metric is no longer aligned with the intended use. Also review the decision when a new backend, simulator capability, error-mitigation method or SDK implementation changes the resource assumptions.
For a recurring review, capture the following:
- Problem formulation, instance sizes and data-access assumptions.
- Algorithm family, encoding, ansatz and transpiled resource estimates.
- Hardware or simulator configuration, shots, noise assumptions and execution conditions.
- Classical baselines, stopping criteria, quality metrics and total workflow cost.
- Results across repeated runs, including failed or infeasible outputs.
- The specific condition that would justify scaling the experiment or stopping it.
Review these records at least when a major project milestone is reached and on a regular editorial or technical cycle of roughly six months. Use the reproducibility checklist to make comparisons easier to repeat. If the proposed quantum method cannot beat, explain or complement its classical baseline under a fair test, change the formulation or stop the experiment. That is not a failure of quantum computing; it is the purpose of disciplined algorithm selection.