Skip to content

Conversation

@ABesharat
Copy link
Contributor

This branch provides hardcoded biorthgonal and nns coefficients

…nal_coefficients' into azam/feature/hardcoded_biorthogonal_coefficients
…eature/hardcoded_biorthogonal_coefficients

# Conflicts:
#	SeQuant/domain/mbpt/biorthogonalization.cpp
Copy link
Member

@evaleev evaleev left a comment

Choose a reason for hiding this comment

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

some initial changes. Use these to go over the PR and address possible other places where these comments apply.

@ABesharat ABesharat requested a review from evaleev December 25, 2025 22:14
bool using_hardcoded = false;

if (n_particles <= 6) {
std::cout << "using hardcoded biorthogonalization coefficients for rank = "
Copy link
Member

Choose a reason for hiding this comment

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

This can be removed, and the same below.

if (range_rank <= 1) return input_arr;
btas::Tensor<Args...> result{input_arr.range()};
result.fill(0);
const auto lannot = perm;
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary? You can directly use perm in the btas::permute call, right?

return eval_result<this_type>(
biorthogonal_nns_project_ta(get<ArrayT>(), bra_rank));
if constexpr (std::is_integral_v<numeric_type>) {
std::abort();
Copy link
Member

Choose a reason for hiding this comment

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

Switch to SEQUANT_ABORT and with an error message.

return eval_result<ResultTensorBTAS<T>>(
biorthogonal_nns_project_btas(get<T>(), bra_rank));
if constexpr (std::is_integral_v<numeric_type>) {
std::abort();
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

#include <vector>

namespace sequant {

Copy link
Member

@ajay-mk ajay-mk Dec 25, 2025

Choose a reason for hiding this comment

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

Functions in this file need to be documented. Since the biorthogonalization logic is in the mbpt namespace, makes sense to move these components there, or even to a detail namespace.

PS: In case you are moving these to mbpt::detail namespace, merge with the latest master to avoid namespace ambiguity issues.

if (!first_row.empty()) {
return make_hardcoded_biorth_coeffs_matrix(first_row, n_particles);
}
return Eigen::Matrix<sequant::rational, Eigen::Dynamic, Eigen::Dynamic>(0, 0);
Copy link
Member

Choose a reason for hiding this comment

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

Why return an empty matrix?


target_link_libraries(SeQuant PUBLIC range-v3::range-v3 Boost::regex Boost::locale Boost::headers SeQuant-bliss Threads::Threads)
target_link_libraries(SeQuant PRIVATE libperm::libperm $<BUILD_LOCAL_INTERFACE:utfcpp>)
target_link_libraries(SeQuant PUBLIC libperm::libperm $<BUILD_LOCAL_INTERFACE:utfcpp>)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If possible, I would suggest/prefer keeping these dependencies private.

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.

5 participants