Skip to content

Commit

Permalink
Change naming convention
Browse files Browse the repository at this point in the history
e.g., saveQuantumNumbers -> save_quantum_numbers
  • Loading branch information
j-otsuki committed Mar 2, 2018
1 parent 03c3564 commit 5b5fcc6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
10 changes: 5 additions & 5 deletions c++/pomerol_ed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ namespace pomerol2triqs {
diagonalize_main(gs_shift);
}

void pomerol_ed::saveQuantumNumbers(const std::string &filename) {
if (!states_class) TRIQS_RUNTIME_ERROR << "saveQuantumNumbers: internal error!";
void pomerol_ed::save_quantum_numbers(const std::string &filename) {
if (!states_class) TRIQS_RUNTIME_ERROR << "save_quantum_numbers: internal error!";

if (!comm.rank()) {
std::ofstream fout(filename);
Expand All @@ -222,8 +222,8 @@ namespace pomerol2triqs {
}
}

void pomerol_ed::saveEigenValues(const std::string &filename) {
if (!states_class || !matrix_h) TRIQS_RUNTIME_ERROR << "saveEigenValues: internal error!";
void pomerol_ed::save_eigenvalues(const std::string &filename) {
if (!states_class || !matrix_h) TRIQS_RUNTIME_ERROR << "save_eigenvalues: internal error!";

if (!comm.rank()) {
// create a list of pairs of eigenvalue and quantum numers to sort
Expand Down Expand Up @@ -277,7 +277,7 @@ namespace pomerol2triqs {
rho.reset(new Pomerol::DensityMatrix(*states_class, *matrix_h, beta));
rho->prepare();
rho->compute();
rho->truncateBlocks(DensityMatrixCutoff, verbose);
rho->truncateBlocks(density_matrix_cutoff, verbose);
}
}

Expand Down
14 changes: 7 additions & 7 deletions c++/pomerol_ed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace pomerol2triqs {
// block2_gf<Mesh, tensor_valued<4>> compute_g2(gf_struct_t const &gf_struct, gf_mesh<Mesh> const &mesh, block_order_t block_order,
// g2_blocks_t const &g2_blocks, Filler filler) const;

double DensityMatrixCutoff = 1e-15;
double density_matrix_cutoff = 1e-15;

public:
/// Create a new solver object
Expand All @@ -100,13 +100,13 @@ namespace pomerol2triqs {
void diagonalize(many_body_op_t const &hamiltonian, std::vector<many_body_op_t> const& integrals_of_motion);

/// Save quantum numbers and block size
void saveQuantumNumbers(const std::string &filename);
void save_quantum_numbers(const std::string &filename);

/// Save all eigenvalues and corresponding quantum numbers
void saveEigenValues(const std::string &filename);
void save_eigenvalues(const std::string &filename);

/// Set DensityMatrixCutoff (default: 1e-15, 0 = No cutoff). DensityMatrix will be recomputed.
void setDensityMatrixCutoff(const double DensityMatrixCutoff);
/// Set density-matrix cutoff (default: 1e-15, 0 = No cutoff). Density matrix will be recomputed.
void set_density_matrix_cutoff(const double cutoff);

/// Green's function in Matsubara frequencies
block_gf<imfreq> G_iw(gf_struct_t const &gf_struct, double beta, int n_iw);
Expand All @@ -130,8 +130,8 @@ namespace pomerol2triqs {
// block2_gf<w_l_lp_t, tensor_valued<4>> G2_iw_l_lp(g2_iw_l_lp_params_t const &p);
};

inline void pomerol_ed::setDensityMatrixCutoff(const double DensityMatrixCutoff){
this->DensityMatrixCutoff = DensityMatrixCutoff;
inline void pomerol_ed::set_density_matrix_cutoff(const double cutoff){
this->density_matrix_cutoff = cutoff;
rho.release();
}
}
8 changes: 4 additions & 4 deletions example/2band.atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
ed.diagonalize(H)

# save data
ed.saveQuantumNumbers("quantum_numbers.dat")
ed.saveEigenValues("eigenvalues.dat")
ed.save_quantum_numbers("quantum_numbers.dat")
ed.save_eigenvalues("eigenvalues.dat")

# set DensityMatrixCutoff
ed.setDensityMatrixCutoff(1e-10)
# set density-matrix cutoff
ed.set_density_matrix_cutoff(1e-10)

# Compute G(i\omega)
G_iw = ed.G_iw(gf_struct, beta, n_iw)
Expand Down
8 changes: 4 additions & 4 deletions example/slater.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@
# ed.diagonalize(H, [N,]) # only N

# save data
ed.saveQuantumNumbers("quantum_numbers.dat")
ed.saveEigenValues("eigenvalues.dat")
ed.save_quantum_numbers("quantum_numbers.dat")
ed.save_eigenvalues("eigenvalues.dat")

# set DensityMatrixCutoff
ed.setDensityMatrixCutoff(1e-10)
# set density-matrix cutoff
ed.set_density_matrix_cutoff(1e-10)

# Compute G(i\omega)
G_iw = ed.G_iw(gf_struct, beta, n_iw)
Expand Down
14 changes: 7 additions & 7 deletions python/pomerol2triqs_desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@
c.add_method("""void diagonalize (many_body_op_t hamiltonian, std::vector<many_body_op_t> integrals_of_motion)""",
doc = """Diagonalize Hamiltonian using provided integrals of motion """)

c.add_method("""void saveQuantumNumbers (std::string filename)""",
c.add_method("""void save_quantum_numbers (std::string filename)""",
doc = """Save quantum numbers and block size """)

c.add_method("""void saveEigenValues (std::string filename)""",
c.add_method("""void save_eigenvalues (std::string filename)""",
doc = """Save all eigenvalues and corresponding quantum numbers """)

c.add_method("""void setDensityMatrixCutoff (double DensityMatrixCutoff)""",
doc = """Set DensityMatrixCutoff (default: 1e-15, 0 = No cutoff). DensityMatrix will be recomputed. """)
c.add_method("""void set_density_matrix_cutoff (double cutoff)""",
doc = r"""Set density-matrix cutoff (default: 1e-15, 0 = No cutoff). Density matrix will be recomputed.""")

c.add_method("""block_gf<imfreq> G_iw (gf_struct_t gf_struct, double beta, int n_iw)""",
doc = """Green\'s function in Matsubara frequencies """)
doc = r"""Green's function in Matsubara frequencies""")

c.add_method("""block_gf<imtime> G_tau (gf_struct_t gf_struct, double beta, int n_tau)""",
doc = """Green\'s function in imaginary time """)
doc = r"""Green's function in imaginary time""")

c.add_method("""block_gf<refreq> G_w (gf_struct_t gf_struct, double beta, std::pair<double,double> energy_window, int n_w, double im_shift = 0)""",
doc = """Retarded Green\'s function on real energy axis """)
doc = r"""Retarded Green's function on real energy axis""")

c.add_method("""array<std::complex<double>, 3> G2_iw (**pomerol2triqs::g2_iw_inu_inup_params_t)""",
doc = r"""Two-particle Green's function, Matsubara frequencies""")
Expand Down

0 comments on commit 5b5fcc6

Please sign in to comment.