From 55d6fa46ecc9b9dbc24a5ad94cb66eef4998d852 Mon Sep 17 00:00:00 2001 From: jiebin chen Date: Mon, 8 Jun 2026 07:06:28 +0000 Subject: [PATCH] fix(io): add space separators in out_mat_l format string When the number of atoms exceeds 150, the columns in Lx/Ly/Lz.dat output files become indistinguishable because the %4d format fields are not separated by spaces. Fixes #6907 --- source/source_io/module_hs/cal_pLpR.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/source_io/module_hs/cal_pLpR.cpp b/source/source_io/module_hs/cal_pLpR.cpp index 41f1488a28a..a9eb2223762 100644 --- a/source/source_io/module_hs/cal_pLpR.cpp +++ b/source/source_io/module_hs/cal_pLpR.cpp @@ -273,9 +273,9 @@ void ModuleIO::AngularMomentumCalculator::kernel( // il and jl are indexes of the angular momentum, // iz and jz are indexes of the zeta functions // im and jm are indexes of the magnetic quantum numbers. - std::string fmtstr = "%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d%4d"; - fmtstr += "%" + std::to_string(precision*2) + "." + std::to_string(precision) + "e"; - fmtstr += "%" + std::to_string(precision*2) + "." + std::to_string(precision) + "e\n"; + std::string fmtstr = "%4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d"; + fmtstr += " %" + std::to_string(precision*2) + "." + std::to_string(precision) + "e"; + fmtstr += " %" + std::to_string(precision*2) + "." + std::to_string(precision) + "e\n"; FmtCore fmt(fmtstr); // placeholders