01Before choosing a quantum algorithm, choose the scientific question

A quantum workflow starts with a testable chemical question.

~12 min reading6 sections3 knowledge checks

Progress is saved only in this browser. No account or tracking.

One geometry is one question

Concept plate 01
NNR: specified nuclear separationGeometry + electronic model + target accuracy
A schematic nitrogen pair at a specified separation. Choosing a distance defines one point on an energy curve, not the entire bond-breaking process. The drawing is not to scale.
  • 1Specify nuclei and charge
  • 2Hold a chosen separation R
  • 3Request energy with an accuracy target
Original technical lesson · 1 contextual figure addedDownload original MarkdownJump to the interactive model

Imagine you have just joined the team.

A scientist comes to us and says:

“Can quantum computing help us understand what happens when a strong chemical bond starts to break?”

That sounds like a quantum-computing task. But the first work is neither quantum programming nor circuit generation.

Our first responsibility is to turn that question into something precise enough to calculate, check, and eventually cost.

1. Why nitrogen is a useful starting point

The nitrogen molecule, written N2\mathrm{N}_2, consists of two nitrogen atoms.

Each nitrogen nucleus contains seven positively charged protons. A neutral nitrogen molecule therefore has fourteen negatively charged electrons, balancing the total positive charge of its two nuclei.

The nucleus is the small, heavy central part of an atom. The electrons are the much lighter particles whose quantum behavior is central to chemical bonding.

A chemical bond is not a literal stick connecting two atoms. It is a situation in which the combined electronic and nuclear system can be energetically more favorable than the separated pieces.

Nitrogen has a particularly strong bond. Understanding how nitrogen becomes chemically reactive matters, for example, in the broader science of producing ammonia for fertilizer.

But we must immediately separate motivation from accomplishment:

Studying an isolated nitrogen molecule is not the same as simulating an industrial ammonia-production process.

An industrial process also involves other molecules, catalysts, temperature, pressure, and an environment. A catalyst is a substance that provides a different reaction route, often allowing a reaction to proceed more readily, without being consumed overall.

Our nitrogen calculation is a deliberately smaller problem. It isolates an important difficulty: describing electrons accurately as a bond stretches.

Why stretching makes the electronic problem interesting

Near its preferred bond length, nitrogen’s electronic state is reasonably described by a dominant pattern of electron occupation.

An electron occupation pattern, which we will later call a configuration, specifies which available one-electron states are occupied.

As the bond stretches, several such patterns can become important. A useful description must combine them rather than rely mainly on one.

This is part of what chemists mean by strong electron correlation: treating the electrons through a simple, nearly independent description becomes inadequate.

“Correlation” here does not mean that we merely observed two numbers moving together in a spreadsheet. It concerns the structure of the interacting many-electron quantum state.

That makes stretched nitrogen a useful place to study both:

  • where inexpensive classical approximations become less reliable; and
  • how better classical preparation can support a quantum algorithm.

It does not mean that this small nitrogen example requires a quantum computer. Its classical tractability is valuable because we can check the quantum workflow against a known reference.

2. Turn the question into a calculation

“Understand bond breaking” is too broad to hand to a program.

A more concrete question is:

For a specified distance between the nitrogen nuclei, what is the lowest electronic energy allowed by our chosen molecular model?

The positions of the nuclei are called the molecular geometry.

For a two-atom molecule, the most important geometric quantity is the distance between the nuclei. Call that distance RR.

The main teaching example in this repository uses a distance of 1.85 ångströms. An ångström, written Å, is a length unit equal to 10−1010^{-10} metres. It is convenient for atomic-scale distances.

For context, nitrogen’s equilibrium bond length is about 1.10 Å. “Equilibrium bond length” here means the preferred separation near the minimum of its molecular energy curve.

The teaching example is therefore substantially stretched.

The exact input is visible in tutorial_describe_n2.py.

That example also specifies:

  • Neutral charge: the total positive and negative charges balance.
  • A singlet state: the total electronic spin is zero.

Spin is an intrinsic quantum property of particles—not a claim that an electron is literally a tiny spinning ball. We will develop its meaning later. For now, a singlet specifies an important constraint on the electronic state we are studying.

A subtle point we will preserve throughout the course: total spin zero does not mean that every valid description must place every electron in a doubly occupied orbital.

A repository detail that already matters

The separate notebook qpe_stretched_n2.ipynb uses a different nitrogen geometry: 1.270025 Å.

Both examples are described as stretched nitrogen, but they are not the same numerical problem.

Consequently, we must not casually combine an energy from one example with a circuit or resource estimate from the other and present them as one calculation.

This is an early example of the engineering discipline the repository needs: the identity of the scientific problem must survive every software handoff.

3. What “energy” are we actually calculating?

The ground state is the lowest-energy quantum state of the specified model, subject to the conditions we have imposed.

A quantum state is a mathematical description from which probabilities of measurement outcomes can be calculated. It is not simply a list of the electrons’ positions.

For the first molecular calculation, we hold the nuclei fixed while solving the electronic problem. Later, we will explain the physical reasoning and limitations behind that approximation.

The fixed-geometry total energy contains two contributions:

Etotal(R)=Eelectronic(R)+Enuclear repulsion(R).E_{\mathrm{total}}(R) = E_{\mathrm{electronic}}(R) + E_{\mathrm{nuclear\ repulsion}}(R).

Here:

  • RR is the chosen nuclear separation.
  • EelectronicE_{\mathrm{electronic}} includes electron motion, attraction between electrons and nuclei, and repulsion between electrons.
  • Enuclear repulsionE_{\mathrm{nuclear\ repulsion}} accounts for the positively charged nuclei repelling each other.

This distinction becomes operationally important later. Some calculations operate on only a selected electronic contribution, while other contributions are carried separately and added back.

Losing or double-counting one of those contributions can produce a plausible-looking but incorrect final answer.

One geometry gives one point, not the whole bond-breaking story

Calculating the energy at 1.85 Å gives us one point.

Repeating the calculation at several separations gives an energy curve: energy as a function of nuclear distance.

That curve can help us study the preferred bond length, resistance to stretching, and eventual separation of the atoms.

One separation gives one point on an energy curve#

Supplementary · Analytical illustration

Relative energy E/Dₑ (dimensionless)
One separation gives one point on an energy curveRelative energy E/Dₑ (dimensionless) versus Separation x = R/Rₑ (dimensionless). Morse relative energy; Equilibrium minimum (1, −1). Exact assumptions and selected numerical values follow this plot.-1010.61234RepulsionStretchingDissociationOne separation gives one point on an energy curveRelative energy E/Dₑ (dimensionless) versus Separation x = R/Rₑ (dimensionless). Morse relative energy; Equilibrium minimum (1, −1). Exact assumptions and selected numerical values follow this plot.-1010.61234RepulsionStretchingDissociation
Separation x = R/Rₑ (dimensionless)
  • Morse relative energy
  • Equilibrium minimum (1, −1)

Dotted reference: Dissociation reference: E/Dₑ = 0.

Choose one fixed geometry

Selected x = 1.35 · E/Dₑ = −0.746574 · slope = 0.999953 · normalized force = −0.999953.

Model and source. Illustrative analytical model—not computed N₂ data. Set x = R/Rₑ and a = 2: E/Dₑ = (1 − exp[−2(x − 1)])² − 1. Rₑ and Dₑ are arbitrary scales, not nitrogen parameters. The dissociation reference is zero.

How to read this. Short distances are repulsive; the minimum is at x = 1. Stretching approaches the zero-energy dissociation limit. Moving the marker selects a geometry, not a time step.

Inspect plotted values

Selected coordinates from the declared analytical or teaching data. Continuous curves are sampled for drawing; discrete outcomes remain discrete.

One separation gives one point on an energy curve: plotted values
Seriesxy
Morse relative energy0.551.13044
Morse relative energy1.4125-0.68442
Morse relative energy2.275-0.150067
Morse relative energy3.1375-0.027631
Morse relative energy4-0.004951
Equilibrium minimum (1, −1)1-1
Return to this explanation

It is not automatically a simulation of a bond breaking over time. Calculating energies at fixed geometries and calculating time-dependent behavior are different tasks. This repository contains machinery for both, and we will keep their meanings distinct.

Nor does an electronic energy alone tell us how fast an industrial reaction occurs. Temperature, nuclear motion, the surrounding environment, and statistical effects also matter.

The repository’s energy-and-accuracy tutorial explicitly distinguishes its fixed-geometry energy from the additional thermodynamic quantities needed for such predictions.

4. Why we do so much classical work before any quantum work

Here is an important vocabulary distinction:

Classical computation means computation performed on an ordinary computer. It does not mean the chemistry being calculated follows classical rather than quantum physics.

An ordinary computer can solve equations of quantum mechanics. Most computational quantum chemistry does exactly that.

The difficulty is that accurately representing interacting electrons can become extremely expensive as the problem grows.

Before generating quantum circuits, we therefore need to make decisions such as:

  • How much mathematical detail will we use to describe each electron?
  • Which electron behavior is essential to the scientific question?
  • Which approximations are acceptable?
  • Can a classical method already answer the question adequately?
  • Can we construct a useful initial electronic state without solving the entire hard problem first?

Those decisions determine the problem the quantum computer would receive.

Classical preprocessing is therefore part of the scientific calculation, not merely file conversion before the “real” quantum work.

A poor choice here can make the quantum calculation unnecessarily expensive—or make it solve the wrong scientific problem extremely accurately.

The central distinction: model error versus solver error

Suppose we simplify the molecular description to make it manageable.

There are then at least two different questions:

How faithfully does the simplified model represent the molecule?

That is a question about the model.

How accurately does our algorithm solve that simplified model?

That is a question about the solver.

A perfect answer to the second question does not establish a good answer to the first.

A useful analogy is a building simulation: solving the equations perfectly does not repair an input model that omitted a load-bearing wall.

This distinction explains why the repository’s tutorial compares its quantum result with a classical reference for the same selected molecular model.

The tutorial uses one millihartree as a teaching target for that comparison. A hartree is an energy unit convenient for atomic physics; one millihartree is one thousandth of a hartree.

Meeting that target establishes agreement with the reference to the requested tolerance. It does not automatically establish agreement with experiment.

5. What makes a good candidate problem for this team?

Nitrogen is our teaching problem, but the selection principles generalize.

A promising project needs four things:

Requirement Why it matters
A meaningful scientific quantity We must know what decision an energy, energy difference, or other calculated property would inform.
A well-specified model Geometry, charge, spin, environment, and approximations must be clear enough to reproduce.
A credible classical comparison We need to know whether quantum computation addresses a real limitation rather than replacing an already adequate classical calculation.
A plausible end-to-end cost An attractive quantum algorithm is not useful if preparing its inputs, executing it reliably, or collecting enough measurements is prohibitive.

For a beginner’s example, we deliberately choose a problem small enough to solve classically. That lets us expose mistakes at every translation step.

For a proposed practical quantum application, we would instead need a defensible argument about where the best relevant classical approaches struggle—and why the complete quantum approach might help.

Running a quantum algorithm on a classical simulator is a way to study and check the algorithm. It is not, by itself, evidence of quantum computational advantage.

6. Where this repository fits—and where other teams enter

The Quantum Development Kit, or QDK, is the broader software ecosystem. QDK Chemistry is the chemistry-focused part we are examining.

Think of the work as a series of technical contracts: each participant supplies information that the next participant must interpret correctly.

The table below is a functional map, not a claim about Microsoft’s internal organizational chart.

Specialist or software boundary What comes into the workflow Why QDK Chemistry needs it
Chemistry and application specialists The molecular system, relevant conditions, target property, and acceptable scientific error. Software cannot decide what scientific question is valuable merely from a set of atomic coordinates.
Classical electronic-structure community Mathematical descriptions of atoms and electrons, numerical methods, integral-evaluation libraries, and reference calculations. These supply much of the machinery used to construct a tractable, meaningful chemical model.
QDK language, compiler, and simulator components Facilities for translating quantum programs, inspecting circuits, simulating their behavior, and counting operations. Chemistry-specific mathematical operations must become executable quantum instructions.
Quantum resource-estimation components Methods for combining computational demand with machine assumptions and exploring cost tradeoffs. A circuit alone does not tell us the physical machine size or runtime.
Quantum error-correction specialists and models Descriptions of how unreliable physical qubits can implement more reliable logical qubits, including associated costs and remaining error rates. Large computations must survive errors rather than assume every operation is perfect.
Hardware specialists and models Assumptions about physical operation times, error rates, and supported operations. Estimates depend on a specified machine model; these facts cannot be inferred from molecular chemistry.

A physical qubit is an actual device-level quantum information carrier.

A logical qubit is the more reliable information unit that a quantum algorithm can use when physical resources are combined through an error-correction scheme.

That distinction is fundamental. “This chemistry model needs twelve qubits” and “this calculation needs twelve physical qubits” are generally very different claims.

There are concrete software handoffs—not just conceptual arrows

The repository’s Circuit implementation exposes two resource-estimation routes:

  • Circuit.estimate() calls estimation facilities supplied by the broader QDK.
  • Circuit.get_qre_application() packages a circuit for the separate qdk.qre resource-estimation interface.

These are alternative interfaces, not two compulsory consecutive stages.

QDK Chemistry supplies the application-side workload. External estimator, error-correction, and hardware models supply much of the machinery that turns that workload into physical cost estimates.

We will examine both interfaces and their assumptions in detail. In particular, an energy tolerance—such as one millihartree—is not the same kind of quantity as a probability that an error-corrected computation fails. Both matter, but they cannot be substituted for one another.

One important limitation is already visible in the nitrogen resource-estimation notebook: it estimates one largest circuit from a multi-circuit energy-estimation procedure. That is a component estimate, not automatically the cost of every circuit, every repetition, and all the classical preparation needed to answer the scientific question.

Make the idea your own

Supplementary learning

The original lesson above is preserved in full, with labeled supplemental figures placed beside the relevant explanations. The model and questions below are also learning aids, not newly executed chemistry results.

Allocate a scientific error budget

Interactive model

Try allocating a scientific error allowance before committing it all to the quantum solver.

Illustrative model, not a scientific calculation. Each input is an illustrative, justified absolute error allowance in millihartree (mEh). Their sum is a conservative worst-case bound only if the individual bounds are valid. These are not measured uncertainties or hardware failure probabilities.

Enable JavaScript to explore this model. The assumptions and original lesson remain readable without it.

Check your understanding

Supplementary learning

Reason through these 3 questions. Your answers do not mark the lesson as read, and nothing is locked.

1. What makes “understand bond breaking” into a calculable first question?
2. What does a very precise solver result establish by itself?
3. How should the two resource-estimation interfaces be understood?

Enable JavaScript to check and save answers locally.

Source notes & references (4)

Original course lesson preserved from the teaching conversation. Mathematical illustrations and repository references are not newly executed chemistry results.

Public source: microsoft/qdk-chemistry, pinned to 97a3ff4fb86e. This course describes that revision, not every later release.

Look up a term

On this page

  1. 1. Why nitrogen is a useful starting point
  2. 2. Turn the question into a calculation
  3. 3. What “energy” are we actually calculating?
  4. 4. Why we do so much classical work before any quantum work
  5. 5. What makes a good candidate problem for this team?
  6. 6. Where this repository fits—and where other teams enter
  7. Interactive model
  8. Knowledge check
  9. Source notes

The complete journey

Course homeGlossarySavedAbout

Search the course

Search titles and the full lesson text.

    Tab to a result, Enter to open. Escape closes search.