Skip to content

Refactor + Optimize Fermion-to-Qubit Infrastructure with MajoranaMapping#475

Draft
wavefunction91 wants to merge 118 commits into
mainfrom
session/majorana-qubit-operators
Draft

Refactor + Optimize Fermion-to-Qubit Infrastructure with MajoranaMapping#475
wavefunction91 wants to merge 118 commits into
mainfrom
session/majorana-qubit-operators

Conversation

@wavefunction91
Copy link
Copy Markdown
Collaborator

This pull request introduces a new, encoding-agnostic Majorana mapping engine for fermion-to-qubit transformations in the chemistry package, along with a new MajoranaMapping data class. The API for the QubitMapper is updated to require an explicit MajoranaMapping argument, and the documentation and examples are revised to reflect these changes. Additional minor improvements and documentation updates are included.

Majorana Mapping Engine and Data Class:

  • Added majorana_map_engine.hpp and majorana_mapping.hpp, defining a new MajoranaMapping class for representing fermion-to-qubit encodings and a mapping engine (majorana_map_hamiltonian) that transforms fermionic Hamiltonians to Pauli strings using arbitrary encodings. Factory methods for standard encodings (Jordan-Wigner, Bravyi-Kitaev, Parity) are provided. [1] [2]
  • Registered new source files in the CMake build system for compilation.

API and Example Updates:

  • Updated the QubitMapper API and Python examples to require a MajoranaMapping argument, removing the previous string-based "encoding" configuration. Examples now explicitly construct the mapping and pass it to the mapper. [1] [2] [3]
  • Documentation for the QubitMapper is updated to describe the new required MajoranaMapping argument and its usage, including how to construct standard or custom encodings. [1] [2]
  • The section on symmetry-conserving Bravyi-Kitaev encoding is updated to reference the new factory method.

New and Improved Usage Examples:

  • Added new example notebooks and scripts demonstrating the creation and use of qubit Hamiltonians, the Trotter builder, and the new mapping workflow. [1] [2]

Minor Documentation and Import Fixes:

  • Updated import paths in release notes and ensured required dependencies are listed. [1] [2] [3]

v-agamshayit and others added 30 commits March 6, 2026 22:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@wavefunction91 wavefunction91 added this to the Release 2.0.0 milestone May 18, 2026
Generalize MajoranaMapping from "table of per-Majorana Pauli images" to
"fermion-to-qubit encoding," exposing the bilinear i*gamma_j*gamma_k as
the unified primitive that works in every encoding (including future
redundant encodings such as Bravyi-Kitaev superfast, Verstraete-Cirac,
and Derby-Klassen, where individual Majoranas have no Pauli image).

C++ (data/majorana_mapping.{hpp,cpp}):
  - New bilinear(j, k) -> (complex, SparsePauliWord), computed via
    PauliTermAccumulator::multiply_uncached with the
    i * phase_j * phase_k prefactor. Throws out_of_range /
    invalid_argument.
  - New majorana(k) alias for operator()(k).
  - New introspection hooks reserved for redundant encodings:
    is_majorana_atomic() (true), stabilizers() (empty),
    parity_sector() (0).
  - Expanded Doxygen with references (Chen-Xu-Boettcher 2023;
    Jiang-Kalev-Mruczkiewicz-Neven 2020).

Pybind11 + Python wrapper:
  - Bind bilinear, majorana, is_majorana_atomic, stabilizers,
    parity_sector. Map invalid_argument -> ValueError,
    out_of_range -> IndexError.
  - Document that for tapered encodings (e.g. SCBK) returned Pauli
    strings are in the pre-taper basis (len(table[0])), with tapering
    applied downstream by the qubit mapper.

Docs:
  - New "Bilinears as the unified primitive" section in the
    MajoranaMapping user doc; BdG / MZM clarifications; references.

Tests (TestBilinear, TestEncodingMetadata):
  - Parametrized over JW / BK / parity x n_modes in {2,3,4,6}; verify
    bilinear(j,k) == i*gamma_j*gamma_k, antisymmetry,
    (i*gamma_j*gamma_k)^2 = I, commutation / anticommutation by
    shared-index count, Hermitian (real +/-1 coefficient).
  - Hand-computed JW(n=2) values, error cases, and SCBK pre-taper
    length check.

All additions are backward-compatible; no public API was removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t-operators

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 23, 2026

📊 Coverage Summary

Component Coverage
C++ Library 76%
Python Package 76%
Pybind11 Bindings 87%

Detailed Coverage Reports

C++ Coverage Details
------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: cpp
------------------------------------------------------------------------------
File                                       Lines    Exec  Cover   Missing
------------------------------------------------------------------------------
include/qdk/chemistry/algorithms/active_space.hpp
                                               5       5   100%
include/qdk/chemistry/algorithms/algorithm.hpp
                                              70      55    78%   117,119-121,124,126-128,130-131,219,241,243-244,302
include/qdk/chemistry/algorithms/dynamical_correlation_calculator.hpp
                                               7       6    85%   115
include/qdk/chemistry/algorithms/hamiltonian.hpp
                                               5       5   100%
include/qdk/chemistry/algorithms/localization.hpp
                                               5       5   100%
include/qdk/chemistry/algorithms/mc.hpp       22      22   100%
include/qdk/chemistry/algorithms/mcscf.hpp
                                              13      13   100%
include/qdk/chemistry/algorithms/pmc.hpp       8       6    75%   41,186
include/qdk/chemistry/algorithms/scf.hpp      15      14    93%   23
include/qdk/chemistry/algorithms/stability.hpp
                                               5       4    80%   131
include/qdk/chemistry/data/ansatz.hpp          3       3   100%
include/qdk/chemistry/data/basis_set.hpp      35      30    85%   108-109,112,114,319
include/qdk/chemistry/data/configuration.hpp
                                              32      30    93%   71,119
include/qdk/chemistry/data/configuration_set.hpp
                                               3       2    66%   35
include/qdk/chemistry/data/data_class.hpp
                                               4       4   100%
include/qdk/chemistry/data/element_data.hpp
                                              18      18   100%
include/qdk/chemistry/data/hamiltonian.hpp
                                              12      12   100%
include/qdk/chemistry/data/hamiltonian_containers/canonical_four_center.hpp
                                               1       1   100%
include/qdk/chemistry/data/hamiltonian_containers/cholesky.hpp
                                               1       1   100%
include/qdk/chemistry/data/hamiltonian_containers/sparse.hpp
                                               1       1   100%
include/qdk/chemistry/data/lattice_graph.hpp
                                               3       1    33%   413-414
include/qdk/chemistry/data/majorana_mapping.hpp
                                               5       0     0%   68,140-142,154
include/qdk/chemistry/data/orbitals.hpp        6       6   100%
include/qdk/chemistry/data/pauli_operator.hpp
                                              88      83    94%   1203,1227,1262,1274,1288
include/qdk/chemistry/data/settings.hpp       93      69    74%   76,79,82,305-306,441,483,618,987,996,1011-1012,1016-1018,1022-1023,1025-1027,1029-1030,1119,1123
include/qdk/chemistry/data/stability_result.hpp
                                              38      38   100%
include/qdk/chemistry/data/structure.hpp       8       8   100%
include/qdk/chemistry/data/wavefunction.hpp
                                              25      19    76%   496,502,510-512,673
include/qdk/chemistry/data/wavefunction_containers/cas.hpp
                                               1       1   100%
include/qdk/chemistry/data/wavefunction_containers/cc.hpp
                                               1       1   100%
include/qdk/chemistry/data/wavefunction_containers/mp2.hpp
                                               1       1   100%
include/qdk/chemistry/data/wavefunction_containers/sci.hpp
                                               1       1   100%
include/qdk/chemistry/data/wavefunction_containers/sd.hpp
                                               1       1   100%
include/qdk/chemistry/utils/hash.hpp           4       4   100%
include/qdk/chemistry/utils/logger.hpp        41      35    85%   223-224,226,233-234,236
include/qdk/chemistry/utils/model_hamiltonians.hpp
                                             128     122    95%   59-60,89-90,137,141
include/qdk/chemistry/utils/string_utils.hpp
                                              11      10    90%   41
src/qdk/chemistry/algorithms/active_space.cpp
                                             232     142    61%   35-36,40-41,45-46,116-118,143-145,147,151-154,156-159,162-163,165-168,173-174,176-179,182-184,187-189,191,194-196,218,220,224,226-229,231-232,236-239,241,243,246-249,251,253,255-256,277-278,307,310,342,347-348,350-353,355-357,359-360,363,367,369-371,413,415,417
src/qdk/chemistry/algorithms/algorithm_defaults.cpp
                                              15       9    60%   41-45,49
src/qdk/chemistry/algorithms/dynamical_correlation_calculator.cpp
                                               8       8   100%
src/qdk/chemistry/algorithms/hamiltonian.cpp
                                              14      14   100%
src/qdk/chemistry/algorithms/localization.cpp
                                              15      15   100%
src/qdk/chemistry/algorithms/mc.cpp           11      11   100%
src/qdk/chemistry/algorithms/microsoft/active_space/autocas_active_space.cpp
                                              80      78    97%   103,133
src/qdk/chemistry/algorithms/microsoft/active_space/autocas_active_space.hpp
                                              16      16   100%
src/qdk/chemistry/algorithms/microsoft/active_space/entropy_active_space.cpp
                                              45      45   100%
src/qdk/chemistry/algorithms/microsoft/active_space/entropy_active_space.hpp
                                              10      10   100%
src/qdk/chemistry/algorithms/microsoft/active_space/occupation_active_space.cpp
                                              60      54    90%   46,48,81,83,101-102
src/qdk/chemistry/algorithms/microsoft/active_space/occupation_active_space.hpp
                                               6       6   100%
src/qdk/chemistry/algorithms/microsoft/active_space/valence_active_space.cpp
                                              75      63    84%   34,36,68-69,76-77,104-105,120-121,124-125
src/qdk/chemistry/algorithms/microsoft/active_space/valence_active_space.hpp
                                               9       9   100%
src/qdk/chemistry/algorithms/microsoft/cholesky_hamiltonian.cpp
                                             453     403    89%   98,102,420,439,442-443,462,473,476-477,507-508,557-558,564-566,573-574,581-582,613,616-617,632,640,642-644,679-683,765,767,779,785,798,804,866-867,869-870,873,978-979,981-982,985
src/qdk/chemistry/algorithms/microsoft/cholesky_hamiltonian.hpp
                                              12      12   100%
src/qdk/chemistry/algorithms/microsoft/hamiltonian.cpp
                                             248     228    91%   46-47,53-55,62-63,164-165,182-186,291,293,304,316,378,486
src/qdk/chemistry/algorithms/microsoft/hamiltonian.hpp
                                              11      11   100%
src/qdk/chemistry/algorithms/microsoft/localization/iterative_localizer_base.cpp
                                               5       5   100%
src/qdk/chemistry/algorithms/microsoft/localization/iterative_localizer_base.hpp
                                               8       8   100%
src/qdk/chemistry/algorithms/microsoft/localization/mp2_natural_orbitals.cpp
                                              79      74    93%   44,81,83,104,106
src/qdk/chemistry/algorithms/microsoft/localization/mp2_natural_orbitals.hpp
                                               3       3   100%
src/qdk/chemistry/algorithms/microsoft/localization/pipek_mezey.cpp
                                             169     160    94%   26,34,41,43,47,49,246,329,332
src/qdk/chemistry/algorithms/microsoft/localization/pipek_mezey.hpp
                                               6       6   100%
src/qdk/chemistry/algorithms/microsoft/localization/vvhv.cpp
                                             646     575    89%   336,338-339,452-453,476,534,695,739,741,746,762-765,768,778-781,784,819-821,827-831,859-862,865,887,889-891,968-972,1018-1022,1040-1043,1047-1050,1052-1054,1057,1131,1194-1196,1267,1286,1289,1293,1295,1300-1301
src/qdk/chemistry/algorithms/microsoft/localization/vvhv.hpp
                                               8       8   100%
src/qdk/chemistry/algorithms/microsoft/macis_asci.cpp
                                              69      66    95%   51,167,169
src/qdk/chemistry/algorithms/microsoft/macis_asci.hpp
                                              75      75   100%
src/qdk/chemistry/algorithms/microsoft/macis_base.cpp
                                              70      56    80%   29-31,91-92,95,99-100,103-105,112-114
src/qdk/chemistry/algorithms/microsoft/macis_base.hpp
                                              99      77    77%   84,86,88,90,92,94,205-207,209,212,214,217-219,221-223,225-227,229
src/qdk/chemistry/algorithms/microsoft/macis_cas.cpp
                                              59      56    94%   48,132,134
src/qdk/chemistry/algorithms/microsoft/macis_cas.hpp
                                               5       5   100%
src/qdk/chemistry/algorithms/microsoft/macis_pmc.cpp
                                              78      76    97%   110,149
src/qdk/chemistry/algorithms/microsoft/macis_pmc.hpp
                                               5       5   100%
src/qdk/chemistry/algorithms/microsoft/mp2.cpp
                                             202     184    91%   33,78,82-83,93-94,97,101-102,149-150,153-154,164-165,168,172-173
src/qdk/chemistry/algorithms/microsoft/mp2.hpp
                                               2       2   100%
src/qdk/chemistry/algorithms/microsoft/scf.cpp
                                             286     263    92%   62-63,75-76,91-92,118-119,149-150,158,160,214,261,332,364,369,371,397-399,418,489
src/qdk/chemistry/algorithms/microsoft/scf.hpp
                                              19      19   100%
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/basis_set.h
                                               9       8    88%   134
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/enums.h
                                              16       0     0%   38-39,48-49,54-59,70-75
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/eri.h
                                              15      12    80%   46-47,49
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/exc.h
                                               3       3   100%
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/moeri.h
                                               3       3   100%
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/molecule.h
                                               1       1   100%
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/eri/eri_multiplexer.h
                                               6       3    50%   126-127,135
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/util/cache.h
                                              27      26    96%   44
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/util/class_registry.h
                                              13      13   100%
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/util/gauxc_registry.h
                                               6       5    83%   39
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/util/gauxc_util.h
                                              21      21   100%
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/util/int1e.h
                                               2       2   100%
src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/util/singleton.h
                                              13      13   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/core/basis_set.cpp
                                             361     279    77%   33-34,92-93,97-98,146,150-154,157-161,172,183-184,188,190-191,197-198,201-206,210,212-215,217,219,223,225-226,228-229,231,248,257,265-266,313-314,335,337,342-343,345-346,348,401,406-407,415,436,458,460-461,463-465,478,480,482-485,487,490,493-494,542,544,548-549
src/qdk/chemistry/algorithms/microsoft/scf/src/core/scf.cpp
                                               7       7   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/eri.cpp
                                              36      29    80%   58-60,65-66,89-90
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/eri_df_base.cpp
                                              34      32    94%   29-30
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/eri_df_base.h
                                               2       2   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/eri_multiplexer.cpp
                                              61      37    60%   16-17,26-29,40,46-49,52-55,79,81,83-85,87-88,91,93
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/INCORE/incore.cpp
                                              42      29    69%   40,42,44,66,68,70-72,74-75,77-79
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/INCORE/incore_impl.cpp
                                              96      88    91%   44,136,138,235,237,239,287,289
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/INCORE/incore_impl_df.cpp
                                             102      60    58%   86-87,89,203,205,207-214,216-221,224,227-233,236,253,256,263-264,286,291,305-306,309,320-321,323-324,326
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/LIBINT2_DIRECT/libint2_direct.cpp
                                             182     169    92%   268,606,608,610,908,910-913,916,918-920
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/moeri.cpp
                                              36      34    94%   32-33
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/schwarz.cpp
                                              33      13    39%   80-81,83-88,90-93,95-98,101-102,104,106
src/qdk/chemistry/algorithms/microsoft/scf/src/eri/SNK/snk.cpp
                                              66       0     0%   36,58-60,62-65,67,69-70,72,98,100,102-104,107-110,114-116,119-121,124-127,146,148,150,167-168,170,187,191,193-194,200-201,203,205-207,209,212,214,216-218,221,223,225-227,230,232,234-235,239-240,242-243
src/qdk/chemistry/algorithms/microsoft/scf/src/exc/exc.cpp
                                              16      14    87%   42-43
src/qdk/chemistry/algorithms/microsoft/scf/src/exc/GauXC/gauxc.cpp
                                              34      25    73%   42,46-47,50-52,54,56,67
src/qdk/chemistry/algorithms/microsoft/scf/src/exc/GauXC/gauxc_impl.cpp
                                             229     163    71%   79,119,160-161,249-258,260,262-270,352-353,360-364,366,368-377,380-381,383-384,387-389,396,398-399,405-409,411,413-417,419-420,426
src/qdk/chemistry/algorithms/microsoft/scf/src/scf/cpscf.cpp
                                             234     232    99%   232,237
src/qdk/chemistry/algorithms/microsoft/scf/src/scf/guess.cpp
                                              63      63   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/scf/ks_impl.cpp
                                              81      63    77%   73,75-82,140,155-158,160-161,171-172
src/qdk/chemistry/algorithms/microsoft/scf/src/scf/scf_impl.cpp
                                             547     414    75%   73,101,116,122,168-169,185-186,329-330,339-342,467,471,551,588,607-609,676,715-716,720-721,730-735,745,749-752,754-761,774-778,780-783,785-786,793-794,796-801,803-808,810,818-821,831-832,843-845,859-864,867-870,873,876,878,977-979,982,984,988-989,991-995,997-1000,1002-1003,1007,1009,1011-1019,1022-1025,1028-1030,1032,1034,1053,1055
src/qdk/chemistry/algorithms/microsoft/scf/src/scf/scf_impl.h
                                              21      16    76%   98-100,113,161
src/qdk/chemistry/algorithms/microsoft/scf/src/scf/scf_solver.cpp
                                              82      54    65%   35,37,51,55-59,66,68,90,92-93,101-103,111-113,126-128,131-133,141-143
src/qdk/chemistry/algorithms/microsoft/scf/src/scf/soad.cpp
                                              15       0     0%   189,192-204,208
src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/asahf.cpp
                                             286     275    96%   49,51,68-69,101,271,464-465,506,530-531
src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/diis.cpp
                                             278     259    93%   147,149,158-159,228,234,241,246,268-269,286,486-489,511,520,528,536
src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/diis_gdm.cpp
                                              36      36   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/gdm.cpp
                                             401     366    91%   226,249,272,443-446,449-452,478-482,487,518-522,664,667-673,805,809,899,903,905
src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/line_search.h
                                              63      62    98%   60
src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/scf_algorithm.cpp
                                             143     130    90%   63,71-73,75,85-88,175-176,205,264
src/qdk/chemistry/algorithms/microsoft/scf/src/util/gauxc_util.cpp
                                              85      20    23%   26-31,34-43,48-49,52-59,63-66,68,70,72-74,81-88,92-99,106-111,115-118,122-123,134-135
src/qdk/chemistry/algorithms/microsoft/scf/src/util/int1e.cpp
                                             336     226    67%   206-209,211,243,288,290-296,298-303,305-311,314-315,326,328-329,569,592,622,699,702-703,705,713,755,757-758,762-771,780,782-783,787-796,805,807-808,812-824,826-829,838,941-942,946-954,956-962,964-967,976
src/qdk/chemistry/algorithms/microsoft/scf/src/util/libint2_util.cpp
                                             181      91    50%   39,42-45,47,49-51,53-54,58-60,64-66,72,74,76-79,81-82,85-91,94-95,97-102,104-107,109-119,125-126,477,483-490,492-495,497,499,503-504,506,560,562,566-569,571-573,576,580-582,584,627
src/qdk/chemistry/algorithms/microsoft/scf/src/util/matrix_exp.cpp
                                              53      53   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/util/mpi_vars.h
                                               2       2   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/util/opt/gmresxx/arnoldi/arnoldi.h
                                              12      12   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/util/opt/gmresxx/arnoldi/arnoldi_gmres.h
                                             202     168    83%   53-55,176,183,185-188,190-194,196,198,202,205,209,212,217-218,221,223,290,293-294,298,481-482,493,522-523,589
src/qdk/chemistry/algorithms/microsoft/scf/src/util/opt/gmresxx/linalg.h
                                              40      40   100%
src/qdk/chemistry/algorithms/microsoft/scf/src/util/timer.h
                                              29      29   100%
src/qdk/chemistry/algorithms/microsoft/stability.cpp
                                             310     287    92%   192-193,322-324,389,391,408,411-420,424,426,430,432,471
src/qdk/chemistry/algorithms/microsoft/stability.hpp
                                              13      13   100%
src/qdk/chemistry/algorithms/microsoft/utils.cpp
                                             248     171    69%   45-46,52,54,111-112,123-124,126-127,133,135,138-139,141,143-147,150-151,182,184,186,190-191,195,198-205,207-209,211,214-218,220-225,227-229,231,234-235,237,240-245,251,253-255,258-262,387-388,427,429
src/qdk/chemistry/algorithms/pmc.cpp           8       8   100%
src/qdk/chemistry/algorithms/scf.cpp           7       7   100%
src/qdk/chemistry/algorithms/stability.cpp
                                               6       6   100%
src/qdk/chemistry/data/ansatz.cpp            553     380    68%   26,36,39,46-48,50-51,53,55-56,58-60,62,69,84,99,104-105,107-108,115,120,122,148,150,207,209,280,295,297,302-303,336-340,345,347,357,359,362,364,374,376,379,381,394,396,401,403-404,410,412,417,419-420,434,436,441,443-444,449,451,456,458-459,461-462,464,468-469,471-472,474-475,477-478,480-484,486-487,489,492,495-500,502-503,506-508,510,513,515-516,549,559,569,579,601,608,612,626,630-631,641,651-652,659,668,684-687,690-691,694-696,698-699,701-703,719,727,744-747,782-783,792-793,804,812-813,824,835-836,843,852,869-872,875-876,879-881,883-884,886-888,894-895,906-907,931-934
src/qdk/chemistry/data/basis_set.cpp        1438    1250    86%   31,38,70,91-92,221,225,259-260,276-277,326-327,341,361,387,402,433,460,493,506-507,513-514,529-530,545-546,565,568-569,615,618-620,648,651-653,719,761,785,814,845,881,914,936,966,1006,1023,1032,1050,1067,1079,1090,1180-1181,1235,1249,1262,1276,1291,1298,1308,1310,1317,1331-1332,1465,1522-1523,1537-1539,1541-1542,1548-1551,1560-1561,1727,1791-1792,1805-1806,1906,1914,1926,1962-1966,1968-1970,1973-1977,2010,2024-2028,2031-2040,2042-2045,2047-2051,2053-2055,2058-2061,2065-2066,2068,2070-2074,2077-2078,2082-2086,2090-2092,2098-2101,2103-2105,2108,2110,2112,2132-2133,2142-2143,2151-2153,2160-2161,2181-2182,2184,2201-2203,2268-2269,2271-2276,2282,2390
src/qdk/chemistry/data/configuration.cpp     279     171    61%   67,167,170,172-173,176-177,179-180,183-184,186,190,194-195,204,210,236-238,266-268,271-272,274-283,285,287,289-292,294-295,297,299-300,302-304,307-308,310-311,313,315-316,318-325,327,329,331-334,336-337,341-342,344-348,351-352,354-355,358-359,361-368,370-371,373-381,421-422,432,434
src/qdk/chemistry/data/configuration_set.cpp
                                             328     209    63%   33-34,85-87,90-92,234,247,272-277,287-288,331-333,350-354,356,376-377,400-402,421,425,427,429,431-434,436-437,439,441-442,444-447,450-451,453-455,458-463,465-466,468-478,480,482,484-487,489-490,494-495,497-501,503,506-508,510-514,517-524,526-527,529-540
src/qdk/chemistry/data/filename_utils.hpp
                                              44      26    59%   30-33,35-36,51-53,72-75,77-78,93-95
src/qdk/chemistry/data/hamiltonian.cpp       554     400    72%   41,46-47,68,73-74,82,95,97-99,102-104,108-115,132,140,160-162,194-195,213-217,232-236,241,243,249,251,269,271-274,311,322,324,328,331,409-422,424,427-428,431-434,436-439,442-445,447-450,454-457,459-462,465-469,471-474,476-479,481-484,487-488,494,508,517-518,536,539-540,572,585,597,610,623,636,643,662,680,687,694,701-703,709,720-721,741-742,758-759,767-768,793-797,826,828-829,892-894
src/qdk/chemistry/data/hamiltonian_containers/canonical_four_center.cpp
                                             420     360    85%   38-39,67-68,98,110,128-129,156,163,169-171,204-205,213,276,309,349,353,361,373,385,391-392,423,432,437-438,443-444,462,470,477-484,487-494,514-516,597-598,607-608,634,656,721-722
src/qdk/chemistry/data/hamiltonian_containers/cholesky.cpp
                                             474     303    63%   44-45,72-73,86-90,103,162-165,167-168,172-174,177,179,181-182,185-187,190-191,194-195,198-207,209-210,227,234,240-242,265-270,279-280,328-331,333,335-338,340,364-367,369,371-374,377,382,384-387,389,391-393,396-400,402,404-408,417,432,440,452,468-469,487-488,490,499,504,506,510-511,516-517,519,521,530-531,534-537,543,550-557,560-567,585,588,592-594,642-643,651-652,658-662,673,677-678,687-688,714,736,753,764-766,772-773,779-780,786-787,798,801,805-806
src/qdk/chemistry/data/hamiltonian_containers/sparse.cpp
                                             396     347    87%   89,103,153-155,212,232-235,260-263,364-366,398,435-441,443,471-479,481,484,487-488,494-497,506-507,512,600,609,625
src/qdk/chemistry/data/hdf5_error_handling.hpp
                                              10       3    30%   20-21,23,25-26,28-29
src/qdk/chemistry/data/hdf5_serialization.cpp
                                             240     119    49%   13,15-22,24,26-32,34,36-44,46,48-56,65-67,69-71,73-74,77-79,82-85,95,98,106-109,111-113,115-116,119-121,124-127,138,141,143-150,153-160,238-240,249-251,253-255,258-260,277-280,282-286,288-289,308-310,312-316,318-319
src/qdk/chemistry/data/json_serialization.cpp
                                             177      86    48%   29,38,45-47,57,64-68,70-71,83,90-92,94-98,100,102-103,105,114,120-121,128-129,131,133-134,136-139,141,143-146,148-149,152-153,155,163-164,173,178-179,188-189,196,201,210,212,214,216-217,219-222,225-229,231-236,246-249,252-256,260-264
src/qdk/chemistry/data/lattice_graph.cpp     590     320    54%   39-42,53-56,102,104-105,107-110,112,114-115,117-120,169,196,199,202,245,248,251,306,309,312,359,362,365,445,456,524,612,626,639-640,642-649,651,653,655-658,660-661,663,665-666,669-673,677-680,682-685,687-688,690-691,693-694,696-698,700-702,704,706-707,709-710,713-715,718-721,724-726,728-736,740-742,745-755,757-765,767-768,770-777,779,781,783-786,788-789,793-794,796-800,802-805,807-808,810-811,813-814,816-817,820-821,823-832,834,836-839,841-848,850-851,853-854,856-857,859-864,866-867,869-877,879-881,884-886,888-890,892-895,897-898,900,902-913,915,918-921,923-937,939-940,942-943
src/qdk/chemistry/data/majorana_map_engine.cpp
                                             268       0     0%   41-43,45,50-53,55-56,58,63-70,73,77-91,94-95,98,100-113,115,119,121-129,135,137-138,141,144-146,148,150-154,157-158,191,196,198,206,210-212,214-225,228-229,231-232,234,236,238,240,244-245,248,250-255,257-259,265-267,270,272,276-282,284-285,287-288,290-291,295-299,301-303,310-311,314,316-326,332,335-336,338-343,347-349,351-353,356-359,362,367-374,376-377,379,381-385,389-393,402-404,406-413,415-417,419-421,423,425-427,435-441,443-444,452-458,460-461,469-475,477,486,488-490,492-494,497-498,516,521-523,525,527,529-533,536,538,540
src/qdk/chemistry/data/majorana_mapping.cpp
                                              85       0     0%   17,20-26,28,30-31,33-34,36-37,39-40,43-50,52,55-57,59,64-66,68-75,79-84,88-90,93-95,97,99-102,104,108-114,116-120,122-124,126-127,130,132-138,142
src/qdk/chemistry/data/majorana_mapping_factories.cpp
                                             206       0     0%   16-17,19,23-27,29-34,36-37,39-51,53-54,56-60,62-67,69-76,78-79,81-83,85-87,90-93,96-97,99,101-102,113-116,119-120,122-125,127-128,130-132,134-136,138-139,143-146,149,151-152,154-157,159-160,162-167,169-173,175-176,178-179,181-185,187-188,190-192,194-195,199-202,205-206,208,210-216,218-219,222-223,225-229,232-234,236-241,246-247,249-253,255-256,258-259,261-265,267-268,270-272,274-275,279-282,285-286,288-292,294-295,297-298,300-304,306-307,310-311
src/qdk/chemistry/data/orbitals.cpp         1198     926    77%   106-107,128,144-145,151-152,156-157,178,180,220-221,237,251,292,307,321,363,373,377,400,403,405-406,409-413,416-417,421-424,426-427,429,431,433-434,437-440,443,447,449,453,455,457-458,461-467,470-471,474-475,477-478,480,482,484-485,488-492,495,498,500,563-567,570-571,573-574,576-577,580-581,584,586,589-590,592-593,595-596,599-601,604,606,609-610,612-613,615-616,619-620,623,625,665,667,673,675,679,681,690,758,769,775,780,807,817,861-865,903,916,928,941,961,979,988,1064-1067,1082-1083,1108-1112,1120-1121,1152-1154,1167-1169,1194-1195,1204-1205,1211-1212,1218-1219,1221-1222,1225-1226,1228-1229,1249-1250,1256,1298-1299,1327,1333,1337-1338,1381-1385,1413-1414,1416-1420,1423,1426,1428,1431,1433,1436,1438-1440,1442-1444,1447-1449,1451-1453,1455-1458,1477-1479,1482-1484,1487-1489,1551-1552,1581-1583,1598-1600,1634-1635,1647-1648,1806-1810,1823-1824,1827,1830-1831,1834-1836,1838,1877,1914,1929-1931,1980-1981,2016-2017,2023-2024,2030-2031,2033-2034,2037-2038,2040-2041,2048,2064-2065
src/qdk/chemistry/data/pauli_operator.cpp
                                             756     683    90%   60,63,87-88,190,202-203,224,397,407,421-423,517,555-557,559-561,577-579,581-583,606,609,721,806,818,820-821,855,860-862,877,882-884,912,938-942,944,946,951,956,996,1014-1016,1029,1036-1037,1039-1044,1062,1073-1076,1202,1222,1300,1343
src/qdk/chemistry/data/settings.cpp         1236     599    48%   40-43,68-70,81,85,95-101,126-134,136-140,158-163,166-169,171-175,177-181,183,185-188,190-195,197-201,203-213,217-226,239,243,280,292-295,297-299,302-306,308-309,311-313,315-316,318-319,362-363,366,381,412-413,416-418,420-425,427,429-434,437,457-461,464-465,468,470,476,478,480,484,486,488,492,536-537,539,541,543-544,546-549,553-554,556-558,561-562,566-568,571-573,577,579,582-587,592-596,598-608,610-613,615-619,621-625,628,632-635,639-643,647-650,653-657,659-660,662,664-667,669-671,673-674,676-678,680,682-684,686-690,693-697,699,701-703,705-707,709-713,716-720,722,724-726,729-731,733,736-738,741-742,745-752,754-755,757-758,761-762,764-770,773-779,783,786-787,790-791,794-795,798-799,802-806,808,810,812-813,815-818,820-821,823-824,826-829,831-832,834,836-839,842,844-847,851-856,860-861,863,865-868,872,875-876,889,895,898,905,908,916,920,941-942,959-962,971,974,982-983,999-1004,1006,1008-1009,1052-1055,1057-1059,1071-1072,1084,1086,1231,1235-1238,1240-1241,1244,1246-1248,1250-1253,1255-1259,1264,1266-1269,1272,1274-1275,1281-1282,1285-1290,1292,1296,1298,1301,1308,1312-1314,1320,1324,1327-1328,1333,1335-1337,1341,1386,1393,1411,1462-1464,1494,1500-1503,1525-1526,1561-1562,1564,1593-1595,1614-1619,1645-1647,1649,1651-1652,1655-1657,1659-1661,1667,1688-1695,1698-1701,1757,1785,1800-1802,1808-1816,1818,1821-1824,1826-1835,1837-1846,1849-1856,1858-1860,1863-1873,1875-1880,1882-1884,1886-1892,1894-1896,1898,1900,1902-1906,1908-1912,1914-1916,1918-1919,1921-1928,1930-1939,1941-1943,1945-1947,1963
src/qdk/chemistry/data/stability_result.cpp
                                             317     292    92%   25,32,42,176,213,218,271,281,299,315,344,346,350,356,379,419,421,425,451,458,503-507
src/qdk/chemistry/data/structure.cpp         761     703    92%   86,101,115-116,127,140,159,176-177,204,245-246,295,479,492,512,530,649,665,802,816,964-966,974-975,985,995-996,1018-1019,1027,1055-1057,1063,1076,1122-1123,1126,1132-1135,1138-1147,1151-1153,1156
src/qdk/chemistry/data/wavefunction.cpp     1319    1137    86%   45,65,175,178,186-188,269-270,286,307-310,312-315,318,336-341,344,386,417,454,467,488,493,509-510,531,548,551,574,577,580-589,620-626,628-630,732-741,838-842,937-939,984,998,1011,1013,1018,1020,1042-1043,1102,1104-1105,1119,1121,1124-1125,1146-1149,1151,1186,1188-1189,1214,1231,1357,1456-1459,1487,1494,1500,1507,1523,1529-1531,1537,1548,1578-1579,1594-1595,1602-1603,1623,1628-1629,1635,1646,1682,1792-1793,1803-1804,1831,1857-1858,1888-1889,1961,1963,1966-1967,1975-1977,1995-1997,1999-2000,2006-2009,2012-2022,2024-2025,2027-2030,2033-2036,2038-2040,2042-2043,2045-2046
src/qdk/chemistry/data/wavefunction_containers/cas.cpp
                                             252     199    79%   76-77,79-82,84-85,87-88,90,92-93,95-96,98-99,101,116,161-162,166,168,172,174,178-179,191-193,199,201-204,207-210,227-228,231-232,337-339,359,377-378,387,398,421-422
src/qdk/chemistry/data/wavefunction_containers/cc.cpp
                                             878     525    59%   48,52,57,59,62,66,71-72,74-77,79,87-88,122-127,153-160,169-175,203-204,206-220,222-224,226-228,231,233-234,250,258-259,261,267,277,287,299,319,324,326-328,331-334,337,339-340,343,345-349,351-352,354-355,358-359,381-383,385-387,389-391,393-395,397-399,425,432,463-466,528-529,595-596,599,601,603,606-607,609-610,612,615,617-620,622-624,627-628,630,633,637,639-640,643,687,696-697,699,705-706,708-709,716,728,737-738,747-748,754,790,800,810,820,830,841,940-950,952-956,969-979,981,983-985,1058-1069,1071-1083,1085-1091,1093-1100,1115-1126,1128-1140,1142-1148,1150-1156,1171-1181,1183-1195,1197-1200,1202,1204-1207,1223-1232,1234-1246,1248-1251,1253-1257,1322-1324,1326-1327,1330,1332-1333,1335,1337-1338,1342-1344
src/qdk/chemistry/data/wavefunction_containers/mp2.cpp
                                             626     433    69%   32,36,40-41,45-47,60-62,78,85,110,139,150-151,178-179,227-228,243,313,318,320-322,325-327,330-333,336-341,343-349,351-353,374,437-438,468-469,477,490-492,494,498-500,502,535,544-545,547,553-554,556-557,564,576,585-586,606,623-624,627-628,631,633-639,641-644,646,648,650,652-658,660-663,665,667,669,671-677,679-682,684,688-697,703-712,718-727,734-736,738-739,743,745-746,748-750,754-757,759,925,931,933,964-965,968-969,973,975,1006,1023,1057,1081,1083,1088,1092-1102
src/qdk/chemistry/data/wavefunction_containers/sci.cpp
                                             213     176    82%   78-79,81-84,86-87,89-90,92,94-95,97-98,100-101,103,117,151,153,155-156,166-167,170-171,260-262,282,300-301,310,321,344-345
src/qdk/chemistry/data/wavefunction_containers/sd.cpp
                                             399     336    84%   17,42-46,54,56-60,111,113,118,120,136-137,140,143-144,156,158,161-162,200,202,205-206,275,277,280-282,309,311,314,316,369,371,467,497-498,501,511-512,515,562,571,577,591,599-602,646-647,664-665,683-684,694-695
src/qdk/chemistry/utils/logger.cpp           120     115    95%   201-203,237,281
src/qdk/chemistry/utils/orbital_rotation.cpp
                                              93      56    60%   60-62,140-142,145,149-150,152,154-155,176,178,180,182,185-186,188,192-193,196-197,200,202-203,205,208-211,214,218-219,221,223-224
src/qdk/chemistry/utils/valence_space.cpp
                                              57      54    94%   73,102,106
------------------------------------------------------------------------------
TOTAL                                      23474   17896    76%
------------------------------------------------------------------------------
Python Coverage Details
SKIPPED [1] tests/test_interop_qiskit_noise_model.py:93: Qiskit Aer not available
SKIPPED [1] tests/test_interop_qiskit_noise_model.py:103: Qiskit Aer not available
SKIPPED [1] tests/test_interop_qiskit_noise_model.py:109: Qiskit Aer not available
SKIPPED [1] tests/test_interop_qiskit_noise_model.py:126: Qiskit Aer not available
SKIPPED [1] tests/test_interop_qiskit_phase_estimation_standard.py:132: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_phase_estimation_standard.py:167: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_phase_estimation_standard.py:202: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_qir.py:22: Qiskit not available
SKIPPED [3] tests/test_interop_qiskit_qubit_mapper.py:32: Qiskit Nature not available
SKIPPED [1] tests/test_interop_qiskit_qubit_mapper.py:69: Qiskit Nature not available
SKIPPED [1] tests/test_interop_qiskit_state_prep_energy_validation.py:34: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_state_prep_energy_validation.py:74: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_state_prep_energy_validation.py:125: Qiskit not available
SKIPPED [6] tests/test_interop_qiskit_state_prep_energy_validation.py:188: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:51: Qiskit not available
SKIPPED [4] tests/test_interop_qiskit_transpiler.py:71: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:91: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:108: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:121: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:134: Qiskit not available
SKIPPED [5] tests/test_interop_qiskit_transpiler.py:152: Qiskit not available
SKIPPED [3] tests/test_interop_qiskit_transpiler.py:174: Qiskit not available
SKIPPED [3] tests/test_interop_qiskit_transpiler.py:192: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:212: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:225: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:242: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:257: Qiskit not available
SKIPPED [4] tests/test_interop_qiskit_transpiler.py:271: Qiskit not available
SKIPPED [3] tests/test_interop_qiskit_transpiler.py:292: Qiskit not available
SKIPPED [3] tests/test_interop_qiskit_transpiler.py:310: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:330: Qiskit not available
SKIPPED [1] tests/test_interop_qiskit_transpiler.py:343: Qiskit not available
SKIPPED [1] tests/test_phase_estimation_iterative.py:296: Qiskit not available
SKIPPED [1] tests/test_phase_estimation_iterative.py:362: Qiskit not available
SKIPPED [1] tests/test_phase_estimation_iterative.py:635: Qiskit not available
SKIPPED [1] tests/test_qdk_qubit_mapper.py:810: Qiskit Nature not available
SKIPPED [1] tests/test_qdk_qubit_mapper.py:1037: Qiskit Nature not available
SKIPPED [1] tests/test_sample_workflow.py:238: Skipping slow test. Set QDK_CHEMISTRY_RUN_SLOW_TESTS=1 to enable.
SKIPPED [1] tests/test_sample_workflow.py:262: Skipping slow test. Set QDK_CHEMISTRY_RUN_SLOW_TESTS=1 to enable.
SKIPPED [1] tests/test_sample_workflow_openfermion.py:35: OpenFermion not available
SKIPPED [1] tests/test_sample_workflow_qiskit.py:43: Qiskit dependencies not available
SKIPPED [1] tests/test_sample_workflow_qiskit.py:65: Qiskit dependencies not available
SKIPPED [1] tests/test_sample_workflow_qiskit.py:107: Qiskit dependencies not available
SKIPPED [1] tests/test_state_preparation.py:47: Qiskit dependencies not available
SKIPPED [1] tests/test_state_preparation.py:85: Qiskit not available
========== 1690 passed, 145 skipped, 4 warnings in 998.25s (0:16:38) ===========
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7d7d8e65b970>
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7d7d8f77d030>
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7d7d90b75b70>
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7d7d7c1e2c50>
Pybind11 Coverage Details
------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: .
------------------------------------------------------------------------------
File                                       Lines     Exec  Cover   Missing
------------------------------------------------------------------------------
src/pybind11/algorithms/active_space.cpp      38       38   100%
src/pybind11/algorithms/davidson_solver.cpp
                                              35       34    97%   28
src/pybind11/algorithms/dynamical_correlation_calculator.cpp
                                              31       31   100%
src/pybind11/algorithms/factory_bindings.hpp
                                             288      239    83%   32,32,32,32,32,32,32,32-33,33,33,33,33,33,33,33-34,34,34,34,34,34,34,34-35,35,35,35,35,35,35,35-36,36,36,36,36,36,36,36,249,249,249,249,249,249,249,249,249
src/pybind11/algorithms/hamiltonian.cpp       36       36   100%
src/pybind11/algorithms/localizer.cpp         38       38   100%
src/pybind11/algorithms/mc.cpp                37       37   100%
src/pybind11/algorithms/mcscf.cpp             34       34   100%
src/pybind11/algorithms/pmc.cpp               36       35    97%   178
src/pybind11/algorithms/scf.cpp               35       35   100%
src/pybind11/algorithms/stability.cpp         34       34   100%
src/pybind11/algorithms/syev_solver.cpp       19       18    94%   43
src/pybind11/constants.cpp                    89       89   100%
src/pybind11/data/ansatz.cpp                  69       69   100%
src/pybind11/data/basis_set.cpp              204      204   100%
src/pybind11/data/configuration.cpp           30       29    96%   200
src/pybind11/data/configuration_set.cpp       84       84   100%
src/pybind11/data/data_class.cpp             109       27    24%   19-20,23-24,27,29,32,34-37,39-44,46,48-49,52,54,57-59,64,67,71-72,75,78-79,81-82,90,92,94-96,98,101,104-105,107,110,113-115,117-120,124,126,128-129,131,133,135-137,139,141,143-145,150-151,153,156-157,159,162-163,165,168-169,171,174,176,178,249
src/pybind11/data/element_data.cpp           123      123   100%
src/pybind11/data/hamiltonian.cpp            247      238    96%   62,65,67,458,477,650,670,855,876
src/pybind11/data/lattice_graph.cpp          122       96    78%   20,23,25,27,29-30,51,53-54,66-69,71-72,249,476-478,482,501,512,615,617,619,621
src/pybind11/data/majorana_mapping.cpp       114       96    84%   71-75,109-111,113-116,145-147,172-174
src/pybind11/data/orbitals.cpp               138      137    99%   940
src/pybind11/data/path_utils.hpp              19       11    57%   37,39,42-47
src/pybind11/data/pauli_operator.cpp         274      229    83%   146,257,322,398,403,409,415,427,467,473,505,511,517,529,569,604,636,641,655,659,667,704-705,708-713,715-718,744-745,747-752,754-757
src/pybind11/data/property_binding_helpers.hpp
                                             312      312   100%
src/pybind11/data/serialization.cpp            5        5   100%
src/pybind11/data/settings.cpp               840      575    68%   40-41,57-58,110-111,117-118,123-124,129,131,136,138,164-168,177-179,182-185,190-194,198-200,210-213,217-221,230-233,237-242,246-249,259-262,266-270,273-277,281-291,293-311,313-327,333,335,337-338,342,345-347,381,383,400,450,452-453,536,544-546,548,552,571-577,633-636,643-649,651,654,656,658-661,668,670,713,784,1444,1452,1458,1461,1580,1614,1692,1755,1780,1805,1831,1895,1983-1984,1986-1990,2024-2028,2030-2035,2086,2140,2166-2167,2169,2172-2175,2201,2243-2244,2246-2247,2278-2279,2281,2284-2287,2314-2316,2337-2339,2341-2342,2361-2367,2387-2389,2391-2392,2414-2418,2420-2425,2456-2457,2475-2481,2503-2504,2522-2528
src/pybind11/data/stability_result.cpp       112      112   100%
src/pybind11/data/structure.cpp              199      184    92%   69,72,75-78,82-84,87,90-91,969,977,999
src/pybind11/data/wavefunction.cpp           365      347    95%   39,98,100,264-265,268,272,278,473-477,479,1016,1018,1064,1067
src/pybind11/module.cpp                       47       47   100%
src/pybind11/qdk_scf_config.cpp               12       12   100%
src/pybind11/utils/logger.cpp                191      177    92%   27,54,68-69,92,97-99,105-106,262-263,476,480
src/pybind11/utils/model_hamiltonians.cpp
                                              62       62   100%
src/pybind11/utils/orbital_rotation.cpp        7        7   100%
src/pybind11/utils/valence_space.cpp           6        6   100%
------------------------------------------------------------------------------
TOTAL                                       4441     3887    87%
------------------------------------------------------------------------------

wavefunction91 and others added 21 commits May 26, 2026 19:01
- Add BK-tree factory (MajoranaMapping.bravyi_kitaev_tree) and fix SCBK
  to use BK-tree as base encoding (works for non-power-of-2 modes)
- Fix parity encoding to match standard convention (Qiskit-compatible)
- Fix UHF BBAA ERI index ordering (eri_aabb[r,s,p,q] not [p,q,r,s])
- Fix HDF5 round-trip for phases and tapering metadata
- Propagate tapering through QubitHamiltonian arithmetic and interleave
- Handle tapering in QubitMapper.run() base class for all backends
- Document F2Q dispatch contract: table-driven (QDK) vs name-dispatched
  (OpenFermion, Qiskit) backends, with inline comments and RST docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- M2: Use 1e-12 threshold (not eps) for near-zero filtering in taper_qubits
- M6: Return zero-coefficient identity on full cancellation instead of ValueError
- M1: taper_to_scbk sets TaperingSpecification on output QubitHamiltonian
- M5: Transpose h2_ba for Qiskit UHF — (aa|bb) → (bb|aa) per Qiskit convention
- L2: MajoranaMapping repr shows tapered=N when tapering is present
- Add tests for zero-operator return and taper_to_scbk tapering metadata

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These fields were always empty for the Majorana-atomic encodings the class
produces and were never read by the mapping engine, validation, or any
consumer. Codespace metadata, if ever needed for redundant encodings, is
derivable from the encoding and belongs to the consuming algorithm.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… from C++

Remove phases (dead code — no factory produced negative phases), Clifford
validation, and dense-string handling from the C++ and pybind layers.

C++/pybind boundary now uses SparsePauliWord exclusively; Python owns
dense little-endian string conversion via _dense_le_to_sparse /
_sparse_to_dense_le helpers. Public Python API unchanged (still returns
strings).

Consolidate majorana_map_engine.hpp into majorana_mapping.hpp. Rename
is_restricted → is_spin_free in the engine (documents the actual
semantic). Note the spin-free-only limitation on majorana_map_hamiltonian.

Minimize docs: strip speculative encoding references and validation
language from docstrings and RST.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Engine:
- Replace anonymous namespaces with namespace detail
- Snake-case constants (excitation_coeff, inline 0.25/0.0625)
- Portable C++20: std::popcount, std::countr_zero (no __builtin_)
- Use utils::hash_combine instead of ad-hoc hash
- Dispatch table covers NW 1..16 (up to 1024 qubits); error beyond
- Merge αβ/βα cross-spin loops via Coulomb symmetry (pq|rs)=(rs|pq)

Terminology:
- Rename is_spin_free → spin_symmetric throughout (C++, pybind, Python)
- Spin-free = Hamiltonian has no spin operators (always true for
  standard electronic H). Restricted/unrestricted = orbital basis
  choice. The flag controls the spin-summed fast path, which requires
  spin-symmetric integrals — a consequence of restricted orbitals.

MajoranaMapping:
- Add from_bilinears() factory for bilinear-only encodings (C++,
  pybind, Python). Supports encodings where individual Majoranas
  have no Pauli image; only bilinear(j,k) is available.
- Minor doc updates for the two construction forms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the public MajoranaMapping constructor with from_table() for
symmetry with from_bilinears(). Both are named static factories; the
actual constructors are private.

Add unit tests for from_bilinears: basic construction, bilinear lookup
matches table-derived values, antisymmetry, and majorana() raises for
bilinear-only mappings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract JW/BK/BK-tree/parity factory methods and BK index-set helpers
into majorana_mapping_factories.cpp (313 lines). Core class stays in
majorana_mapping.cpp (150 lines, down from 492).

Also rename OP_X/OP_Y/OP_Z to op_x/op_y/op_z (snake_case) in the
factories file.

Fix all docs examples to use hamiltonian.get_orbitals().
get_num_molecular_orbitals() instead of the fragile
hamiltonian.get_one_body_integrals()[0].shape[0] pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
from qdk_chemistry.data import MajoranaMapping (not the private module path).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove 'tapering is applied downstream', 'passed to Algorithm.run',
'used by QubitMapper' boilerplate from method/property docstrings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Build pair product caches from mapping.bilinear() instead of
mapping(k) + manual packed multiply. This makes the engine work
with both Majorana-atomic and bilinear-only mappings.

Pair products store complex coefficients (γ_j·γ_k = -i·bilinear(j,k))
rather than integer phase indices. accumulate_epq now uses the same
pair caches as the two-body loops.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
from_table() precomputes all M*(M-1)/2 bilinears from the Majorana table
at construction. bilinear() is now always an O(1) lookup regardless of
construction form — no dispatch, no on-demand Pauli multiply.

Unified to a single private constructor; majorana_atomic_ derived from
whether the table is populated. bilinear() returns a const reference to
the cached word.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
from_bilinears: add num_qubits, wrong count, missing entry, out-of-range,
equal-indices error tests (5 new).

Sparse/dense conversion helpers: roundtrip identity, single Pauli, JW table,
invalid character, case insensitivity (5 new).

Serialization backward compat: JSON and HDF5 files with old 'phases'
key/dataset deserialize without error (2 new).

Bilinear caching: verify cached bilinear(j,k) matches manual Pauli multiply
of table entries for all factory encodings (1 new, parametrized across 3
encodings).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>



class MajoranaMapping(DataClass):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be the C++ class exposed to python.


__all__: list[str] = []

# Sparse op_type codes used by the C++ layer: 1=X, 2=Y, 3=Z (0/identity omitted).
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we handle this elsewhere in the code? e.g. in the pauli arithmetic library?

@@ -0,0 +1,236 @@
"""Internal qubit tapering utilities for symmetry-conserving encodings.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these functions should live in the data tapering module.

Comment thread python/tests/test_encoding_metadata.py Outdated
EncodingMismatchError,
MajoranaMapping,
QubitHamiltonian,
validate_encoding_compatibility,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want validate_encoding_compatibility completely removed from the code base

wavefunction91 and others added 2 commits May 30, 2026 02:46
- Remove validate_encoding_compatibility and EncodingMismatchError entirely
- Move taper_qubits from utils/tapering.py to data/tapering.py
- Trim MajoranaMapping class docstring

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tests (90 → 43):
- Drop trivial getter/metadata/immutability/display/cross-encoding tests
- Drop redundant serialization, bilinear antisymmetry/hermitian/caching tests
- Drop stale test_majorana_consistent_with_call and sparse conversion micro-tests
- Fix stale test_scbk_factory_creates_bk_table → compares against bk_tree
- Add test_without_tapering

Docs:
- Fix pybind class docstring (was missing bilinear-only form)
- Fix RST 'stabilizers' reference (removed feature term)
- Trim C++ class doxygen, pybind table property docstring
- Trim verbose factory docstrings (BK-tree, parity, SCBK)
- Trim num_qubits docstring
- Drop BK superfast reference from test class docstring

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants