SciPost logo

SciPost Submission Page

DanceQ: High-performance library for number conserving bases

by Robin Schäfer, David J. Luitz

Submission summary

Authors (as registered SciPost users): David J. Luitz · Robin Schäfer
Submission information
Preprint Link: scipost_202411_00014v1  (pdf)
Code repository: https://gitlab.com/DanceQ/danceq
Code version: 1.0
Code license: GNU General Public License v3.0
Date accepted: 2024-11-26
Date submitted: 2024-11-07 00:29
Submitted by: Schäfer, Robin
Submitted to: SciPost Physics Codebases
Ontological classification
Academic field: Physics
Specialties:
  • Condensed Matter Physics - Theory
  • Condensed Matter Physics - Computational
Approaches: Theoretical, Computational

Abstract

The complexity of quantum many-body problems scales exponentially with the size of the system, rendering any finite size scaling analysis a formidable challenge. This is particularly true for methods based on the full representation of the wave function, where one simply accepts the enormous Hilbert space dimensions and performs linear algebra operations, e.g., for finding the ground state of the Hamiltonian. If the system satisfies an underlying symmetry where an operator with degenerate spectrum commutes with the Hamiltonian, it can be block-diagonalized, thus reducing the complexity at the expense of additional bookkeeping. At the most basic level, required for Krylov space techniques (like the Lanczos algorithm) it is necessary to implement a matrix-vector product of a block of the Hamiltonian with arbitrary block-wavefunctions, potentially without holding the Hamiltonian block in memory. An efficient implementation of this operation requires the calculation of the position of an arbitrary basis vector in the canonical ordering of the basis of the block. We present here an elegant and powerful, multi-dimensional approach to this problem for the $U(1)$ symmetry appearing in problems with particle number conservation. Our divide-and-conquer algorithm uses multiple subsystems and hence generalizes previous approaches to make them scalable. In addition to the theoretical presentation of our algorithm, we provide DanceQ, a flexible and modern - header only - C++20 implementation to manipulate, enumerate, and map to its index any basis state in a given particle number sector as open source software under https://DanceQ.gitlab.io/danceq.

Author comments upon resubmission

Dear Editor,

We are pleased to resubmit our manuscript "DanceQ: High-performance library for number-conserving bases" and we strongly appreciate the referees' thorough reading and thoughtful feedback, which have greatly enhanced our work. We have also prepared detailed responses to each report and hope our manuscript is accepted for publication.

Sincerely,
The Authors

List of changes

List of major changes:

* SciPost template
* An added section introducing DanceQ and optimized sectioning
* A new figure showing the runtime of a matrix-free matrix-vector multiplication versus the number of subsystems
* Example code in the appendix
* Aspect ratio of figures
* Relocation of the Sparse Tensor Storage section into the appendix

Current status:
Accepted in target Journal

Editorial decision: For Journal SciPost Physics Codebases: Publish
(status: Editorial decision fixed and (if required) accepted by authors)


Reports on this Submission

Report #4 by Anonymous (Referee 4) on 2024-11-18 (Invited Report)

Report

I thank the authors for the detailed response.

I think the revised version easily surpasses the acceptance criteria and will present a valuable contribution to SciPost Codebases.

Recommendation

Publish (easily meets expectations and criteria for this Journal; among top 50%)

  • validity: -
  • significance: -
  • originality: -
  • clarity: -
  • formatting: -
  • grammar: -

Author:  Robin Schäfer  on 2024-11-27  [id 4996]

(in reply to Report 4 on 2024-11-18)

We thank Referee 1 for their recommendation for publication.

Report #3 by Anonymous (Referee 1) on 2024-11-10 (Invited Report)

Report

I have read the Reports from all four Referees, the replies of the authors, and the revised manuscript. I am glad to observe that the authors have expanded their manuscript and improved it significantly. The original version of the manuscript was already good; with the improvements, this is now a very good contribution that in my opinion SciPost Physics Codebases should be proud to publish.

When rereading the manuscript, I nevertheless stumbled across a number of issues of a more typographic nature. Some can be considered as hints for proofreading. However, there are a few that in my opinion would merit to be addressed before the manuscript goes into production.

Requested changes

1- Line 73 on page 3: "maximization" $\to$ "magnetization". See also Report #1 by Anonymous (Referee 2) on 2024-11-7.
2- A number of equations lack full stops (".") at the end, notably Eqs. (5), (6), (12), (14), the unnumbered equation between lines 392 and 393, (26), (28), the unnumbered equation between lines 425 and 426, (30), the unnumbered equation between lines 450 and 451, the unnumbered equation between lines 455 and 456, (31), (32), (A.1), (A.3), (A.4), (A.7), (C.1), the unnumbered equation between lines 831 and 832, and (D.2).
3- I suspect that the "appendix B" on line 141 on page 5 is appendix B of Ref. [57]. If so, I recommend adding a "thereof" at the end of the sentence for clarity.
4- Line 170 on page 6: remove the "a" between "requires" and "three".
5- Figures 2 and 3: with the SciPost style file, the fonts are now on the small side. Maybe it would help if the figure could be typeset to page width.
6- Line 276 on page 9: I believe that the correct mathematical term is "monotonically" (not "monotonously").
7- Line 285 on page 10: the space before the footnote 1 appears unnecessarily large to me.
8- Line 369 on page 13: The summation upper bound $i-1$ contains the summation index $i$. Please check and correct, as appropriate.
9- There is a stray comma "," at the beginning of line 398 on page 14.
10- Is the a good reason to typeset the "${\rm index}(\vec{x})$" in the unnumbered equation between lines 425 and 426 one page 15 on a separate line?
11- Is there a good reason for typesetting the unnumbered equation between lines 455 and 456 on page 16 on two lines? And should there really be a full stop at the end of its first line?
12- The page break after line 647 on page 21 is strange.
13- When rearranging Fig. 5, the authors forgot to replace "left" and "right" by "top" and "bottom", respectively (second line of the caption of Fig. 5 and line 662 on page 23).
14- Line 722 on page 25: remove "the" between "where" and "more" (?).
15- Line 731 on page 25: I recommend to leave the judgment to the reader and thus remove the "elegant".
16- The index $i$ is used both for the product and the sum in Eq. (A.2). This looks ambiguous. Please check and correct, as appropriate.
17- Line 815 on page 29: "${\tt get\_local\_index}$" spills over. Can this be fixed?
18- If I am not mistaken, Algorithms 2-4 are not referenced in the text. I recommend adding at least one sentence that refers to these.
19- For clarity, I recommend to add parentheses ("$($" and "$)$") to the first sum in Eqs. (C.1) and (C.2).
20- Insert "to" between "have" and "execute" on line 829 on page 29.
21- Line 845 on page 32: "$Q^{N_{\rm tensor}} \times Q^{N_{\rm tensor}}$" spills over. Can this be fixed?
22- Eq. (D.2): There is risk of confusion of the multiplicative factor $i$ with the imaginary unit. So, change notation? In addition, parentheses ("$($" and "$)$") under the sum may help to improve clarity.
23- Refs. [16,20]: capitalize the "I" in the titles?
24- Some names in titles of references still need to be capitalized, in particular: "Bloch" [21], "Bose-Hubbard" [43,56], "Hamiltonian" [60], and "Gray" [60]. See also item 2 in Report #3 by Anonymous (Referee 3) on 2024-9-12.
25- Refs. [34,35]: Can you include the links to the corresponding repositories?
26- Ref [39]: Page number (238) and DOI (https://doi.org/10.1098/rspa.1963.0204) are missing.
27- Ref. [62]: "4" is the repository, not page number $\Rightarrow$ remove the "p.".

Recommendation

Ask for minor revision

  • validity: top
  • significance: high
  • originality: high
  • clarity: high
  • formatting: excellent
  • grammar: excellent

Author:  Robin Schäfer  on 2024-11-27  [id 4999]

(in reply to Report 3 on 2024-11-10)

We sincerely appreciate Referee 4's thorough review and the effort invested in providing a comprehensive list of comments. We are also grateful for their acknowledgment of the manuscript's improvements and their recommendation for publication.

Report #2 by Anonymous (Referee 2) on 2024-11-7 (Invited Report)

Report

The authors have improved their manuscript in a significant way, providing useful examples. I still do not understand their comment about the gray code since it can be readily applied to a number conservation case as well, e.g. enumerating in a lexographic order all binary numbers with a fixed number of "1", see
https://docs.python.org/3/library/itertools.html#itertools.combinations.

I think that this work can be quite useful so I recommend it for publication.

Recommendation

Publish (easily meets expectations and criteria for this Journal; among top 50%)

  • validity: -
  • significance: -
  • originality: -
  • clarity: -
  • formatting: -
  • grammar: -

Author:  Robin Schäfer  on 2024-11-27  [id 4998]

(in reply to Report 2 on 2024-11-07)

We thank Referee 3 for recognizing the improvements made to our manuscript and for their recommendation for publication. While we are familiar with the itertools package, we have not encountered any reference to a number-conserving application of Gray codes within it.

Report #1 by Anonymous (Referee 3) on 2024-11-7 (Invited Report)

Report

The revised manuscript can be published after correcting the mistake in line 73: maximisation->magnetization.

Recommendation

Publish (easily meets expectations and criteria for this Journal; among top 50%)

  • validity: high
  • significance: high
  • originality: high
  • clarity: high
  • formatting: good
  • grammar: excellent

Author:  Robin Schäfer  on 2024-11-27  [id 4997]

(in reply to Report 1 on 2024-11-07)

We have corrected the typo in line 73 and thank Referee 2 for recommending our manuscript for publication.

Login to report or comment