Loading...
Searching...
No Matches
q3_core_module.cpp File Reference
#include <stdexcept>
#include <string>
#include <vector>
#include <nanobind/nanobind.h>
#include <nanobind/stl/string.h>
#include <nanobind/stl/vector.h>
#include "bindings/q3_core_api.hpp"
#include "io/addon_registration.hpp"

Go to the source code of this file.

Functions

 NB_MODULE (q3_core, module)
 

Function Documentation

◆ NB_MODULE()

NB_MODULE ( q3_core  ,
module   
)

q3_core — nanobind Python extension module.

Exposes run_scf() and run_nscf() as Python callables that invoke the Q3 DFT engine in-process (Mode B) rather than via subprocess (Mode A).

Usage from Python::

import q3_core

# Returns a JSON string (same schema as results.json)
result_json = q3_core.run_scf("path/to/input.yml")
result_json = q3_core.run_nscf("path/to/nscf_input.yml")

Thread safety

The module releases the GIL during C++ computation (nb::call_guard is NOT used here because Q3 is not thread-safe; GIL is held throughout the C++ call to prevent concurrent invocations).

Definition at line 35 of file q3_core_module.cpp.

References q3::addons::register_all().