Skip to content

Commit 04c5975

Browse files
authored
operator api update (#58)
1 parent 0e70691 commit 04c5975

10 files changed

Lines changed: 28 additions & 24 deletions

File tree

src/scf/driver/scf_loop.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ MODULE_RUN(SCFLoop) {
173173
tensor_t e_nuclear(0.0);
174174
if(has_nn) {
175175
const auto& V_nn = *visitor.m_pv;
176-
const auto n_lhs = V_nn.lhs_particle().as_nuclei();
176+
const auto n_lhs = V_nn.get_lhs_particle().as_nuclei();
177177
const auto qs_lhs_view = n_lhs.charges();
178-
const auto n_rhs = V_nn.rhs_particle().as_nuclei();
178+
const auto n_rhs = V_nn.get_rhs_particle().as_nuclei();
179179
const auto qs_rhs_view = n_rhs.charges();
180180
simde::type::charges qs_lhs;
181181
simde::type::charges qs_rhs;

src/scf/fock_operator/fock_operator_common.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class FockOperatorCommon : public chemist::qm_operator::OperatorVisitor {
3535
}
3636

3737
void run(const V_en_term& V_en) {
38-
auto rhs = V_en.rhs_particle().as_nuclei();
38+
auto rhs = V_en.get_rhs_particle().as_nuclei();
3939
using v_type = Coulomb<ElectronType, simde::type::nuclei>;
4040
auto v = std::make_unique<v_type>(get_e_(V_en), rhs);
4141
m_pF_->emplace_back(1.0, std::move(v));
@@ -47,7 +47,7 @@ class FockOperatorCommon : public chemist::qm_operator::OperatorVisitor {
4747
if constexpr(std::is_same_v<ElectronType, simde::type::electron>) {
4848
return simde::type::electron{};
4949
} else {
50-
return op.template at<0>();
50+
return op.template get<0>();
5151
}
5252
}
5353

src/scf/guess/core.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,17 @@ using simde::type::tensor;
3838
struct NElectronCounter : public chemist::qm_operator::OperatorVisitor {
3939
NElectronCounter() : chemist::qm_operator::OperatorVisitor(false) {}
4040

41-
void run(const simde::type::T_e_type& T_e) { set_n(T_e.particle().size()); }
41+
void run(const simde::type::T_e_type& T_e) {
42+
set_n(T_e.get_particle().size());
43+
}
4244

4345
void run(const simde::type::V_en_type& V_en) {
44-
set_n(V_en.lhs_particle().size());
46+
set_n(V_en.get_lhs_particle().size());
4547
}
4648

4749
void run(const simde::type::V_ee_type& V_ee) {
48-
set_n(V_ee.lhs_particle().size());
49-
set_n(V_ee.rhs_particle().size());
50+
set_n(V_ee.get_lhs_particle().size());
51+
set_n(V_ee.get_rhs_particle().size());
5052
}
5153

5254
void set_n(unsigned int n) {

src/scf/guess/sad.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ using simde::type::tensor;
3939
struct NElectronCounter : public chemist::qm_operator::OperatorVisitor {
4040
NElectronCounter() : chemist::qm_operator::OperatorVisitor(false) {}
4141

42-
void run(const simde::type::T_e_type& T_e) { set_n(T_e.particle().size()); }
42+
void run(const simde::type::T_e_type& T_e) {
43+
set_n(T_e.get_particle().size());
44+
}
4345

4446
void run(const simde::type::V_en_type& V_en) {
45-
set_n(V_en.lhs_particle().size());
47+
set_n(V_en.get_lhs_particle().size());
4648
}
4749

4850
void run(const simde::type::V_ee_type& V_ee) {
49-
set_n(V_ee.lhs_particle().size());
50-
set_n(V_ee.rhs_particle().size());
51+
set_n(V_ee.get_lhs_particle().size());
52+
set_n(V_ee.get_rhs_particle().size());
5153
}
5254

5355
void set_n(unsigned int n) {

src/scf/matrix_builder/determinant_driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ class DeterminantDispatcher : public chemist::qm_operator::OperatorVisitor {
5858

5959
void run(const V_en_type& V_en) {
6060
simde::type::electron e;
61-
simde::type::v_en_type v_en(e, V_en.rhs_particle().as_nuclei());
61+
simde::type::v_en_type v_en(e, V_en.get_rhs_particle().as_nuclei());
6262
run_(v_en);
6363
}
6464

6565
void run(const J_e_type& J_e) {
6666
simde::type::electron e;
67-
simde::type::j_e_type j_e(e, J_e.rhs_particle());
67+
simde::type::j_e_type j_e(e, J_e.get_rhs_particle());
6868
run_(j_e);
6969
}
7070

7171
void run(const K_e_type& K_e) {
7272
simde::type::electron e;
73-
simde::type::k_e_type k_e(e, K_e.rhs_particle());
73+
simde::type::k_e_type k_e(e, K_e.get_rhs_particle());
7474
run_(k_e);
7575
}
7676

src/scf/xc/gauxc/snlink.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ MODULE_CTOR(snLinK) {
3737
MODULE_RUN(snLinK) {
3838
const auto&& [braket] = k_type::unwrap_inputs(inputs);
3939
const auto& bra = braket.bra();
40-
const auto& P = braket.op().rhs_particle();
40+
const auto& P = braket.op().get_rhs_particle();
4141
const auto& ket = braket.ket();
4242

4343
if(bra != ket || P.basis_set() != bra)

src/scf/xc/gauxc/xc_energy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ MODULE_RUN(XCEnergy) {
4141
if(bra_wf != ket_wf)
4242
throw std::runtime_error("Expected the same basis set");
4343

44-
const auto func = xc_op.functional_name();
45-
const auto& P = xc_op.rhs_particle();
44+
const auto func = xc_op.get_functional_name();
45+
const auto& P = xc_op.get_rhs_particle();
4646
const auto& aos = P.basis_set().ao_basis_set();
4747

4848
auto& driver = submods.at("XC Driver");

src/scf/xc/gauxc/xc_potential.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ MODULE_RUN(XCPotential) {
4343
if(bra_aos != ket_aos)
4444
throw std::runtime_error("Expected the same basis set!");
4545

46-
const auto func = xc_op.functional_name();
47-
const auto& P = xc_op.rhs_particle();
46+
const auto func = xc_op.get_functional_name();
47+
const auto& P = xc_op.get_rhs_particle();
4848
const auto& aos = bra_aos.ao_basis_set();
4949

5050
auto& driver = submods.at("XC Driver");

src/scf/xc/libxc/libxc_energy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ MODULE_RUN(LibXCEnergy) {
5151
if(bra_wf != ket_wf)
5252
throw std::runtime_error("Expected the same basis set");
5353

54-
const auto func_name = xc_op.functional_name();
55-
const auto& P = xc_op.rhs_particle();
54+
const auto func_name = xc_op.get_functional_name();
55+
const auto& P = xc_op.get_rhs_particle();
5656
const auto& aos = P.basis_set().ao_basis_set();
5757

5858
// Molecule from AOs

src/scf/xc/libxc/libxc_potential.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ MODULE_RUN(LibXCPotential) {
4848
if(bra_aos != ket_aos)
4949
throw std::runtime_error("Expected the same basis set!");
5050

51-
const auto func = xc_op.functional_name();
52-
const auto& P = xc_op.rhs_particle();
51+
const auto func = xc_op.get_functional_name();
52+
const auto& P = xc_op.get_rhs_particle();
5353
const auto& aos = bra_aos.ao_basis_set();
5454

5555
// Get grid

0 commit comments

Comments
 (0)