Skip to content

Commit d6266ce

Browse files
committed
fix cpp format
Signed-off-by: Melody Ren <[email protected]>
1 parent 75fa658 commit d6266ce

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

libs/solvers/include/cudaq/solvers/operators/molecule/fermion_compilers/jordan_wigner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace cudaq::solvers {
1515
class jordan_wigner : public fermion_compiler {
1616
public:
1717
cudaq::spin_op generate(const double constant, const cudaqx::tensor<> &hpq,
18-
const cudaqx::tensor<> &hpqrs,
18+
const cudaqx::tensor<> &hpqrs,
1919
const double tolerance = 1e-15) override;
2020

2121
CUDAQ_EXTENSION_CREATOR_FUNCTION(fermion_compiler, jordan_wigner)

libs/solvers/python/bindings/solvers/py_solvers.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ void bindOperators(py::module &mod) {
203203

204204
mod.def(
205205
"jordan_wigner",
206-
[](py::buffer hpq, py::buffer hpqrs, double core_energy = 0.0, double tolerance = 1e-15) {
206+
[](py::buffer hpq, py::buffer hpqrs, double core_energy = 0.0,
207+
double tolerance = 1e-15) {
207208
auto hpqInfo = hpq.request();
208209
auto hpqrsInfo = hpqrs.request();
209210
auto *hpqData = reinterpret_cast<std::complex<double> *>(hpqInfo.ptr);
@@ -218,7 +219,8 @@ void bindOperators(py::module &mod) {
218219
return fermion_compiler::get("jordan_wigner")
219220
->generate(core_energy, hpqT, hpqrsT, tolerance);
220221
},
221-
py::arg("hpq"), py::arg("hpqrs"), py::arg("core_energy") = 0.0, py::arg("tolerance") = 1e-15,
222+
py::arg("hpq"), py::arg("hpqrs"), py::arg("core_energy") = 0.0,
223+
py::arg("tolerance") = 1e-15,
222224
R"#(
223225
Perform the Jordan-Wigner transformation on fermionic operators.
224226
@@ -236,7 +238,7 @@ hpqrs : numpy.ndarray
236238
core_energy : float, optional
237239
The core energy of the system when using active space Hamiltonian, nuclear energy otherwise. Default is 0.0.
238240
tolerance : float, optional
239-
The threshold value for ignoring small coefficients in the one-body integrals.
241+
The threshold value for ignoring small coefficients.
240242
Coefficients with absolute values smaller than this tolerance are considered as zero.
241243
Default is 1e-15.
242244
@@ -271,7 +273,8 @@ RuntimeError
271273

272274
mod.def(
273275
"jordan_wigner",
274-
[](py::buffer buffer, double core_energy = 0.0, double tolerance = 1e-15) {
276+
[](py::buffer buffer, double core_energy = 0.0,
277+
double tolerance = 1e-15) {
275278
auto info = buffer.request();
276279
auto *data = reinterpret_cast<std::complex<double> *>(info.ptr);
277280
std::size_t size = 1;
@@ -292,7 +295,8 @@ RuntimeError
292295
return fermion_compiler::get("jordan_wigner")
293296
->generate(core_energy, hpq, hpqrs, tolerance);
294297
},
295-
py::arg("hpq"), py::arg("core_energy") = 0.0, py::arg("tolerance") = 1e-15,
298+
py::arg("hpq"), py::arg("core_energy") = 0.0,
299+
py::arg("tolerance") = 1e-15,
296300
R"#(
297301
Perform the Jordan-Wigner transformation on fermionic operators.
298302
@@ -309,7 +313,7 @@ hpq : numpy.ndarray
309313
core_energy : float, optional
310314
The core energy of the system. Default is 0.0.
311315
tolerance : float, optional
312-
The threshold value for ignoring small coefficients in the one-body integrals.
316+
The threshold value for ignoring small coefficients.
313317
Coefficients with absolute values smaller than this tolerance are considered as zero.
314318
Default is 1e-15.
315319

0 commit comments

Comments
 (0)