Skip to content

Conversation

@1041176461
Copy link

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

@ESROAMER
Copy link
Owner

ESROAMER commented Mar 5, 2025

The process here is too long for me to carefully check everything. I suggest replacing Hexx with the full Hamiltonian output velocity matrix and comparing it with the velocity matrix from pyatb for a benchmark.

std::complex<double> kphase = std::complex<double>(cosp, sinp);

tmp.find_R(r_index);
tmp.add_to_matrix(hk, ncol, kphase * ModuleBase::IMAG_UNIT * std::complex<double>(dR[ix]), hk_type);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is kphase * ModuleBase::IMAG_UNIT * std::complex<double>(dR[ix]) for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TK* hk);

template <typename Tdata>
extern void add_partial_Hexx(const K_Vectors& kv,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does partial means?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$$ \partial_{k_\alpha} Hk = \sum_{R} i R_\alpha e^{i \mathbf{k} \cdot \mathbf{R}} HR $$

= rR[i_alpha]->find_matrix(iat1, iat2, r_index.x, r_index.y, r_index.z);
if (HlocR == nullptr)
{
rR[i_alpha]->insert_pair(atom_ij);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to allocate memory for rR here. A output test would be helpful to check if rR is consistent with ABACUS output r matrix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has been allocated here (

rR[i_alpha] = new hamilt::HContainer<double>(pv);
)

@ESROAMER ESROAMER merged commit 420e482 into ESROAMER:hytd Apr 25, 2025
3 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants