Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
4bb3a6a
First windows build implementation draft
lorisercole Apr 8, 2026
f389884
Fix MSCVC Build Tools finder + vcpkg
lorisercole Apr 8, 2026
2e1214d
Add vcpkg installed folders to gitignore
lorisercole Apr 8, 2026
da340c4
force LF for patch files
lorisercole Apr 9, 2026
ff907c3
Add vcpkg-overlay of OpenBLAS to build LAPACK
lorisercole Apr 9, 2026
ce6b7ee
Debug compilation with clang-cl
lorisercole Apr 9, 2026
2017548
Script to test the build on Windows
lorisercole Apr 9, 2026
2b7670e
Fix HDF5 type portability bugs for Windows (LLP64)
lorisercole Apr 9, 2026
07cfa17
Fix Windows file locking in Hamiltonian FCIDUMP tests
lorisercole Apr 9, 2026
134e87e
Fix uninitialized Shell::rpowers and broken BasisSetMap test
lorisercole Apr 10, 2026
12fae31
adding additional warning-silence flags for deps
lorisercole Apr 10, 2026
5d3d3e7
Fix Python package build and DLL loading on Windows
lorisercole Apr 10, 2026
e1b2262
Fix encoding for reading example file content in tests
lorisercole Apr 10, 2026
cadd8ba
Fix Windows file locking in Python tests
lorisercole Apr 13, 2026
75bd327
Fix license header hook Unicode error on Windows
lorisercole Apr 13, 2026
2ecbe80
Fix spdlog Logger stdout capture on Windows for pytest capfd
lorisercole Apr 13, 2026
bb2214c
fix: harden Python package and tests against Windows encoding issues
lorisercole Apr 13, 2026
9ef5d29
test: skip PySCF-dependent MC entropy test if PySCF is not available
lorisercole Apr 13, 2026
c75ccc1
update build scripts and pyproject
lorisercole Apr 13, 2026
bbd0c0a
test_sample_workflow: add PySCF availability check
lorisercole Apr 14, 2026
37cba5c
fix: use non-interactive matplotlib backend in tests
lorisercole Apr 14, 2026
2f6e05c
enforce LF line endings for all text files via .gitattributes
lorisercole Apr 14, 2026
1b0de73
apply pre-commit hooks
lorisercole Apr 14, 2026
7a55684
test: run doc examples in a temporary directory
lorisercole Apr 14, 2026
9ae0e86
update PS scripts, build with pip directly
lorisercole Apr 14, 2026
f51b499
enable OpenMP on Windows, disable it for GauXC due to data race
lorisercole Apr 17, 2026
ebb1222
set and cleanup CMake compilation flags
lorisercole Apr 20, 2026
bdff54e
Reset pipeline files, move PS1 build scripts, cleanup
lorisercole Apr 20, 2026
fbcba9e
mypy: ignore type checking for DLL directory addition on Windows
lorisercole Apr 20, 2026
c7e4d1c
Address Copilot comments
lorisercole Apr 21, 2026
ff8e0ce
Bundle vcpkg DLLs into Python wheel on Windows
lorisercole Apr 21, 2026
ed5350b
macis types.hpp: add comparison and bitwise operators to uint128_t st…
lorisercole Apr 21, 2026
058dfa8
Merge branch 'main' into feature/ler/windows-build-part-1
lorisercole Apr 22, 2026
03638ca
Fix test_noise_models due to change in QuantumErrorProfile API
lorisercole Apr 22, 2026
a056aa1
Apply suggestion from @Copilot
lorisercole Apr 22, 2026
83875e4
Address Copilot's comments about coverage flags w/ MSVC
lorisercole Apr 22, 2026
f8de7de
fix @Copilot's badly formatted code
lorisercole Apr 22, 2026
1be559f
Refine Windows DLL bundling: explicit list, skip libomp, add toggle
lorisercole Apr 22, 2026
82be64b
Cleanup DLL loading in Python package
lorisercole Apr 24, 2026
3015e25
Use static linking of vcpkg deps on Windows (x64-windows-static-md) b…
lorisercole Apr 24, 2026
97d211b
Apply suggestion from @Copilot
lorisercole Apr 24, 2026
2f20859
address @Copilot's comments
lorisercole Apr 24, 2026
bd3176b
Cleanup qdk-uarch cmake file
lorisercole Apr 29, 2026
ec0e4e8
and also macis-uarch.cmake
lorisercole Apr 30, 2026
727f311
address several comments
lorisercole May 4, 2026
401d2e8
Move stdout_fd_sink class into logger module
lorisercole May 4, 2026
c5a071f
vcpkg: install catch2 & gtest
lorisercole May 5, 2026
027c2a8
pre-commit config: exclude patch files from trailing whitespace and e…
lorisercole May 6, 2026
77475bd
Fix blaspp BLAS_FORTRAN_ADD_ detection on reconfigure + lapackpp complex
lorisercole May 6, 2026
27df5dd
add MACIS_ENABLE_TESTS option to control building of MACIS tests
lorisercole May 6, 2026
043f620
Fix -Wdefaulted-function-deleted warnings in Structure and ERIMultipl…
lorisercole May 6, 2026
63a46a9
Add missing override specifiers to virtual function overrides
lorisercole May 6, 2026
971941a
Fix -Wreorder-ctor warnings by matching initializer list to declarati…
lorisercole May 6, 2026
0b7b049
Simplify CMake compiler flags and remove global warning suppression
lorisercole May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize all text files to LF in the repo and working copy.
* text=auto eol=lf
4 changes: 4 additions & 0 deletions .github/scripts/check_license_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
from pathlib import Path
from typing import List, Optional, Tuple

# Ensure emoji and other Unicode characters can be printed on Windows (cp1252)
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8")

# Expected license headers for different file types
CPP_LICENSE_PATTERNS = [
# Full MIT license header - standard C-style comment with line breaks
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ dist/
downloads/
eggs/
.eggs/
install/
lib/
lib64/
parts/
sdist/
var/
vcpkg_installed/
wheels/
share/python-wheels/
*.egg-info/
Expand Down
417 changes: 417 additions & 0 deletions .pipelines/pip-scripts/windows-build-clang-cmake.ps1

Large diffs are not rendered by default.

369 changes: 369 additions & 0 deletions .pipelines/pip-scripts/windows-build-clang-pip.ps1

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ repos:
files: *linted_files
- id: trailing-whitespace
files: *linted_files
exclude: \.patch$
- id: end-of-file-fixer
files: *linted_files
exclude: \.patch$
- id: debug-statements
files: *linted_files
- id: check-case-conflict
Expand Down
34 changes: 29 additions & 5 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,22 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# Add compiler flags
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g -O0 -Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
# Set per-config compile flags.
if(MSVC) # clang-cl and cl
set(CMAKE_CXX_FLAGS_DEBUG "/Zi /Od /W3 /RTC1")
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /W1 /DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Zi /O2 /W1 /DNDEBUG")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3 -DNDEBUG")
else()
message(WARNING "Unknown compiler ${CMAKE_CXX_COMPILER_ID}, using default CMAKE_CXX_FLAGS")
endif()
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")


# Options
option(QDK_CHEMISTRY_ENABLE_COVERAGE "Enable coverage build" OFF)
Expand All @@ -56,6 +69,12 @@ option(QDK_CHEMISTRY_ENABLE_MPI "Enable MPI Bindings for QDK Chemistry" OFF)
option(QDK_EMBED_RESOURCE_LOCATION "Point to embedded (permanent) resource location" ON)

# Enable OpenMP by default, except on Apple platforms with AppleClang
# On Windows with clang-cl, CMake resolves OpenMP to:
# OpenMP_CXX_FLAGS = -Xclang -fopenmp
# OpenMP_libomp_LIBRARY = .../VC/Tools/MSVC/.../lib/x64/libomp.lib
# This uses LLVM's libomp runtime (not MSVC's vcomp*.dll). libomp.dll must
# be present at runtime alongside the built binaries. It is found in:
# %VS_INSTALL_DIR%\VC\Tools\Llvm\x64\bin\libomp.dll
cmake_dependent_option(QDK_ENABLE_OPENMP
"Enable OpenMP support" ON
"NOT (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL \"AppleClang\")" OFF)
Expand Down Expand Up @@ -92,6 +111,7 @@ if(NOT macis_FOUND)
set(MACIS_ENABLE_MPI OFF CACHE BOOL "MACIS enable MPI" FORCE)
set(MACIS_ENABLE_PYTHON OFF CACHE BOOL "MACIS Enable Python" FORCE)
set(MACIS_ENABLE_EXAMPLES OFF CACHE BOOL "MACIS Build Examples" FORCE)
set(MACIS_ENABLE_TESTS ON CACHE BOOL "MACIS Build Tests")
set(MACIS_ENABLE_OPENMP ${QDK_ENABLE_OPENMP} CACHE BOOL "MACIS Enable OpenMP" FORCE)
if(DEFINED QDK_UARCH_USED)
set(MACIS_UARCH ${QDK_UARCH_USED} CACHE STRING "MACIS Microarchitecture" FORCE)
Expand Down Expand Up @@ -164,8 +184,12 @@ set_target_properties(chemistry PROPERTIES OUTPUT_NAME "qdk_chemistry")
if(QDK_CHEMISTRY_ENABLE_COVERAGE)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
message(STATUS "Enabling coverage build")
target_compile_options(chemistry PRIVATE --coverage -fprofile-arcs -ftest-coverage)
target_link_libraries(chemistry PRIVATE --coverage)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang" AND NOT MSVC)
target_compile_options(chemistry PRIVATE --coverage -fprofile-arcs -ftest-coverage)
target_link_libraries(chemistry PRIVATE --coverage)
else()
message(WARNING "Coverage build is only supported with GCC or Clang compilers")
endif()
else()
message(FATAL_ERROR "Coverage build is only supported in CMAKE_BUILD_TYPE=Debug or RelWithDebInfo mode")
endif()
Expand Down
33 changes: 15 additions & 18 deletions cpp/cmake/qdk-uarch.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
# --- Step 1: Resolve QDK_UARCH ---
# Check environment variable first, then CMake variable
if(NOT DEFINED QDK_UARCH AND DEFINED ENV{QDK_UARCH})
set(QDK_UARCH $ENV{QDK_UARCH})
endif()

if(DEFINED QDK_UARCH)
message(STATUS "Using user-defined uarch: ${QDK_UARCH}")
# If compiler ID is not GNU or Clang, we cannot use -march flag, so we will not set QDK_UARCH_FLAGS
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang"))
message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID} does not support -march flag. QDK_UARCH_FLAGS will not be set.")
set(QDK_UARCH_USED "NONE" CACHE STRING "User-defined microarchitecture for optimization")
else()
set(QDK_UARCH_USED ${QDK_UARCH} CACHE STRING "User-defined microarchitecture for optimization")
set(QDK_UARCH_FLAGS "-march=${QDK_UARCH}" CACHE STRING "Compiler flags for user-defined microarchitecture")
endif()
else()
# Set architecture-specific defaults based on the target platform
# Auto-detect based on the target platform
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
set(QDK_UARCH "x86-64" CACHE STRING "Target microarchitecture")
message(STATUS "Auto-detected x86_64 architecture, using: ${QDK_UARCH}")
Expand All @@ -25,24 +18,28 @@ else()
message(WARNING "Unknown architecture ${CMAKE_SYSTEM_PROCESSOR}. QDK_UARCH not set. This may degrade performance")
return()
endif()
endif()

# Set the used arch and flags
set(QDK_UARCH_USED ${QDK_UARCH} CACHE STRING "User-defined microarchitecture for optimization")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
set(QDK_UARCH_FLAGS "-march=${QDK_UARCH}" CACHE STRING "Compiler flags for user-defined microarchitecture")
else()
message(WARNING "Compiler syntax for ISA flags is unknown, defaulting to the system default generic ISA")
endif()
# --- Step 2: Set QDK_UARCH_FLAGS based on compiler and uarch ---
set(QDK_UARCH_USED ${QDK_UARCH} CACHE STRING "Target microarchitecture for optimization")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
set(QDK_UARCH_FLAGS "-march=${QDK_UARCH}" CACHE STRING "Compiler flags for target microarchitecture")
elseif(MSVC)
# Users should set QDK_UARCH to a valid MSVC /arch: argument (e.g. AVX2, AVX512)
set(QDK_UARCH_FLAGS "/arch:${QDK_UARCH}" CACHE STRING "Compiler flags for target microarchitecture")
else()
message(WARNING "Compiler ${CMAKE_CXX_COMPILER_ID}: unknown flag syntax for ISA selection. QDK_UARCH_FLAGS will not be set.")
set(QDK_UARCH_USED "NONE" CACHE STRING "Target microarchitecture for optimization")
endif()

# Test that the produced flags are sane
# --- Step 3: Validate the flags ---
if(QDK_UARCH_FLAGS)
message(STATUS "Testing QDK_UARCH_FLAGS: ${QDK_UARCH_FLAGS}")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("${QDK_UARCH_FLAGS}" COMPILER_SUPPORTS_QDK_UARCH_FLAGS)
if(NOT COMPILER_SUPPORTS_QDK_UARCH_FLAGS)
message(WARNING "The compiler does not support the specified QDK_UARCH_FLAGS: ${QDK_UARCH_FLAGS}. Unsetting these flags.")
unset(QDK_UARCH_FLAGS CACHE)
set(QDK_UARCH_USED "NONE" CACHE STRING "User-defined microarchitecture for optimization")
set(QDK_UARCH_USED "NONE" CACHE STRING "Target microarchitecture for optimization")
endif()
endif()
17 changes: 13 additions & 4 deletions cpp/cmake/third_party.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
include(DependencyManager)

# Extract QDK_UARCH FLAGS
set(DEPENDENCY_BUILD_FLAGS BUILD_ARGS "${QDK_UARCH_FLAGS} -fPIC")
set(DEPENDENCY_BUILD_FLAGS BUILD_ARGS "${QDK_UARCH_FLAGS}")
if(NOT MSVC)
set(DEPENDENCY_BUILD_FLAGS "${DEPENDENCY_BUILD_FLAGS} -fPIC")
endif()
Comment thread
lorisercole marked this conversation as resolved.

# Save current warning settings
get_property(_old_warn_deprecated CACHE CMAKE_WARN_DEPRECATED PROPERTY VALUE)
Expand Down Expand Up @@ -69,11 +72,17 @@ set(GAUXC_ENABLE_MAGMA OFF CACHE BOOL "Enable gauxc MAGMA Support" FORCE)
set(GAUXC_ENABLE_CUTLASS ON CACHE BOOL "Enable gauxc CUTLASS Support" FORCE)
set(GAUXC_ENABLE_CUDA ${QDK_CHEMISTRY_ENABLE_GPU} CACHE BOOL "Enable gauxc CUDA Support" FORCE)
set(GAUXC_ENABLE_MPI ${QDK_CHEMISTRY_ENABLE_MPI} CACHE BOOL "Enable gauxc MPI Support" FORCE)
set(GAUXC_ENABLE_OPENMP ${QDK_ENABLE_OPENMP} CACHE BOOL "Enable gauxc OpenMP Support" FORCE)
# Disable OpenMP in GauXC on Windows due to open issue: https://github.com/wavefunction91/GauXC/issues/196
# Keep OpenMP for the rest of the project (MACIS, our own code). Re-enable once the upstream issue is fixed.
if(MSVC)
set(GAUXC_ENABLE_OPENMP OFF CACHE BOOL "Enable gauxc OpenMP Support" FORCE)
else()
set(GAUXC_ENABLE_OPENMP ${QDK_ENABLE_OPENMP} CACHE BOOL "Enable gauxc OpenMP Support" FORCE)
endif()

handle_dependency(gauxc
GIT_REPOSITORY https://github.com/wavefunction91/gauxc.git
GIT_TAG 62fea07c9306dbd83dd18b6957358827ac9b3da0
GIT_REPOSITORY https://github.com/lorisercole/gauxc.git
GIT_TAG 4e18eb1c4fc3b7bc1d2f91c59d8a4826b0997a4f
BUILD_TARGET gauxc::gauxc
INSTALL_TARGET gauxc::gauxc
${DEPENDENCY_BUILD_FLAGS}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DynamicalCorrelationCalculator
*
* @return The algorithm's name
*/
virtual std::string name() const = 0;
virtual std::string name() const override = 0;

/**
* @brief Access the algorithm's type name
Expand All @@ -99,7 +99,7 @@ class DynamicalCorrelationCalculator
* wavefunction, and optionally a bra wavefunction
*/
virtual DynamicalCorrelationResult _run_impl(
std::shared_ptr<data::Ansatz> ansatz) const = 0;
std::shared_ptr<data::Ansatz> ansatz) const override = 0;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/qdk/chemistry/algorithms/stability.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class StabilityChecker
* @return A pair containing stability status and detailed results
*/
virtual std::pair<bool, std::shared_ptr<data::StabilityResult>> _run_impl(
std::shared_ptr<data::Wavefunction> wavefunction) const = 0;
std::shared_ptr<data::Wavefunction> wavefunction) const override = 0;
};

/**
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/qdk/chemistry/data/structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ class Structure : public DataClass,
/**
* @brief Copy assignment operator
*/
Structure& operator=(const Structure& other) = default;
Structure& operator=(const Structure&) = delete;

/**
* @brief Move assignment operator
*/
Structure& operator=(Structure&& other) noexcept = default;
Structure& operator=(Structure&&) = delete;

/**
* @brief Destructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ class VVHVLocalization : public IterativeOrbitalLocalizationScheme {
std::shared_ptr<IterativeOrbitalLocalizationScheme> inner_localizer)
: IterativeOrbitalLocalizationScheme(settings),
basis_set_(basis_set),
overlap_ori_(ao_overlap),
minimal_basis_name_(minimal_basis_name),
basis_ori_fp_(utils::microsoft::convert_basis_set_from_qdk(*basis_set)),
inner_localizer_(inner_localizer) {
inner_localizer_(inner_localizer),
overlap_ori_(ao_overlap),
basis_ori_fp_(
utils::microsoft::convert_basis_set_from_qdk(*basis_set)) {
QDK_LOG_TRACE_ENTERING();

// Initialize all data structures and pre-compute integrals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class Macis : public qdk::chemistry::algorithms::MultiConfigurationCalculator {
*/
virtual ~Macis() noexcept override = default;

virtual std::string name() const = 0;
virtual std::string name() const override = 0;

protected:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class ERIMultiplexer : public ERI {
const SCFConfig& cfg, double omega);

/**
* @brief Default constructor (private, used by factory methods)
* @brief Default constructor (deleted — base class ERI has no default ctor)
*/
ERIMultiplexer() noexcept = default;
ERIMultiplexer() noexcept = delete;

public:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ BasisSet::BasisSet(std::shared_ptr<Molecule> mol,
int n_ecp_electrons, BasisMode mode, bool pure, bool sort)
: mol(mol),
mode(mode),
pure(pure),
shells(input_shells),
pure(pure),
ecp_shells(input_ecp_shells),
element_ecp_electrons(element_ecp_electrons),
n_ecp_electrons(n_ecp_electrons) {
Expand Down Expand Up @@ -188,7 +188,7 @@ BasisSet::BasisSet(std::shared_ptr<Molecule> mol,
BasisSet::BasisSet(std::shared_ptr<Molecule> mol,
const std::vector<Shell>& input_shells, BasisMode mode,
bool pure, bool sort)
: mol(mol), mode(mode), pure(pure), shells(input_shells) {
: mol(mol), mode(mode), shells(input_shells), pure(pure) {
#ifdef QDK_CHEMISTRY_ENABLE_MPI
if (mpi::get_world_size() > 1) {
MPI_Barrier(MPI_COMM_WORLD);
Expand Down Expand Up @@ -245,7 +245,7 @@ BasisSet::BasisSet(std::shared_ptr<Molecule> mol, const std::string& path,
"basis" / (normalized_path + ".json");
name = normalized_path;
} else {
name = bs_path.stem();
name = bs_path.stem().string();
}
if (!std::filesystem::exists(bs_path)) {
auto compressed_path = QDKChemistryConfig::get_resources_dir() /
Expand Down Expand Up @@ -425,7 +425,7 @@ Shell Shell::from_json(const nlohmann::ordered_json& rec,
const std::shared_ptr<Molecule> mol) {
QDK_LOG_TRACE_ENTERING();

Shell sh;
Shell sh{};
sh.atom_index = rec["atom"].template get<uint64_t>();
sh.angular_momentum = rec["am"].template get<uint64_t>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ SCFAlgorithm::SCFAlgorithm(const SCFContext& ctx)
: ctx_(ctx),
step_count_(0),
last_energy_(0.0),
density_rms_(std::numeric_limits<double>::infinity()),
delta_energy_(std::numeric_limits<double>::infinity()) {
delta_energy_(std::numeric_limits<double>::infinity()),
density_rms_(std::numeric_limits<double>::infinity()) {
QDK_LOG_TRACE_ENTERING();
auto num_atomic_orbitals = ctx.basis_set->num_atomic_orbitals;
auto num_density_matrices =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Libint2Engine : public OneBodyIntegralEngine {
* @brief Get number of operator components
* @return Number of matrices/operators this engine computes
*/
size_t nopers() const {
size_t nopers() const override {
QDK_LOG_TRACE_ENTERING();
return engine_.results().size();
}
Expand Down Expand Up @@ -179,7 +179,7 @@ class ECPIntEngine : public OneBodyIntegralEngine {
* @return Number of matrices this engine computes (1 for integrals, 3*natom
* for gradients)
*/
size_t nopers() const {
size_t nopers() const override {
QDK_LOG_TRACE_ENTERING();
return buf_.size();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,11 @@ TEST(ClassRegistryTest, PrimitiveKey) {
TEST(AtomGuessTest, BasisSetMap) {
// Test that the map correctly identifies equivalent basis sets
auto mol = std::make_shared<Molecule>();
mol->atomic_nums = {1};
mol->atomic_nums = {3};
Comment thread
lorisercole marked this conversation as resolved.
mol->n_atoms = 1;
mol->atomic_charges = {1};
mol->total_nuclear_charge = 1;
mol->n_electrons = 1;
mol->atomic_charges = {3};
mol->total_nuclear_charge = 3;
mol->n_electrons = 3;
mol->coords = {{0.0, 0.0, 0.0}};

// Create two identical basis sets
Expand All @@ -485,10 +485,12 @@ TEST(AtomGuessTest, BasisSetMap) {
auto basis2 =
BasisSet::from_database_json(mol, "sto-3g", BasisMode::PSI4, true, false);

// Create same basis set in different shell order
// Create same basis set with reversed shell order via JSON round-trip.
// Lithium STO-3G has 3 shells, so reversing produces a different ordering
// that the BasisEqChecker should reject.
auto basis_json = basis1->to_json();
// Reverse the shells
std::reverse(basis_json["shells"].begin(), basis_json["shells"].end());
std::reverse(basis_json["electron_shells"].begin(),
basis_json["electron_shells"].end());
auto basis3 = BasisSet::from_serialized_json(mol, basis_json);

// Create a different basis set (different basis name)
Expand Down Expand Up @@ -518,7 +520,7 @@ TEST(AtomGuessTest, BasisSetMap) {
EXPECT_NE(it2, basis_map.end());
EXPECT_TRUE(it2->second.isApprox(RowMajorMatrix::Identity(
basis2->num_atomic_orbitals, basis2->num_atomic_orbitals)));
// Retrieve using basis3 (should not be found)
// Retrieve using basis3 (should not be found — shells are reversed)
auto it3 = basis_map.find(*basis3);
EXPECT_EQ(it3, basis_map.end());
// Retrieve using basis4 (should not be found)
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/qdk/chemistry/data/basis_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ BasisSet::BasisSet(const BasisSet& other)
: _name(other._name),
_atomic_orbital_type(other._atomic_orbital_type),
_shells_per_atom(other._shells_per_atom),
_ecp_name(other._ecp_name),
_ecp_shells_per_atom(other._ecp_shells_per_atom),
_ecp_name(other._ecp_name),
_ecp_electrons(other._ecp_electrons) {
QDK_LOG_TRACE_ENTERING();
if (other._structure) {
Expand Down
Loading
Loading