Tutorials
qcr:2606.72260.1

QCSchema Data Exchange in Qiskit Nature

This Qiskit Nature tutorial introduces support for the QCSchema, a standardized, machine-readable format for representing the inputs and outputs of quantum chemistry calculations, which improves interoperability and reproducibility across the chemistry-software ecosystem. The QCSchema (Quantum Chemistry Schema), developed by the Molecular Sciences Software Institute, provides a common JSON structure for molecular geometries, basis sets, computed integrals, and results, so data can be exchanged between different chemistry packages without bespoke converters. The tutorial shows how Qiskit Nature reads and writes QCSchema data: parsing a QCSchema produced by an external classical chemistry program into a Qiskit Nature electronic-structure problem, and exporting Qiskit Nature's molecular data in QCSchema form. It explains how this lets users bring in integrals and reference data computed by their preferred classical packages and feed them to quantum algorithms, decoupling the classical pre-processing from the quantum solve. By embracing a community data standard, the tutorial supports reproducible, interoperable quantum chemistry workflows. It is a practical guide to standardized chemistry data exchange in Qiskit Nature.
Chemistry
Qubit
Circuit-based
Uploaded 1 day ago
17
Views
GitHub390
Citing this entry? Use this QCR ID
Uploaded by
QL
QCR Librarian

Overview

qiskit-community/qiskit-nature
390233
In [ ]:
# --- Setup cell added by QCR (not part of the original tutorial) ---
# Source: qiskit-community/qiskit-nature @ 0.8, Apache License 2.0.
# Installs the example's dependencies. If a later cell still reports a missing
# package, restart the runtime/kernel and run again from the top.
%pip install -q qiskit-nature==0.8.0 pyscf

QCSchema

The QCSchema is a standard data format for quantum chemistry. The current version of it which has been adopted by multiple classical chemistry codes, only supports serialization via JSON, but their docs clearly indicate that HDF5 may also be used. Thus, in Qiskit Nature, we have opted for implementing support for both hierarchical data formats.

Now, why do we have a tutorial specifically about this format you may wonder? The reason is fairly simple: this is the data format which our drivers use internally to transfer data between the classical computation and Qiskit Nature. Thus, this tutorial will explain a few concepts, in case you want to get a bit more elaborate with your driver interaction.

Note: the support for electronic-repulsion integrals as part of the QCSchema is not yet part of the official specification and, thus, custom to Qiskit Nature. But we are working with the QCSchema authors to make this integration official!

For the purposes of this tutorial, we are using the PySCFDriver, but most discussion points should apply to the other electronic structure drivers, too.

First, let us construct a PySCFDriver and run it:

In [1]:
from qiskit_nature.second_q.drivers import PySCFDriver

driver = PySCFDriver()

problem = driver.run()
print(problem)
<qiskit_nature.second_q.problems.electronic_structure_problem.ElectronicStructureProblem object at 0x155041be1250>

This is basically short for the following:

In [2]:
from qiskit_nature.second_q.problems import ElectronicBasis

driver.run_pyscf()
problem = driver.to_problem(basis=ElectronicBasis.MO, include_dipole=True)
print(problem.basis)
ElectronicBasis.MO

There are two things to note here:

  • the problem is specifically requested in the MO basis
  • dipole integrals are handled separately (because the current QCSchema standard does not support these coefficients)

What this means for you as an end-user, is that you can also request the problem in another basis like so:

In [3]:
ao_problem = driver.to_problem(basis=ElectronicBasis.AO)
print(ao_problem.basis)
ElectronicBasis.AO

If you now want to transform an AO problem into the MO basis, you need to use the BasisTransformer which is explained in a separate tutorial.

This is the point, where you need to understand that the to_problem method actually relies on the to_qcschema method internally:

In [4]:
from qiskit_nature.second_q.formats.qcschema_translator import qcschema_to_problem

qcschema = driver.to_qcschema()
ao_problem = qcschema_to_problem(qcschema, basis=ElectronicBasis.AO)

Specifically extracting the QCSchema object from the driver allows you to later extract a BasisTransformer from it, without having to manually dig out the AO-2-MO transformation coefficients from the depths of the driver object:

In [5]:
from qiskit_nature.second_q.formats.qcschema_translator import get_ao_to_mo_from_qcschema

basis_transformer = get_ao_to_mo_from_qcschema(qcschema)
In [6]:
mo_problem = basis_transformer.transform(ao_problem)
print(mo_problem.basis)
ElectronicBasis.MO
In [7]:
import tutorial_magics

%qiskit_version_table
%qiskit_copyright

Version Information

Qiskit SoftwareVersion
qiskit-terra0.23.0.dev0+fca8db6
qiskit-aer0.11.0
qiskit-ibmq-provider0.19.2
qiskit-nature0.5.0
System information
Python version3.9.14
Python compilerGCC 12.2.1 20220819 (Red Hat 12.2.1-1)
Python buildmain, Sep 7 2022 00:00:00
OSLinux
CPUs8
Memory (Gb)62.501182556152344
Fri Oct 21 15:48:48 2022 CEST

This code is a part of Qiskit

© Copyright IBM 2017, 2022.

This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.

Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice indicating
that they have been altered from the originals.

Join the Discussion

Comments (0)

No comments yet. Be the first to share your thoughts!

Indexed by QCR Librarian

This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.

Versions

v1 Latest
Jun 17, 2026
qcr:2606.72260.1

Cite all versions? Use the base QCR ID to always reference the latest version of this entry.

Tools used

Qiskit

Keywords

qcschema
interoperability
quantum-chemistry
qiskit
data-format

You may also like5