From 6a99f5b5c54e0385aa314afd1e7f1c3d187196ce Mon Sep 17 00:00:00 2001 From: Yury Lysogorskiy Date: Tue, 6 Apr 2021 17:24:54 +0200 Subject: [PATCH 01/23] WIP: - no auto-download of user-pace src yet - lib/pace/*.cpp,*.h are provided explicitly yet. - implement CMake integration in USER-PACE.cmake and in CMakeLists.txt --- cmake/CMakeLists.txt | 6 +- cmake/Modules/Packages/USER-PACE.cmake | 14 + lib/pace/Install.py | 1 + lib/pace/LICENSE | 674 ++++++++ lib/pace/README | 0 lib/pace/TODO | 30 + lib/pace/ace_abstract_basis.cpp | 184 +++ lib/pace/ace_abstract_basis.h | 169 ++ lib/pace/ace_array2dlm.h | 579 +++++++ lib/pace/ace_arraynd.h | 1949 ++++++++++++++++++++++++ lib/pace/ace_c_basis.cpp | 980 ++++++++++++ lib/pace/ace_c_basis.h | 155 ++ lib/pace/ace_c_basisfunction.h | 251 +++ lib/pace/ace_complex.h | 266 ++++ lib/pace/ace_contigous_array.h | 249 +++ lib/pace/ace_evaluator.cpp | 660 ++++++++ lib/pace/ace_evaluator.h | 230 +++ lib/pace/ace_flatten_basis.cpp | 130 ++ lib/pace/ace_flatten_basis.h | 135 ++ lib/pace/ace_radial.cpp | 566 +++++++ lib/pace/ace_radial.h | 324 ++++ lib/pace/ace_recursive.cpp | 1340 ++++++++++++++++ lib/pace/ace_recursive.h | 247 +++ lib/pace/ace_spherical_cart.cpp | 221 +++ lib/pace/ace_spherical_cart.h | 134 ++ lib/pace/ace_timing.h | 126 ++ lib/pace/ace_types.h | 45 + lib/pace/ace_version.h | 39 + lib/pace/ships_radial.cpp | 388 +++++ lib/pace/ships_radial.h | 158 ++ src/Makefile | 4 +- src/USER-PACE/Install.sh | 68 + src/USER-PACE/LICENSE | 674 ++++++++ src/USER-PACE/pair_pace.cpp | 458 ++++++ src/USER-PACE/pair_pace.h | 97 ++ 35 files changed, 11546 insertions(+), 5 deletions(-) create mode 100644 cmake/Modules/Packages/USER-PACE.cmake create mode 100644 lib/pace/Install.py create mode 100644 lib/pace/LICENSE create mode 100644 lib/pace/README create mode 100644 lib/pace/TODO create mode 100644 lib/pace/ace_abstract_basis.cpp create mode 100644 lib/pace/ace_abstract_basis.h create mode 100644 lib/pace/ace_array2dlm.h create mode 100644 lib/pace/ace_arraynd.h create mode 100644 lib/pace/ace_c_basis.cpp create mode 100644 lib/pace/ace_c_basis.h create mode 100644 lib/pace/ace_c_basisfunction.h create mode 100644 lib/pace/ace_complex.h create mode 100644 lib/pace/ace_contigous_array.h create mode 100644 lib/pace/ace_evaluator.cpp create mode 100644 lib/pace/ace_evaluator.h create mode 100644 lib/pace/ace_flatten_basis.cpp create mode 100644 lib/pace/ace_flatten_basis.h create mode 100644 lib/pace/ace_radial.cpp create mode 100644 lib/pace/ace_radial.h create mode 100644 lib/pace/ace_recursive.cpp create mode 100644 lib/pace/ace_recursive.h create mode 100644 lib/pace/ace_spherical_cart.cpp create mode 100644 lib/pace/ace_spherical_cart.h create mode 100644 lib/pace/ace_timing.h create mode 100644 lib/pace/ace_types.h create mode 100644 lib/pace/ace_version.h create mode 100644 lib/pace/ships_radial.cpp create mode 100644 lib/pace/ships_radial.h create mode 100644 src/USER-PACE/Install.sh create mode 100644 src/USER-PACE/LICENSE create mode 100644 src/USER-PACE/pair_pace.cpp create mode 100644 src/USER-PACE/pair_pace.h diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 21d965ebba..4bd5ea8fec 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -119,7 +119,7 @@ set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE USER-LB USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH - USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF) + USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-PACE) set(SUFFIX_PACKAGES CORESHELL GPU KOKKOS OPT USER-INTEL USER-OMP) @@ -382,9 +382,9 @@ else() endif() foreach(PKG_WITH_INCL KSPACE PYTHON MLIAP VORONOI USER-COLVARS USER-MOLFILE USER-NETCDF USER-PLUMED USER-QMMM - USER-QUIP USER-SCAFACOS USER-SMD USER-VTK KIM LATTE MESSAGE MSCG COMPRESS) + USER-QUIP USER-SCAFACOS USER-SMD USER-VTK KIM LATTE MESSAGE MSCG COMPRESS USER-PACE) if(PKG_${PKG_WITH_INCL}) - include(Packages/${PKG_WITH_INCL}) + include(Packages/${PKG_WITH_INCL}) endif() endforeach() diff --git a/cmake/Modules/Packages/USER-PACE.cmake b/cmake/Modules/Packages/USER-PACE.cmake new file mode 100644 index 0000000000..c9e8e1bcfe --- /dev/null +++ b/cmake/Modules/Packages/USER-PACE.cmake @@ -0,0 +1,14 @@ +set(PACE_EVALUATOR_PATH ${LAMMPS_LIB_SOURCE_DIR}/pace) +message("CMakeLists.txt DEBUG: PACE_EVALUATOR_PATH=${PACE_EVALUATOR_PATH}") +set(PACE_EVALUATOR_SRC_PATH ${PACE_EVALUATOR_PATH}) + +FILE(GLOB PACE_EVALUATOR_SOURCE_FILES ${PACE_EVALUATOR_SRC_PATH}/*.cpp) +set(PACE_EVALUATOR_INCLUDE_DIR ${PACE_EVALUATOR_SRC_PATH}) + + +##### aceevaluator ##### +add_library(aceevaluator ${PACE_EVALUATOR_SOURCE_FILES}) +target_include_directories(aceevaluator PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR}) +target_compile_options(aceevaluator PRIVATE -O2) +set_target_properties(aceevaluator PROPERTIES OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) +target_link_libraries(lammps PRIVATE aceevaluator) \ No newline at end of file diff --git a/lib/pace/Install.py b/lib/pace/Install.py new file mode 100644 index 0000000000..f87f5c14cb --- /dev/null +++ b/lib/pace/Install.py @@ -0,0 +1 @@ +# TODO \ No newline at end of file diff --git a/lib/pace/LICENSE b/lib/pace/LICENSE new file mode 100644 index 0000000000..f288702d2f --- /dev/null +++ b/lib/pace/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/lib/pace/README b/lib/pace/README new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/pace/TODO b/lib/pace/TODO new file mode 100644 index 0000000000..8021916923 --- /dev/null +++ b/lib/pace/TODO @@ -0,0 +1,30 @@ +[TODO/DONE] pair_pace.cpp and pair_pace.h will have to go into src/USER-PACE and thus also need to conform to our requirements. + +[TODO] also src/USER-PACE would need to have an Install.sh file that integrates the settings from the lib folder into the conventional build process. +[TODO] there would have to be a lib/pace folder for building/interfacing to the library. + +[TODO] how you organize your repo is up to you. a better way to describe what you would have to do is to point you to examples. +which of the examples is relevant depends on what build system you are using for your "PACE" external package. + +If you are using CMake to build it, you can look at the KIM package +If you are using autoconf/automake, you can look at the USER-PLUMED package +If you are using neither (just a plain Makefile), you can look at the VORONOI or QUIP package +The following additional modifications are needed: + +[TODO] lib/pace: needs one or more Makefile.lammps, a README and an Install.py file +[TODO] src/Makefile: needs support for the USER-PACE package and compiling via lib-pace. Also the package needs to be added to the PACKEXT and PACKLIB variables + +[DONE] cmake/Modules/Packages/USER-PACE.cmake needs to be added +[DONE] cmake/CMakeLists.txt needs to include it in case the package is enabled. + +[TODO] doc/src/Build_extra.rst needs to include the build instructions for CMake and traditional make +[TODO] doc/src/Package_user.rst and doc/src/Package_details.rst needs to contain relevant information and links + + +Because of the different build systems, there are different steps required, but each of the examples I've pointed out are tested and used regularly and thus should be working sufficiently well. +Mind you the QUIP package is set up in such a way, that no automatic download is possible and a manual download and compilation is required. So that is the least preferred and least convenient option. + +We are happy to provide more details, but that requires that you first have something that already is following either of the suggested variants, so that we don't have to discuss in all generality. + +I would also suggest to close this pull request here, leave all files in place, but then start a new branch from the current master and then move the few things over you need to retain, +add the build environment files and then start working on getting it to do what it should. \ No newline at end of file diff --git a/lib/pace/ace_abstract_basis.cpp b/lib/pace/ace_abstract_basis.cpp new file mode 100644 index 0000000000..3d8afafdaf --- /dev/null +++ b/lib/pace/ace_abstract_basis.cpp @@ -0,0 +1,184 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Lysogorskiy Yury on 28.04.2020. + +#include "ace_abstract_basis.h" + +////embedding function +////case nemb = 1 only implementation +////F = sign(x)*( ( 1 - exp(-(w*x)^3) )*abs(x)^m + ((1/w)^(m-1))*exp(-(w*x)^3)*abs(x) ) +//// !! no prefactor wpre +void Fexp(DOUBLE_TYPE x, DOUBLE_TYPE m, DOUBLE_TYPE &F, DOUBLE_TYPE &DF) { + DOUBLE_TYPE w = 1.e6; + DOUBLE_TYPE eps = 1e-10; + + DOUBLE_TYPE lambda = pow(1.0 / w, m - 1.0); + if (abs(x) > eps) { + DOUBLE_TYPE g; + DOUBLE_TYPE a = abs(x); + DOUBLE_TYPE am = pow(a, m); + DOUBLE_TYPE w3x3 = pow(w * a, 3); + DOUBLE_TYPE sign_factor = (signbit(x) ? -1 : 1); + if (w3x3 > 30.0) + g = 0.0; + else + g = exp(-w3x3); + + DOUBLE_TYPE omg = 1.0 - g; + F = sign_factor * (omg * am + lambda * g * a); + DOUBLE_TYPE dg = -3.0 * w * w * w * a * a * g; + DF = m * pow(a, m - 1.0) * omg - am * dg + lambda * dg * a + lambda * g; + } else { + F = lambda * x; + DF = lambda; + } +} + + +//Scaled-shifted embedding function +//F = sign(x)*( ( 1 - exp(-(w*x)^3) )*abs(x)^m + ((1/w)^(m-1))*exp(-(w*x)^3)*abs(x) ) +// !! no prefactor wpre +void FexpShiftedScaled(DOUBLE_TYPE rho, DOUBLE_TYPE mexp, DOUBLE_TYPE &F, DOUBLE_TYPE &DF) { + DOUBLE_TYPE eps = 1e-10; + DOUBLE_TYPE a, xoff, yoff, nx, exprho; + + if (abs(mexp - 1.0) < eps) { + F = rho; + DF = 1; + } else { + a = abs(rho); + exprho = exp(-a); + nx = 1. / mexp; + xoff = pow(nx, (nx / (1.0 - nx))) * exprho; + yoff = pow(nx, (1 / (1.0 - nx))) * exprho; + DOUBLE_TYPE sign_factor = (signbit(rho) ? -1 : 1); + F = sign_factor * (pow(xoff + a, mexp) - yoff); + DF = yoff + mexp * (-xoff + 1.0) * pow(xoff + a, mexp - 1.); + } +} + +void ACEAbstractBasisSet::inner_cutoff(DOUBLE_TYPE rho_core, DOUBLE_TYPE rho_cut, DOUBLE_TYPE drho_cut, + DOUBLE_TYPE &fcut, DOUBLE_TYPE &dfcut) { + + DOUBLE_TYPE rho_low = rho_cut - drho_cut; + if (rho_core >= rho_cut) { + fcut = 0; + dfcut = 0; + } else if (rho_core <= rho_low) { + fcut = 1; + dfcut = 0; + } else { + fcut = 0.5 * (1 + cos(M_PI * (rho_core - rho_low) / drho_cut)); + dfcut = -0.5 * sin(M_PI * (rho_core - rho_low) / drho_cut) * M_PI / drho_cut; + } +} + +void ACEAbstractBasisSet::FS_values_and_derivatives(Array1D &rhos, DOUBLE_TYPE &value, + Array1D &derivatives, DENSITY_TYPE ndensity) { + DOUBLE_TYPE F, DF = 0, wpre, mexp; + for (int p = 0; p < ndensity; p++) { + wpre = FS_parameters.at(p * ndensity + 0); + mexp = FS_parameters.at(p * ndensity + 1); + if (this->npoti == "FinnisSinclair") + Fexp(rhos(p), mexp, F, DF); + else if (this->npoti == "FinnisSinclairShiftedScaled") + FexpShiftedScaled(rhos(p), mexp, F, DF); + value += F * wpre; // * weight (wpre) + derivatives(p) = DF * wpre;// * weight (wpre) + } +} + +void ACEAbstractBasisSet::_clean() { + + delete[] elements_name; + elements_name = nullptr; + delete radial_functions; + radial_functions = nullptr; +} + +ACEAbstractBasisSet::ACEAbstractBasisSet(const ACEAbstractBasisSet &other) { + ACEAbstractBasisSet::_copy_scalar_memory(other); + ACEAbstractBasisSet::_copy_dynamic_memory(other); +} + +ACEAbstractBasisSet &ACEAbstractBasisSet::operator=(const ACEAbstractBasisSet &other) { + if (this != &other) { + // deallocate old memory + ACEAbstractBasisSet::_clean(); + //copy scalar values + ACEAbstractBasisSet::_copy_scalar_memory(other); + //copy dynamic memory + ACEAbstractBasisSet::_copy_dynamic_memory(other); + } + return *this; +} + +ACEAbstractBasisSet::~ACEAbstractBasisSet() { + ACEAbstractBasisSet::_clean(); +} + +void ACEAbstractBasisSet::_copy_scalar_memory(const ACEAbstractBasisSet &src) { + deltaSplineBins = src.deltaSplineBins; + FS_parameters = src.FS_parameters; + npoti = src.npoti; + + nelements = src.nelements; + rankmax = src.rankmax; + ndensitymax = src.ndensitymax; + nradbase = src.nradbase; + lmax = src.lmax; + nradmax = src.nradmax; + cutoffmax = src.cutoffmax; + + spherical_harmonics = src.spherical_harmonics; + + rho_core_cutoffs = src.rho_core_cutoffs; + drho_core_cutoffs = src.drho_core_cutoffs; + + + E0vals = src.E0vals; +} + +void ACEAbstractBasisSet::_copy_dynamic_memory(const ACEAbstractBasisSet &src) {//allocate new memory + if (src.elements_name == nullptr) + throw runtime_error("Could not copy ACEAbstractBasisSet::elements_name - array not initialized"); + elements_name = new string[nelements]; + //copy + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + elements_name[mu] = src.elements_name[mu]; + } + radial_functions = src.radial_functions->clone(); +} + +SPECIES_TYPE ACEAbstractBasisSet::get_species_index_by_name(const string &elemname) { + for (SPECIES_TYPE t = 0; t < nelements; t++) { + if (this->elements_name[t] == elemname) + return t; + } + return -1; +} \ No newline at end of file diff --git a/lib/pace/ace_abstract_basis.h b/lib/pace/ace_abstract_basis.h new file mode 100644 index 0000000000..165ea9496f --- /dev/null +++ b/lib/pace/ace_abstract_basis.h @@ -0,0 +1,169 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Lysogorskiy Yury on 28.04.2020. + +#ifndef ACE_EVALUATOR_ACE_ABSTRACT_BASIS_H +#define ACE_EVALUATOR_ACE_ABSTRACT_BASIS_H + +#include +#include + +#include "ace_c_basisfunction.h" +#include "ace_contigous_array.h" +#include "ace_radial.h" +#include "ace_spherical_cart.h" +#include "ace_types.h" + +using namespace std; + +/** + * Abstract basis set class + */ +class ACEAbstractBasisSet { +public: + SPECIES_TYPE nelements = 0; ///< number of elements in basis set + RANK_TYPE rankmax = 0; ///< maximum value of rank + DENSITY_TYPE ndensitymax = 0; ///< maximum number of densities \f$ \rho^{(p)} \f$ + NS_TYPE nradbase = 0; ///< maximum number of radial \f$\textbf{basis}\f$ function \f$ g_{k}(r) \f$ + LS_TYPE lmax = 0; ///< \f$ l_\textrm{max} \f$ - maximum value of orbital moment \f$ l \f$ + NS_TYPE nradmax = 0; ///< maximum number \f$ n \f$ of radial function \f$ R_{nl}(r) \f$ + DOUBLE_TYPE cutoffmax = 0; ///< maximum value of cutoff distance among all species in basis set + DOUBLE_TYPE deltaSplineBins = 0; ///< Spline interpolation density + + string npoti = "FinnisSinclair"; ///< FS and embedding function combination + + string *elements_name = nullptr; ///< Array of elements name for mapping from index (0..nelements-1) to element symbol (string) + + AbstractRadialBasis *radial_functions = nullptr; ///< object to work with radial functions + ACECartesianSphericalHarmonics spherical_harmonics; ///< object to work with spherical harmonics in Cartesian representation + + + Array1D rho_core_cutoffs; ///< energy-based inner cut-off + Array1D drho_core_cutoffs; ///< decay of energy-based inner cut-off + + vector FS_parameters; ///< parameters for cluster functional, see Eq.(3) in implementation notes or Eq.(53) in PRB 99, 014104 (2019) + + // E0 values + Array1D E0vals; + + /** + * Default empty constructor + */ + ACEAbstractBasisSet() = default; + + // copy constructor, operator= and destructor (see. Rule of Three) + + /** + * Copy constructor (see. Rule of Three) + * @param other + */ + ACEAbstractBasisSet(const ACEAbstractBasisSet &other); + + /** + * operator= (see. Rule of Three) + * @param other + * @return + */ + ACEAbstractBasisSet &operator=(const ACEAbstractBasisSet &other); + + /** + * virtual destructor (see. Rule of Three) + */ + virtual ~ACEAbstractBasisSet(); + + /** + * Computing cluster functional \f$ F(\rho_i^{(1)}, \dots, \rho_i^{(P)}) \f$ + * and its derivatives \f$ (\partial F/\partial\rho_i^{(1)}, \dots, \partial F/\partial \rho_i^{(P)} ) \f$ + * @param rhos array with densities \f$ \rho^{(p)} \f$ + * @param value (out) return value of cluster functional + * @param derivatives (out) array of derivatives \f$ (\partial F/\partial\rho_i^{(1)}, \dots, \partial F/\partial \rho_i^{(P)} ) \f$ + * @param ndensity number \f$ P \f$ of densities to use + */ + void FS_values_and_derivatives(Array1D &rhos, DOUBLE_TYPE &value, Array1D &derivatives, + DENSITY_TYPE ndensity); + + /** + * Computing hard core pairwise repulsive potential \f$ f_{cut}(\rho_i^{(\textrm{core})})\f$ and its derivative, + * see Eq.(29) of implementation notes + * @param rho_core value of \f$ \rho_i^{(\textrm{core})} \f$ + * @param rho_cut \f$ \rho_{cut}^{\mu_i} \f$ value + * @param drho_cut \f$ \Delta_{cut}^{\mu_i} \f$ value + * @param fcut (out) return inner cutoff function + * @param dfcut (out) return derivative of inner cutoff function + */ + static void inner_cutoff(DOUBLE_TYPE rho_core, DOUBLE_TYPE rho_cut, DOUBLE_TYPE drho_cut, DOUBLE_TYPE &fcut, + DOUBLE_TYPE &dfcut); + + + /** + * Virtual method to save potential to file + * @param filename file name + */ + virtual void save(const string &filename) = 0; + + /** + * Virtual method to load potential from file + * @param filename file name + */ + virtual void load(const string filename) = 0; + + /** + * Get the species index by its element name + * @param elemname element name + * @return species index + */ + SPECIES_TYPE get_species_index_by_name(const string &elemname); + + + // routines for copying and cleaning dynamic memory of the class (see. Rule of Three) + + /** + * Routine for clean the dynamically allocated memory\n + * IMPORTANT! It must be idempotent for safety. + */ + virtual void _clean(); + + /** + * Copy dynamic memory from src. Must be override and extended in derived classes! + * @param src source object to copy from + */ + virtual void _copy_dynamic_memory(const ACEAbstractBasisSet &src); + + /** + * Copy scalar values from src. Must be override and extended in derived classes! + * @param src source object to copy from + */ + virtual void _copy_scalar_memory(const ACEAbstractBasisSet &src); +}; + +void Fexp(DOUBLE_TYPE rho, DOUBLE_TYPE mexp, DOUBLE_TYPE &F, DOUBLE_TYPE &DF); + +void FexpShiftedScaled(DOUBLE_TYPE rho, DOUBLE_TYPE mexp, DOUBLE_TYPE &F, DOUBLE_TYPE &DF); + +#endif //ACE_EVALUATOR_ACE_ABSTRACT_BASIS_H diff --git a/lib/pace/ace_array2dlm.h b/lib/pace/ace_array2dlm.h new file mode 100644 index 0000000000..2b38602bc7 --- /dev/null +++ b/lib/pace/ace_array2dlm.h @@ -0,0 +1,579 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Yury Lysogorskiy on 11.01.20. + + +#ifndef ACE_ARRAY2DLM_H +#define ACE_ARRAY2DLM_H + +#include +#include + +#include "ace_arraynd.h" +#include "ace_contigous_array.h" +#include "ace_types.h" + +using namespace std; + +/** + * Contiguous array to organize values by \f$ (l,m) \f$ indiced (orbital moment and its projection). + * Only \f$ l_\textrm{max}\f$ should be provided, \f$ m = -l, \dots,l \f$ + * for \f$ l = 0, \dots, l_\textrm{max}\f$ + * @tparam T type of values to store + */ +template +class Array2DLM : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + + LS_TYPE lmax = 0; ///< orbital dimension \f$ l_{max} \f$ + + bool is_proxy = false; ///< flag to show, if object is owning the memory or just represent it (proxying)dimensions + +public: + /** + * Default empty constructor + */ + Array2DLM() = default; + + /** + * Parametrized constructor + * @param lmax maximum value of \f$ l \f$ + * @param array_name name of the array + */ + explicit Array2DLM(LS_TYPE lmax, string array_name = "Array2DLM") { + init(lmax, array_name); + } + + + /** + * Constructor to create slices-proxy array, i.e. to provide access to the memory, but not to own it. + * @param lmax maximum value of \f$ l \f$ + * @param data_ptr pointer to original data + * @param array_name name of the array + */ + Array2DLM(LS_TYPE lmax, T *data_ptr, string array_name = "Array2DLM") { + this->lmax = lmax; + this->size = (lmax + 1) * (lmax + 1); + this->data = data_ptr; + this->array_name = array_name; + is_proxy = true; + }; + + /** + * Destructor + */ + ~Array2DLM() { + if (!is_proxy) { + if (data != nullptr) delete[] data; + } + data = nullptr; + } + + /** + * Initialize array, allocate memory + * @param lmax maximum value of l + * @param array_name name of the array + */ + void init(LS_TYPE lmax, string array_name = "Array2DLM") { + if (is_proxy) { + char s[1024]; + sprintf(s, "Could not re-initialize proxy-array %s\n", this->array_name.c_str()); + throw logic_error(s); + } + this->lmax = lmax; + this->array_name = array_name; + //for m = -l .. l + if (size != (lmax + 1) * (lmax + 1)) { + size = (lmax + 1) * (lmax + 1); + if (data) delete[] data; + data = new T[size]{}; + memset(data, 0.0, size * sizeof(T)); + } else { + memset(data, 0, size * sizeof(T)); + } + } + +#ifdef MULTIARRAY_INDICES_CHECK +/** + * Check if indices (l,m) are within array + */ + void check_indices(LS_TYPE l, MS_TYPE m) const { + + if ((l < 0) | (l > lmax)) { + fprintf(stderr, "%s: Index l = %d out of range (0, %d)\n", array_name.c_str(), l, lmax); + exit(EXIT_FAILURE); + } + + if ((m < -l) | (m > l)) { + fprintf(stderr, "%s: Index m = %d out of range (%d, %d)\n", array_name.c_str(), m, -l, l); + exit(EXIT_FAILURE); + } + size_t ii = l * (l + 1) + m; + if (ii >= size) { + fprintf(stderr, "%s: index = %ld out of range %ld\n", array_name.c_str(), ii, size); + exit(EXIT_FAILURE); + } + } +#endif + + /** + * Accessing the array value by index (l,m) for reading + * @param l + * @param m + * @return array value + */ + inline const T &operator()(LS_TYPE l, MS_TYPE m) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(l, m); +#endif + //l^2 + l + m + return data[l * (l + 1) + m]; + } + + /** + * Accessing the array value by index (l,m) for writing + * @param l + * @param m + * @return array value + */ + inline T &operator()(LS_TYPE l, MS_TYPE m) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(l, m); +#endif + //l^2 + l + m + return data[l * (l + 1) + m]; + } + + /** + * Convert array to STL vector> container + * @return vector> container + */ + vector> to_vector() const { + vector> res; + res.resize(lmax + 1); + + for (int i = 0; i < lmax + 1; i++) { + res[i].resize(i + 1); + for (int j = 0; j < i + 1; j++) { + res[i][j] = operator()(i, j); + } + } + return res; + } +}; + +/** + * Contiguous array to organize values by \f$ (i_0, l , m) \f$ indices. + * Only \f$ d_{0}, l_\textrm{max}\f$ should be provided: \f$ m = -l, \dots,l \f$ + * for \f$ l = 0, \dots, l_\textrm{max}\f$ + * @tparam T type of values to store + */ +template +class Array3DLM : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + + LS_TYPE lmax = 0; ///< orbital dimension \f$ l_{max} \f$ + + + size_t dim[1] = {0}; ///< linear dimension \f$ d_{0} \f$ + + size_t s[1] = {0}; ///< strides for linear dimensions + + Array1D *> _proxy_slices; ///< slices representation +public: + /** + * Default empty constructor + */ + Array3DLM() = default; + + /** + * Parametrized constructor + * @param array_name name of the array + */ + Array3DLM(string array_name) { + this->array_name = array_name; + }; + + /** + * Parametrized constructor + * @param d0 maximum value of \f$ i_0 \f$ + * @param lmax maximum value of \f$ l \f$ + * @param array_name name of the array + */ + explicit Array3DLM(size_t d0, LS_TYPE lmax, string array_name = "Array3DLM") { + init(d0, lmax, array_name); + } + + /** + * Initialize array and its slices + * @param d0 maximum value of \f$ i_0 \f$ + * @param lmax maximum value of \f$ l \f$ + * @param array_name name of the array + */ + void init(size_t d0, LS_TYPE lmax, string array_name = "Array3DLM") { + this->array_name = array_name; + this->lmax = lmax; + dim[0] = d0; + s[0] = lmax * lmax; + if (size != s[0] * dim[0]) { + size = s[0] * dim[0]; + if (data) delete[] data; + data = new T[size]{}; + memset(data, 0, size * sizeof(T)); + } else { + memset(data, 0, size * sizeof(T)); + } + + _proxy_slices.set_array_name(array_name + "_proxy"); + //arrange proxy-slices + _clear_proxies(); + _proxy_slices.resize(dim[0]); + for (size_t i0 = 0; i0 < dim[0]; ++i0) { + _proxy_slices(i0) = new Array2DLM(this->lmax, &this->data[i0 * s[0]], + array_name + "_slice"); + } + } + + /** + * Release pointers to slices + */ + void _clear_proxies() { + for (size_t i0 = 0; i0 < _proxy_slices.get_dim(0); ++i0) { + delete _proxy_slices(i0); + _proxy_slices(i0) = nullptr; + } + } + + /** + * Destructor, clear proxies + */ + ~Array3DLM() { + _clear_proxies(); + } + + /** + * Resize array to new dimensions + * @param d0 + * @param lmax + */ + void resize(size_t d0, LS_TYPE lmax) { + _clear_proxies(); + init(d0, lmax, this->array_name); + } + + /** + * Get array dimensions + * @param d dimension index + * @return dimension along axis 'd' + */ + size_t get_dim(int d) const { + return dim[d]; + } + +#ifdef MULTIARRAY_INDICES_CHECK + /** + * Check if indices (i0, l,m) are within array + */ + void check_indices(size_t i0, LS_TYPE l, MS_TYPE m) const { + if ((l < 0) | (l > lmax)) { + fprintf(stderr, "%s: Index l = %d out of range (0, %d)\n", array_name.c_str(), l, lmax); + exit(EXIT_FAILURE); + } + + if ((m < -l) | (m > l)) { + fprintf(stderr, "%s: Index m = %d out of range (%d, %d)\n", array_name.c_str(), m, -l, l); + exit(EXIT_FAILURE); + } + + if ((i0 < 0) | (i0 >= dim[0])) { + fprintf(stderr, "%s: index i0 = %ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); + exit(EXIT_FAILURE); + } + + size_t ii = i0 * s[0] + l * (l + 1) + m; + if (ii >= size) { + fprintf(stderr, "%s: index = %ld out of range %ld\n", array_name.c_str(), ii, size); + exit(EXIT_FAILURE); + } + } +#endif + + /** + * Accessing the array value by index (i0,l,m) for reading + * @param i0 + * @param l + * @param m + * @return array value + */ + inline const T &operator()(size_t i0, LS_TYPE l, MS_TYPE m) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, l, m); +#endif + return data[i0 * s[0] + l * (l + 1) + m]; + } + + /** + * Accessing the array value by index (i0,l,m) for writing + * @param i0 + * @param l + * @param m + * @return array value + */ + inline T &operator()(size_t i0, LS_TYPE l, MS_TYPE m) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, l, m); +#endif + return data[i0 * s[0] + l * (l + 1) + m]; + } + + /** + * Return proxy Array2DLM pointing to i0, l=0, m=0 to read + * @param i0 + * @return proxy Array2DLM pointing to i0, l=0, m=0 + */ + inline const Array2DLM &operator()(size_t i0) const { + return *_proxy_slices(i0); + } + + /** + * Return proxy Array2DLM pointing to i0, l=0, m=0 to write + * @param i0 + * @return proxy Array2DLM pointing to i0, l=0, m=0 + */ + inline Array2DLM &operator()(size_t i0) { + return *_proxy_slices(i0); + } +}; + + +/** + * Contiguous array to organize values by \f$ (i_0, i_1, l , m) \f$ indices. + * Only \f$ d_{0}, d_{1}, l_\textrm{max}\f$ should be provided: \f$ m = -l, \dots,l \f$ + * for \f$ l = 0, \dots, l_\textrm{max}\f$ + * @tparam T type of values to store + */ +template +class Array4DLM : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + + LS_TYPE lmax = 0; ///< orbital dimension \f$ l_{max} \f$ + size_t dim[2] = {0, 0}; ///< linear dimension \f$ d_{0}, d_{1} \f$ + size_t s[2] = {0, 0}; ///< strides for linear dimensions + + Array2D *> _proxy_slices; ///< slices representation +public: + /** + * Default empty constructor + */ + Array4DLM() = default; + + /** + * Parametrized constructor + * @param array_name name of the array + */ + Array4DLM(string array_name) { + this->array_name = array_name; + }; + + /** + * Parametrized constructor + * @param d0 maximum value of \f$ i_0 \f$ + * @param d1 maximum value of \f$ i_1 \f$ + * @param lmax maximum value of \f$ l \f$ + * @param array_name name of the array + */ + explicit Array4DLM(size_t d0, size_t d1, LS_TYPE lmax, string array_name = "Array4DLM") { + init(d0, d1, lmax, array_name); + } + + /** + * Initialize array, reallocate memory and its slices + * @param d0 maximum value of \f$ i_0 \f$ + * @param d1 maximum value of \f$ i_1 \f$ + * @param lmax maximum value of \f$ l \f$ + * @param array_name name of the array + */ + void init(size_t d0, size_t d1, LS_TYPE lmax, string array_name = "Array4DLM") { + this->array_name = array_name; + this->lmax = lmax; + dim[1] = d1; + dim[0] = d0; + s[1] = lmax * lmax; + s[0] = s[1] * dim[1]; + if (size != s[0] * dim[0]) { + size = s[0] * dim[0]; + if (data) delete[] data; + data = new T[size]{}; + memset(data, 0, size * sizeof(T)); + } else { + memset(data, 0, size * sizeof(T)); + } + + _proxy_slices.set_array_name(array_name + "_proxy"); + //release old memory if there is any + _clear_proxies(); + //arrange proxy-slices + _proxy_slices.resize(dim[0], dim[1]); + for (size_t i0 = 0; i0 < dim[0]; ++i0) + for (size_t i1 = 0; i1 < dim[1]; ++i1) { + _proxy_slices(i0, i1) = new Array2DLM(this->lmax, &this->data[i0 * s[0] + i1 * s[1]], + array_name + "_slice"); + } + } + + /** + * Release pointers to slices + */ + void _clear_proxies() { + + for (size_t i0 = 0; i0 < _proxy_slices.get_dim(0); ++i0) + for (size_t i1 = 0; i1 < _proxy_slices.get_dim(1); ++i1) { + delete _proxy_slices(i0, i1); + _proxy_slices(i0, i1) = nullptr; + } + } + + /** + * Destructor, clear proxies + */ + ~Array4DLM() { + _clear_proxies(); + } + + /** + * Deallocate memory, reallocate with the new dimensions + * @param d0 + * @param lmax + */ + void resize(size_t d0, size_t d1, LS_TYPE lmax) { + _clear_proxies(); + init(d0, d1, lmax, this->array_name); + } + + /** + * Get array dimensions + * @param d dimension index + * @return dimension along axis 'd' + */ + size_t get_dim(int d) const { + return dim[d]; + } + +#ifdef MULTIARRAY_INDICES_CHECK + /** + * Check if indices (i0, l,m) are within array + */ + void check_indices(size_t i0, size_t i1, LS_TYPE l, MS_TYPE m) const { + if ((l < 0) | (l > lmax)) { + fprintf(stderr, "%s: Index l = %d out of range (0, %d)\n", array_name.c_str(), l, lmax); + exit(EXIT_FAILURE); + } + + if ((m < -l) | (m > l)) { + fprintf(stderr, "%s: Index m = %d out of range (%d, %d)\n", array_name.c_str(), m, -l, l); + exit(EXIT_FAILURE); + } + + if ((i0 < 0) | (i0 >= dim[0])) { + fprintf(stderr, "%s: index i0 = %ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); + exit(EXIT_FAILURE); + } + + + if ((i1 < 0) | (i1 >= dim[1])) { + fprintf(stderr, "%s: index i1 = %ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); + exit(EXIT_FAILURE); + } + + size_t ii = i0 * s[0] + i1 * s[1] + l * (l + 1) + m; + if (ii >= size) { + fprintf(stderr, "%s: index = %ld out of range %ld\n", array_name.c_str(), ii, size); + exit(EXIT_FAILURE); + } + } +#endif + + /** + * Accessing the array value by index (i0,l,m) for reading + * @param i0 + * @param i1 + * @param l + * @param m + * @return array value + */ + inline const T &operator()(size_t i0, size_t i1, LS_TYPE l, MS_TYPE m) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, l, m); +#endif + return data[i0 * s[0] + i1 * s[1] + l * (l + 1) + m]; + } + + /** + * Accessing the array value by index (i0,l,m) for writing + * @param i0 + * @param i1 + * @param l + * @param m + * @return array value + */ + inline T &operator()(size_t i0, size_t i1, LS_TYPE l, MS_TYPE m) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, l, m); +#endif + return data[i0 * s[0] + i1 * s[1] + l * (l + 1) + m]; + } + + /** + * Return proxy Array2DLM pointing to i0, i1, l=0, m=0 to read + * @param i0 + * @param i1 + * @return proxy Array2DLM pointing to i0, l=0, m=0 + */ + inline const Array2DLM &operator()(size_t i0, size_t i1) const { + return *_proxy_slices(i0, i1); + } + + /** + * Return proxy Array2DLM pointing to i0, i1, l=0, m=0 to write + * @param i0 + * @param i1 + * @return proxy Array2DLM pointing to i0, l=0, m=0 + */ + inline Array2DLM &operator()(size_t i0, size_t i1) { + return *_proxy_slices(i0, i1); + } +}; + +#endif //ACE_ARRAY2DLM_H \ No newline at end of file diff --git a/lib/pace/ace_arraynd.h b/lib/pace/ace_arraynd.h new file mode 100644 index 0000000000..1044b5654e --- /dev/null +++ b/lib/pace/ace_arraynd.h @@ -0,0 +1,1949 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +//automatically generate source code + +#ifndef ACE_MULTIARRAY_H +#define ACE_MULTIARRAY_H + +#include +#include +#include + +#include "ace_contigous_array.h" + +using namespace std; + + +/** + * Multidimensional (1 - dimensional) array of type T with contiguous memory layout. + * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @tparam T data type + */ +template +class Array1D : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + using ContiguousArrayND::is_proxy_; + + size_t dim[1] = {0}; ///< dimensions + size_t s[1] = {0}; ///< strides + int ndim = 1; ///< number of dimensions +public: + + /** + * Default empty constructor + */ + Array1D() = default; + + /** + * Parametrized constructor with array name + * @param array_name name of array (for error logging) + */ + Array1D(const string &array_name) { this->array_name = array_name; } + + /** + * Parametrized constructor + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + Array1D(size_t d0, const string &array_name = "Array1D", T *new_data = nullptr) { + init(d0, array_name, new_data); + } + + /** + * Setup the dimensions and strides of array + * @param d0,... array sizes for different dimensions + */ + void set_dimensions(size_t d0) { + + dim[0] = d0; + + s[0] = 1; + + size = s[0] * dim[0]; + }; + + /** + * Initialize array storage, dimensions and strides + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + void init(size_t d0, const string &array_name = "Array1D", T *new_data = nullptr) { + this->array_name = array_name; + + size_t old_size = size; + set_dimensions(d0); + + bool new_is_proxy = (new_data != nullptr); + + if (new_is_proxy) { + if (!is_proxy_) delete[] data; + data = new_data; + } else { + if (size != old_size) { + T *old_data = data; //preserve the pointer to the old data + data = new T[size]; // allocate new data + if (old_data != nullptr) { // + size_t min_size = old_size < size ? old_size : size; + memcpy(data, old_data, min_size * sizeof(T)); + if (!is_proxy_) delete[] old_data; + } + //memset(data, 0, size * sizeof(T)); + } else { + //memset(data, 0, size * sizeof(T)); + } + } + + is_proxy_ = new_is_proxy; + } + + /** + * Resize array + * @param d0,... array sizes for different dimensions + */ + void resize(size_t d0) { + init(d0, this->array_name); + } + + /** + * Reshape array without reset the data + * @param d0,... array sizes for different dimensions + */ + void reshape(size_t d0) { + //check data size consistency + size_t new_size = d0; + if (new_size != size) + throw invalid_argument("Couldn't reshape array when the size is not conserved"); + set_dimensions(d0); + } + + /** + * Get array size in dimension "d" + * @param d dimension index + */ + size_t get_dim(int d) const { + return dim[d]; + } + +#ifdef MULTIARRAY_INDICES_CHECK + + /** + * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + void check_indices(size_t i0) const { + + if ((i0 < 0) | (i0 >= dim[0])) { + char buf[1024]; + sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); + throw std::out_of_range(buf); + } + + } + +#endif + + /** + * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline const T &operator()(size_t i0) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0); +#endif + + return data[i0]; + + } + + /** + * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline T &operator()(size_t i0) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0); +#endif + + return data[i0]; + + } + + /** + * Array comparison operator + * @param other + */ + bool operator==(const Array1D &other) const { + //compare dimensions + for (int d = 0; d < ndim; d++) { + if (this->dim[d] != other.dim[d]) + return false; + } + return ContiguousArrayND::operator==(other); + } + + /** + * Convert to nested vector> container + * @return vector container + */ + vector to_vector() const { + vector res; + + res.resize(dim[0]); + + for (int i0 = 0; i0 < dim[0]; i0++) { + res[i0] = operator()(i0); + + } + + + return res; + } // end to_vector() + + + /** + * Set values to vector> container + * @param vec container + */ + void set_vector(const vector &vec) { + size_t d0 = 0; + d0 = vec.size(); + + + init(d0, array_name); + for (int i0 = 0; i0 < dim[0]; i0++) { + operator()(i0) = vec.at(i0); + + } + + } + + /** + * Parametrized constructor from vector> container + * @param vec container + * @param array_name array name + */ + Array1D(const vector &vec, const string &array_name = "Array1D") { + this->set_vector(vec); + this->array_name = array_name; + } + + /** + * operator= to vector> container + * @param vec container + */ + Array1D &operator=(const vector &vec) { + this->set_vector(vec); + return *this; + } + + + vector get_shape() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = dim[d]; + return sh; + } + + vector get_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d]; + return sh; + } + + vector get_memory_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d] * sizeof(T); + return sh; + } +}; + + +/** + * Multidimensional (2 - dimensional) array of type T with contiguous memory layout. + * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @tparam T data type + */ +template +class Array2D : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + using ContiguousArrayND::is_proxy_; + + size_t dim[2] = {0}; ///< dimensions + size_t s[2] = {0}; ///< strides + int ndim = 2; ///< number of dimensions +public: + + /** + * Default empty constructor + */ + Array2D() = default; + + /** + * Parametrized constructor with array name + * @param array_name name of array (for error logging) + */ + Array2D(const string &array_name) { this->array_name = array_name; } + + /** + * Parametrized constructor + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + Array2D(size_t d0, size_t d1, const string &array_name = "Array2D", T *new_data = nullptr) { + init(d0, d1, array_name, new_data); + } + + /** + * Setup the dimensions and strides of array + * @param d0,... array sizes for different dimensions + */ + void set_dimensions(size_t d0, size_t d1) { + + dim[0] = d0; + dim[1] = d1; + + s[1] = 1; + s[0] = s[1] * dim[1]; + + size = s[0] * dim[0]; + }; + + /** + * Initialize array storage, dimensions and strides + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + void init(size_t d0, size_t d1, const string &array_name = "Array2D", T *new_data = nullptr) { + this->array_name = array_name; + + size_t old_size = size; + set_dimensions(d0, d1); + + bool new_is_proxy = (new_data != nullptr); + + if (new_is_proxy) { + if (!is_proxy_) delete[] data; + data = new_data; + } else { + if (size != old_size) { + T *old_data = data; //preserve the pointer to the old data + data = new T[size]; // allocate new data + if (old_data != nullptr) { // + size_t min_size = old_size < size ? old_size : size; + memcpy(data, old_data, min_size * sizeof(T)); + if (!is_proxy_) delete[] old_data; + } + //memset(data, 0, size * sizeof(T)); + } else { + //memset(data, 0, size * sizeof(T)); + } + } + + is_proxy_ = new_is_proxy; + } + + /** + * Resize array + * @param d0,... array sizes for different dimensions + */ + void resize(size_t d0, size_t d1) { + init(d0, d1, this->array_name); + } + + /** + * Reshape array without reset the data + * @param d0,... array sizes for different dimensions + */ + void reshape(size_t d0, size_t d1) { + //check data size consistency + size_t new_size = d0 * d1; + if (new_size != size) + throw invalid_argument("Couldn't reshape array when the size is not conserved"); + set_dimensions(d0, d1); + } + + /** + * Get array size in dimension "d" + * @param d dimension index + */ + size_t get_dim(int d) const { + return dim[d]; + } + +#ifdef MULTIARRAY_INDICES_CHECK + + /** + * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + void check_indices(size_t i0, size_t i1) const { + + if ((i0 < 0) | (i0 >= dim[0])) { + char buf[1024]; + sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); + throw std::out_of_range(buf); + } + + if ((i1 < 0) | (i1 >= dim[1])) { + char buf[1024]; + sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); + throw std::out_of_range(buf); + } + + } + +#endif + + /** + * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline const T &operator()(size_t i0, size_t i1) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1); +#endif + + return data[i0 * s[0] + i1]; + + } + + /** + * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline T &operator()(size_t i0, size_t i1) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1); +#endif + + return data[i0 * s[0] + i1]; + + } + + /** + * Array comparison operator + * @param other + */ + bool operator==(const Array2D &other) const { + //compare dimensions + for (int d = 0; d < ndim; d++) { + if (this->dim[d] != other.dim[d]) + return false; + } + return ContiguousArrayND::operator==(other); + } + + /** + * Convert to nested vector> container + * @return vector container + */ + vector> to_vector() const { + vector> res; + + res.resize(dim[0]); + + for (int i0 = 0; i0 < dim[0]; i0++) { + res[i0].resize(dim[1]); + + + for (int i1 = 0; i1 < dim[1]; i1++) { + res[i0][i1] = operator()(i0, i1); + + } + } + + + return res; + } // end to_vector() + + + /** + * Set values to vector> container + * @param vec container + */ + void set_vector(const vector> &vec) { + size_t d0 = 0; + size_t d1 = 0; + d0 = vec.size(); + + if (d0 > 0) { + d1 = vec.at(0).size(); + + + } + + init(d0, d1, array_name); + for (int i0 = 0; i0 < dim[0]; i0++) { + if (vec.at(i0).size() != d1) + throw std::invalid_argument("Vector size is not constant at dimension 1"); + + for (int i1 = 0; i1 < dim[1]; i1++) { + operator()(i0, i1) = vec.at(i0).at(i1); + + } + } + + } + + /** + * Parametrized constructor from vector> container + * @param vec container + * @param array_name array name + */ + Array2D(const vector> &vec, const string &array_name = "Array2D") { + this->set_vector(vec); + this->array_name = array_name; + } + + /** + * operator= to vector> container + * @param vec container + */ + Array2D &operator=(const vector> &vec) { + this->set_vector(vec); + return *this; + } + + + /** + * operator= to flatten vector container + * @param vec container + */ + Array2D &operator=(const vector &vec) { + this->set_flatten_vector(vec); + return *this; + } + + + vector get_shape() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = dim[d]; + return sh; + } + + vector get_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d]; + return sh; + } + + vector get_memory_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d] * sizeof(T); + return sh; + } +}; + + +/** + * Multidimensional (3 - dimensional) array of type T with contiguous memory layout. + * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @tparam T data type + */ +template +class Array3D : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + using ContiguousArrayND::is_proxy_; + + size_t dim[3] = {0}; ///< dimensions + size_t s[3] = {0}; ///< strides + int ndim = 3; ///< number of dimensions +public: + + /** + * Default empty constructor + */ + Array3D() = default; + + /** + * Parametrized constructor with array name + * @param array_name name of array (for error logging) + */ + Array3D(const string &array_name) { this->array_name = array_name; } + + /** + * Parametrized constructor + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + Array3D(size_t d0, size_t d1, size_t d2, const string &array_name = "Array3D", T *new_data = nullptr) { + init(d0, d1, d2, array_name, new_data); + } + + /** + * Setup the dimensions and strides of array + * @param d0,... array sizes for different dimensions + */ + void set_dimensions(size_t d0, size_t d1, size_t d2) { + + dim[0] = d0; + dim[1] = d1; + dim[2] = d2; + + s[2] = 1; + s[1] = s[2] * dim[2]; + s[0] = s[1] * dim[1]; + + size = s[0] * dim[0]; + }; + + /** + * Initialize array storage, dimensions and strides + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + void init(size_t d0, size_t d1, size_t d2, const string &array_name = "Array3D", T *new_data = nullptr) { + this->array_name = array_name; + + size_t old_size = size; + set_dimensions(d0, d1, d2); + + bool new_is_proxy = (new_data != nullptr); + + if (new_is_proxy) { + if (!is_proxy_) delete[] data; + data = new_data; + } else { + if (size != old_size) { + T *old_data = data; //preserve the pointer to the old data + data = new T[size]; // allocate new data + if (old_data != nullptr) { // + size_t min_size = old_size < size ? old_size : size; + memcpy(data, old_data, min_size * sizeof(T)); + if (!is_proxy_) delete[] old_data; + } + //memset(data, 0, size * sizeof(T)); + } else { + //memset(data, 0, size * sizeof(T)); + } + } + + is_proxy_ = new_is_proxy; + } + + /** + * Resize array + * @param d0,... array sizes for different dimensions + */ + void resize(size_t d0, size_t d1, size_t d2) { + init(d0, d1, d2, this->array_name); + } + + /** + * Reshape array without reset the data + * @param d0,... array sizes for different dimensions + */ + void reshape(size_t d0, size_t d1, size_t d2) { + //check data size consistency + size_t new_size = d0 * d1 * d2; + if (new_size != size) + throw invalid_argument("Couldn't reshape array when the size is not conserved"); + set_dimensions(d0, d1, d2); + } + + /** + * Get array size in dimension "d" + * @param d dimension index + */ + size_t get_dim(int d) const { + return dim[d]; + } + +#ifdef MULTIARRAY_INDICES_CHECK + + /** + * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + void check_indices(size_t i0, size_t i1, size_t i2) const { + + if ((i0 < 0) | (i0 >= dim[0])) { + char buf[1024]; + sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); + throw std::out_of_range(buf); + } + + if ((i1 < 0) | (i1 >= dim[1])) { + char buf[1024]; + sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); + throw std::out_of_range(buf); + } + + if ((i2 < 0) | (i2 >= dim[2])) { + char buf[1024]; + sprintf(buf, "%s: index i2=%ld out of range (0, %ld)\n", array_name.c_str(), i2, dim[2] - 1); + throw std::out_of_range(buf); + } + + } + +#endif + + /** + * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline const T &operator()(size_t i0, size_t i1, size_t i2) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, i2); +#endif + + return data[i0 * s[0] + i1 * s[1] + i2]; + + } + + /** + * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline T &operator()(size_t i0, size_t i1, size_t i2) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, i2); +#endif + + return data[i0 * s[0] + i1 * s[1] + i2]; + + } + + /** + * Array comparison operator + * @param other + */ + bool operator==(const Array3D &other) const { + //compare dimensions + for (int d = 0; d < ndim; d++) { + if (this->dim[d] != other.dim[d]) + return false; + } + return ContiguousArrayND::operator==(other); + } + + /** + * Convert to nested vector> container + * @return vector container + */ + vector>> to_vector() const { + vector>> res; + + res.resize(dim[0]); + + for (int i0 = 0; i0 < dim[0]; i0++) { + res[i0].resize(dim[1]); + + + for (int i1 = 0; i1 < dim[1]; i1++) { + res[i0][i1].resize(dim[2]); + + + for (int i2 = 0; i2 < dim[2]; i2++) { + res[i0][i1][i2] = operator()(i0, i1, i2); + + } + } + } + + + return res; + } // end to_vector() + + + /** + * Set values to vector> container + * @param vec container + */ + void set_vector(const vector>> &vec) { + size_t d0 = 0; + size_t d1 = 0; + size_t d2 = 0; + d0 = vec.size(); + + if (d0 > 0) { + d1 = vec.at(0).size(); + if (d1 > 0) { + d2 = vec.at(0).at(0).size(); + + + } + } + + init(d0, d1, d2, array_name); + for (int i0 = 0; i0 < dim[0]; i0++) { + if (vec.at(i0).size() != d1) + throw std::invalid_argument("Vector size is not constant at dimension 1"); + + for (int i1 = 0; i1 < dim[1]; i1++) { + if (vec.at(i0).at(i1).size() != d2) + throw std::invalid_argument("Vector size is not constant at dimension 2"); + + for (int i2 = 0; i2 < dim[2]; i2++) { + operator()(i0, i1, i2) = vec.at(i0).at(i1).at(i2); + + } + } + } + + } + + /** + * Parametrized constructor from vector> container + * @param vec container + * @param array_name array name + */ + Array3D(const vector>> &vec, const string &array_name = "Array3D") { + this->set_vector(vec); + this->array_name = array_name; + } + + /** + * operator= to vector> container + * @param vec container + */ + Array3D &operator=(const vector>> &vec) { + this->set_vector(vec); + return *this; + } + + + /** + * operator= to flatten vector container + * @param vec container + */ + Array3D &operator=(const vector &vec) { + this->set_flatten_vector(vec); + return *this; + } + + + vector get_shape() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = dim[d]; + return sh; + } + + vector get_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d]; + return sh; + } + + vector get_memory_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d] * sizeof(T); + return sh; + } +}; + + +/** + * Multidimensional (4 - dimensional) array of type T with contiguous memory layout. + * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @tparam T data type + */ +template +class Array4D : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + using ContiguousArrayND::is_proxy_; + + size_t dim[4] = {0}; ///< dimensions + size_t s[4] = {0}; ///< strides + int ndim = 4; ///< number of dimensions +public: + + /** + * Default empty constructor + */ + Array4D() = default; + + /** + * Parametrized constructor with array name + * @param array_name name of array (for error logging) + */ + Array4D(const string &array_name) { this->array_name = array_name; } + + /** + * Parametrized constructor + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + Array4D(size_t d0, size_t d1, size_t d2, size_t d3, const string &array_name = "Array4D", T *new_data = nullptr) { + init(d0, d1, d2, d3, array_name, new_data); + } + + /** + * Setup the dimensions and strides of array + * @param d0,... array sizes for different dimensions + */ + void set_dimensions(size_t d0, size_t d1, size_t d2, size_t d3) { + + dim[0] = d0; + dim[1] = d1; + dim[2] = d2; + dim[3] = d3; + + s[3] = 1; + s[2] = s[3] * dim[3]; + s[1] = s[2] * dim[2]; + s[0] = s[1] * dim[1]; + + size = s[0] * dim[0]; + }; + + /** + * Initialize array storage, dimensions and strides + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + void init(size_t d0, size_t d1, size_t d2, size_t d3, const string &array_name = "Array4D", T *new_data = nullptr) { + this->array_name = array_name; + + size_t old_size = size; + set_dimensions(d0, d1, d2, d3); + + bool new_is_proxy = (new_data != nullptr); + + if (new_is_proxy) { + if (!is_proxy_) delete[] data; + data = new_data; + } else { + if (size != old_size) { + T *old_data = data; //preserve the pointer to the old data + data = new T[size]; // allocate new data + if (old_data != nullptr) { // + size_t min_size = old_size < size ? old_size : size; + memcpy(data, old_data, min_size * sizeof(T)); + if (!is_proxy_) delete[] old_data; + } + //memset(data, 0, size * sizeof(T)); + } else { + //memset(data, 0, size * sizeof(T)); + } + } + + is_proxy_ = new_is_proxy; + } + + /** + * Resize array + * @param d0,... array sizes for different dimensions + */ + void resize(size_t d0, size_t d1, size_t d2, size_t d3) { + init(d0, d1, d2, d3, this->array_name); + } + + /** + * Reshape array without reset the data + * @param d0,... array sizes for different dimensions + */ + void reshape(size_t d0, size_t d1, size_t d2, size_t d3) { + //check data size consistency + size_t new_size = d0 * d1 * d2 * d3; + if (new_size != size) + throw invalid_argument("Couldn't reshape array when the size is not conserved"); + set_dimensions(d0, d1, d2, d3); + } + + /** + * Get array size in dimension "d" + * @param d dimension index + */ + size_t get_dim(int d) const { + return dim[d]; + } + +#ifdef MULTIARRAY_INDICES_CHECK + + /** + * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + void check_indices(size_t i0, size_t i1, size_t i2, size_t i3) const { + + if ((i0 < 0) | (i0 >= dim[0])) { + char buf[1024]; + sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); + throw std::out_of_range(buf); + } + + if ((i1 < 0) | (i1 >= dim[1])) { + char buf[1024]; + sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); + throw std::out_of_range(buf); + } + + if ((i2 < 0) | (i2 >= dim[2])) { + char buf[1024]; + sprintf(buf, "%s: index i2=%ld out of range (0, %ld)\n", array_name.c_str(), i2, dim[2] - 1); + throw std::out_of_range(buf); + } + + if ((i3 < 0) | (i3 >= dim[3])) { + char buf[1024]; + sprintf(buf, "%s: index i3=%ld out of range (0, %ld)\n", array_name.c_str(), i3, dim[3] - 1); + throw std::out_of_range(buf); + } + + } + +#endif + + /** + * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline const T &operator()(size_t i0, size_t i1, size_t i2, size_t i3) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, i2, i3); +#endif + + return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3]; + + } + + /** + * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline T &operator()(size_t i0, size_t i1, size_t i2, size_t i3) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, i2, i3); +#endif + + return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3]; + + } + + /** + * Array comparison operator + * @param other + */ + bool operator==(const Array4D &other) const { + //compare dimensions + for (int d = 0; d < ndim; d++) { + if (this->dim[d] != other.dim[d]) + return false; + } + return ContiguousArrayND::operator==(other); + } + + /** + * Convert to nested vector> container + * @return vector container + */ + vector>>> to_vector() const { + vector>>> res; + + res.resize(dim[0]); + + for (int i0 = 0; i0 < dim[0]; i0++) { + res[i0].resize(dim[1]); + + + for (int i1 = 0; i1 < dim[1]; i1++) { + res[i0][i1].resize(dim[2]); + + + for (int i2 = 0; i2 < dim[2]; i2++) { + res[i0][i1][i2].resize(dim[3]); + + + for (int i3 = 0; i3 < dim[3]; i3++) { + res[i0][i1][i2][i3] = operator()(i0, i1, i2, i3); + + } + } + } + } + + + return res; + } // end to_vector() + + + /** + * Set values to vector> container + * @param vec container + */ + void set_vector(const vector>>> &vec) { + size_t d0 = 0; + size_t d1 = 0; + size_t d2 = 0; + size_t d3 = 0; + d0 = vec.size(); + + if (d0 > 0) { + d1 = vec.at(0).size(); + if (d1 > 0) { + d2 = vec.at(0).at(0).size(); + if (d2 > 0) { + d3 = vec.at(0).at(0).at(0).size(); + + + } + } + } + + init(d0, d1, d2, d3, array_name); + for (int i0 = 0; i0 < dim[0]; i0++) { + if (vec.at(i0).size() != d1) + throw std::invalid_argument("Vector size is not constant at dimension 1"); + + for (int i1 = 0; i1 < dim[1]; i1++) { + if (vec.at(i0).at(i1).size() != d2) + throw std::invalid_argument("Vector size is not constant at dimension 2"); + + for (int i2 = 0; i2 < dim[2]; i2++) { + if (vec.at(i0).at(i1).at(i2).size() != d3) + throw std::invalid_argument("Vector size is not constant at dimension 3"); + + for (int i3 = 0; i3 < dim[3]; i3++) { + operator()(i0, i1, i2, i3) = vec.at(i0).at(i1).at(i2).at(i3); + + } + } + } + } + + } + + /** + * Parametrized constructor from vector> container + * @param vec container + * @param array_name array name + */ + Array4D(const vector>>> &vec, const string &array_name = "Array4D") { + this->set_vector(vec); + this->array_name = array_name; + } + + /** + * operator= to vector> container + * @param vec container + */ + Array4D &operator=(const vector>>> &vec) { + this->set_vector(vec); + return *this; + } + + + /** + * operator= to flatten vector container + * @param vec container + */ + Array4D &operator=(const vector &vec) { + this->set_flatten_vector(vec); + return *this; + } + + + vector get_shape() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = dim[d]; + return sh; + } + + vector get_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d]; + return sh; + } + + vector get_memory_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d] * sizeof(T); + return sh; + } +}; + + +/** + * Multidimensional (5 - dimensional) array of type T with contiguous memory layout. + * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @tparam T data type + */ +template +class Array5D : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + using ContiguousArrayND::is_proxy_; + + size_t dim[5] = {0}; ///< dimensions + size_t s[5] = {0}; ///< strides + int ndim = 5; ///< number of dimensions +public: + + /** + * Default empty constructor + */ + Array5D() = default; + + /** + * Parametrized constructor with array name + * @param array_name name of array (for error logging) + */ + Array5D(const string &array_name) { this->array_name = array_name; } + + /** + * Parametrized constructor + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + Array5D(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, const string &array_name = "Array5D", + T *new_data = nullptr) { + init(d0, d1, d2, d3, d4, array_name, new_data); + } + + /** + * Setup the dimensions and strides of array + * @param d0,... array sizes for different dimensions + */ + void set_dimensions(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4) { + + dim[0] = d0; + dim[1] = d1; + dim[2] = d2; + dim[3] = d3; + dim[4] = d4; + + s[4] = 1; + s[3] = s[4] * dim[4]; + s[2] = s[3] * dim[3]; + s[1] = s[2] * dim[2]; + s[0] = s[1] * dim[1]; + + size = s[0] * dim[0]; + }; + + /** + * Initialize array storage, dimensions and strides + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + void init(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, const string &array_name = "Array5D", + T *new_data = nullptr) { + this->array_name = array_name; + + size_t old_size = size; + set_dimensions(d0, d1, d2, d3, d4); + + bool new_is_proxy = (new_data != nullptr); + + if (new_is_proxy) { + if (!is_proxy_) delete[] data; + data = new_data; + } else { + if (size != old_size) { + T *old_data = data; //preserve the pointer to the old data + data = new T[size]; // allocate new data + if (old_data != nullptr) { // + size_t min_size = old_size < size ? old_size : size; + memcpy(data, old_data, min_size * sizeof(T)); + if (!is_proxy_) delete[] old_data; + } + //memset(data, 0, size * sizeof(T)); + } else { + //memset(data, 0, size * sizeof(T)); + } + } + + is_proxy_ = new_is_proxy; + } + + /** + * Resize array + * @param d0,... array sizes for different dimensions + */ + void resize(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4) { + init(d0, d1, d2, d3, d4, this->array_name); + } + + /** + * Reshape array without reset the data + * @param d0,... array sizes for different dimensions + */ + void reshape(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4) { + //check data size consistency + size_t new_size = d0 * d1 * d2 * d3 * d4; + if (new_size != size) + throw invalid_argument("Couldn't reshape array when the size is not conserved"); + set_dimensions(d0, d1, d2, d3, d4); + } + + /** + * Get array size in dimension "d" + * @param d dimension index + */ + size_t get_dim(int d) const { + return dim[d]; + } + +#ifdef MULTIARRAY_INDICES_CHECK + + /** + * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + void check_indices(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4) const { + + if ((i0 < 0) | (i0 >= dim[0])) { + char buf[1024]; + sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); + throw std::out_of_range(buf); + } + + if ((i1 < 0) | (i1 >= dim[1])) { + char buf[1024]; + sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); + throw std::out_of_range(buf); + } + + if ((i2 < 0) | (i2 >= dim[2])) { + char buf[1024]; + sprintf(buf, "%s: index i2=%ld out of range (0, %ld)\n", array_name.c_str(), i2, dim[2] - 1); + throw std::out_of_range(buf); + } + + if ((i3 < 0) | (i3 >= dim[3])) { + char buf[1024]; + sprintf(buf, "%s: index i3=%ld out of range (0, %ld)\n", array_name.c_str(), i3, dim[3] - 1); + throw std::out_of_range(buf); + } + + if ((i4 < 0) | (i4 >= dim[4])) { + char buf[1024]; + sprintf(buf, "%s: index i4=%ld out of range (0, %ld)\n", array_name.c_str(), i4, dim[4] - 1); + throw std::out_of_range(buf); + } + + } + +#endif + + /** + * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline const T &operator()(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, i2, i3, i4); +#endif + + return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3 * s[3] + i4]; + + } + + /** + * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline T &operator()(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, i2, i3, i4); +#endif + + return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3 * s[3] + i4]; + + } + + /** + * Array comparison operator + * @param other + */ + bool operator==(const Array5D &other) const { + //compare dimensions + for (int d = 0; d < ndim; d++) { + if (this->dim[d] != other.dim[d]) + return false; + } + return ContiguousArrayND::operator==(other); + } + + /** + * Convert to nested vector> container + * @return vector container + */ + vector>>>> to_vector() const { + vector>>>> res; + + res.resize(dim[0]); + + for (int i0 = 0; i0 < dim[0]; i0++) { + res[i0].resize(dim[1]); + + + for (int i1 = 0; i1 < dim[1]; i1++) { + res[i0][i1].resize(dim[2]); + + + for (int i2 = 0; i2 < dim[2]; i2++) { + res[i0][i1][i2].resize(dim[3]); + + + for (int i3 = 0; i3 < dim[3]; i3++) { + res[i0][i1][i2][i3].resize(dim[4]); + + + for (int i4 = 0; i4 < dim[4]; i4++) { + res[i0][i1][i2][i3][i4] = operator()(i0, i1, i2, i3, i4); + + } + } + } + } + } + + + return res; + } // end to_vector() + + + /** + * Set values to vector> container + * @param vec container + */ + void set_vector(const vector>>>> &vec) { + size_t d0 = 0; + size_t d1 = 0; + size_t d2 = 0; + size_t d3 = 0; + size_t d4 = 0; + d0 = vec.size(); + + if (d0 > 0) { + d1 = vec.at(0).size(); + if (d1 > 0) { + d2 = vec.at(0).at(0).size(); + if (d2 > 0) { + d3 = vec.at(0).at(0).at(0).size(); + if (d3 > 0) { + d4 = vec.at(0).at(0).at(0).at(0).size(); + + + } + } + } + } + + init(d0, d1, d2, d3, d4, array_name); + for (int i0 = 0; i0 < dim[0]; i0++) { + if (vec.at(i0).size() != d1) + throw std::invalid_argument("Vector size is not constant at dimension 1"); + + for (int i1 = 0; i1 < dim[1]; i1++) { + if (vec.at(i0).at(i1).size() != d2) + throw std::invalid_argument("Vector size is not constant at dimension 2"); + + for (int i2 = 0; i2 < dim[2]; i2++) { + if (vec.at(i0).at(i1).at(i2).size() != d3) + throw std::invalid_argument("Vector size is not constant at dimension 3"); + + for (int i3 = 0; i3 < dim[3]; i3++) { + if (vec.at(i0).at(i1).at(i2).at(i3).size() != d4) + throw std::invalid_argument("Vector size is not constant at dimension 4"); + + for (int i4 = 0; i4 < dim[4]; i4++) { + operator()(i0, i1, i2, i3, i4) = vec.at(i0).at(i1).at(i2).at(i3).at(i4); + + } + } + } + } + } + + } + + /** + * Parametrized constructor from vector> container + * @param vec container + * @param array_name array name + */ + Array5D(const vector>>>> &vec, const string &array_name = "Array5D") { + this->set_vector(vec); + this->array_name = array_name; + } + + /** + * operator= to vector> container + * @param vec container + */ + Array5D &operator=(const vector>>>> &vec) { + this->set_vector(vec); + return *this; + } + + + /** + * operator= to flatten vector container + * @param vec container + */ + Array5D &operator=(const vector &vec) { + this->set_flatten_vector(vec); + return *this; + } + + + vector get_shape() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = dim[d]; + return sh; + } + + vector get_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d]; + return sh; + } + + vector get_memory_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d] * sizeof(T); + return sh; + } +}; + + +/** + * Multidimensional (6 - dimensional) array of type T with contiguous memory layout. + * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @tparam T data type + */ +template +class Array6D : public ContiguousArrayND { + using ContiguousArrayND::array_name; + using ContiguousArrayND::data; + using ContiguousArrayND::size; + using ContiguousArrayND::is_proxy_; + + size_t dim[6] = {0}; ///< dimensions + size_t s[6] = {0}; ///< strides + int ndim = 6; ///< number of dimensions +public: + + /** + * Default empty constructor + */ + Array6D() = default; + + /** + * Parametrized constructor with array name + * @param array_name name of array (for error logging) + */ + Array6D(const string &array_name) { this->array_name = array_name; } + + /** + * Parametrized constructor + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + Array6D(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5, const string &array_name = "Array6D", + T *new_data = nullptr) { + init(d0, d1, d2, d3, d4, d5, array_name, new_data); + } + + /** + * Setup the dimensions and strides of array + * @param d0,... array sizes for different dimensions + */ + void set_dimensions(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5) { + + dim[0] = d0; + dim[1] = d1; + dim[2] = d2; + dim[3] = d3; + dim[4] = d4; + dim[5] = d5; + + s[5] = 1; + s[4] = s[5] * dim[5]; + s[3] = s[4] * dim[4]; + s[2] = s[3] * dim[3]; + s[1] = s[2] * dim[2]; + s[0] = s[1] * dim[1]; + + size = s[0] * dim[0]; + }; + + /** + * Initialize array storage, dimensions and strides + * @param d0,... array sizes for different dimensions + * @param array_name string name of the array + */ + void init(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5, const string &array_name = "Array6D", + T *new_data = nullptr) { + this->array_name = array_name; + + size_t old_size = size; + set_dimensions(d0, d1, d2, d3, d4, d5); + + bool new_is_proxy = (new_data != nullptr); + + if (new_is_proxy) { + if (!is_proxy_) delete[] data; + data = new_data; + } else { + if (size != old_size) { + T *old_data = data; //preserve the pointer to the old data + data = new T[size]; // allocate new data + if (old_data != nullptr) { // + size_t min_size = old_size < size ? old_size : size; + memcpy(data, old_data, min_size * sizeof(T)); + if (!is_proxy_) delete[] old_data; + } + //memset(data, 0, size * sizeof(T)); + } else { + //memset(data, 0, size * sizeof(T)); + } + } + + is_proxy_ = new_is_proxy; + } + + /** + * Resize array + * @param d0,... array sizes for different dimensions + */ + void resize(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5) { + init(d0, d1, d2, d3, d4, d5, this->array_name); + } + + /** + * Reshape array without reset the data + * @param d0,... array sizes for different dimensions + */ + void reshape(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5) { + //check data size consistency + size_t new_size = d0 * d1 * d2 * d3 * d4 * d5; + if (new_size != size) + throw invalid_argument("Couldn't reshape array when the size is not conserved"); + set_dimensions(d0, d1, d2, d3, d4, d5); + } + + /** + * Get array size in dimension "d" + * @param d dimension index + */ + size_t get_dim(int d) const { + return dim[d]; + } + +#ifdef MULTIARRAY_INDICES_CHECK + + /** + * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + void check_indices(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) const { + + if ((i0 < 0) | (i0 >= dim[0])) { + char buf[1024]; + sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); + throw std::out_of_range(buf); + } + + if ((i1 < 0) | (i1 >= dim[1])) { + char buf[1024]; + sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); + throw std::out_of_range(buf); + } + + if ((i2 < 0) | (i2 >= dim[2])) { + char buf[1024]; + sprintf(buf, "%s: index i2=%ld out of range (0, %ld)\n", array_name.c_str(), i2, dim[2] - 1); + throw std::out_of_range(buf); + } + + if ((i3 < 0) | (i3 >= dim[3])) { + char buf[1024]; + sprintf(buf, "%s: index i3=%ld out of range (0, %ld)\n", array_name.c_str(), i3, dim[3] - 1); + throw std::out_of_range(buf); + } + + if ((i4 < 0) | (i4 >= dim[4])) { + char buf[1024]; + sprintf(buf, "%s: index i4=%ld out of range (0, %ld)\n", array_name.c_str(), i4, dim[4] - 1); + throw std::out_of_range(buf); + } + + if ((i5 < 0) | (i5 >= dim[5])) { + char buf[1024]; + sprintf(buf, "%s: index i5=%ld out of range (0, %ld)\n", array_name.c_str(), i5, dim[5] - 1); + throw std::out_of_range(buf); + } + + } + +#endif + + /** + * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline const T &operator()(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) const { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, i2, i3, i4, i5); +#endif + + return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3 * s[3] + i4 * s[4] + i5]; + + } + + /** + * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will + * be performed before accessing memory. By default this is turned off. + * @param i0,... indices + */ + inline T &operator()(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) { +#ifdef MULTIARRAY_INDICES_CHECK + check_indices(i0, i1, i2, i3, i4, i5); +#endif + + return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3 * s[3] + i4 * s[4] + i5]; + + } + + /** + * Array comparison operator + * @param other + */ + bool operator==(const Array6D &other) const { + //compare dimensions + for (int d = 0; d < ndim; d++) { + if (this->dim[d] != other.dim[d]) + return false; + } + return ContiguousArrayND::operator==(other); + } + + /** + * Convert to nested vector> container + * @return vector container + */ + vector>>>>> to_vector() const { + vector>>>>> res; + + res.resize(dim[0]); + + for (int i0 = 0; i0 < dim[0]; i0++) { + res[i0].resize(dim[1]); + + + for (int i1 = 0; i1 < dim[1]; i1++) { + res[i0][i1].resize(dim[2]); + + + for (int i2 = 0; i2 < dim[2]; i2++) { + res[i0][i1][i2].resize(dim[3]); + + + for (int i3 = 0; i3 < dim[3]; i3++) { + res[i0][i1][i2][i3].resize(dim[4]); + + + for (int i4 = 0; i4 < dim[4]; i4++) { + res[i0][i1][i2][i3][i4].resize(dim[5]); + + + for (int i5 = 0; i5 < dim[5]; i5++) { + res[i0][i1][i2][i3][i4][i5] = operator()(i0, i1, i2, i3, i4, i5); + + } + } + } + } + } + } + + + return res; + } // end to_vector() + + + /** + * Set values to vector> container + * @param vec container + */ + void set_vector(const vector>>>>> &vec) { + size_t d0 = 0; + size_t d1 = 0; + size_t d2 = 0; + size_t d3 = 0; + size_t d4 = 0; + size_t d5 = 0; + d0 = vec.size(); + + if (d0 > 0) { + d1 = vec.at(0).size(); + if (d1 > 0) { + d2 = vec.at(0).at(0).size(); + if (d2 > 0) { + d3 = vec.at(0).at(0).at(0).size(); + if (d3 > 0) { + d4 = vec.at(0).at(0).at(0).at(0).size(); + if (d4 > 0) { + d5 = vec.at(0).at(0).at(0).at(0).at(0).size(); + + + } + } + } + } + } + + init(d0, d1, d2, d3, d4, d5, array_name); + for (int i0 = 0; i0 < dim[0]; i0++) { + if (vec.at(i0).size() != d1) + throw std::invalid_argument("Vector size is not constant at dimension 1"); + + for (int i1 = 0; i1 < dim[1]; i1++) { + if (vec.at(i0).at(i1).size() != d2) + throw std::invalid_argument("Vector size is not constant at dimension 2"); + + for (int i2 = 0; i2 < dim[2]; i2++) { + if (vec.at(i0).at(i1).at(i2).size() != d3) + throw std::invalid_argument("Vector size is not constant at dimension 3"); + + for (int i3 = 0; i3 < dim[3]; i3++) { + if (vec.at(i0).at(i1).at(i2).at(i3).size() != d4) + throw std::invalid_argument("Vector size is not constant at dimension 4"); + + for (int i4 = 0; i4 < dim[4]; i4++) { + if (vec.at(i0).at(i1).at(i2).at(i3).at(i4).size() != d5) + throw std::invalid_argument("Vector size is not constant at dimension 5"); + + for (int i5 = 0; i5 < dim[5]; i5++) { + operator()(i0, i1, i2, i3, i4, i5) = vec.at(i0).at(i1).at(i2).at(i3).at(i4).at(i5); + + } + } + } + } + } + } + + } + + /** + * Parametrized constructor from vector> container + * @param vec container + * @param array_name array name + */ + Array6D(const vector>>>>> &vec, const string &array_name = "Array6D") { + this->set_vector(vec); + this->array_name = array_name; + } + + /** + * operator= to vector> container + * @param vec container + */ + Array6D &operator=(const vector>>>>> &vec) { + this->set_vector(vec); + return *this; + } + + + /** + * operator= to flatten vector container + * @param vec container + */ + Array6D &operator=(const vector &vec) { + this->set_flatten_vector(vec); + return *this; + } + + + vector get_shape() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = dim[d]; + return sh; + } + + vector get_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d]; + return sh; + } + + vector get_memory_strides() const { + vector sh(ndim); + for (int d = 0; d < ndim; d++) + sh[d] = s[d] * sizeof(T); + return sh; + } +}; + + +#endif //ACE_MULTIARRAY_H diff --git a/lib/pace/ace_c_basis.cpp b/lib/pace/ace_c_basis.cpp new file mode 100644 index 0000000000..d1c55700b7 --- /dev/null +++ b/lib/pace/ace_c_basis.cpp @@ -0,0 +1,980 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Yury Lysogorskiy on 1.04.20. + +#include "ace_c_basis.h" +#include "ships_radial.h" + +using namespace std; + +ACECTildeBasisSet::ACECTildeBasisSet(string filename) { + load(filename); +} + +ACECTildeBasisSet::ACECTildeBasisSet(const ACECTildeBasisSet &other) { + ACECTildeBasisSet::_copy_scalar_memory(other); + ACECTildeBasisSet::_copy_dynamic_memory(other); + pack_flatten_basis(); +} + + +ACECTildeBasisSet &ACECTildeBasisSet::operator=(const ACECTildeBasisSet &other) { + if (this != &other) { + _clean(); + _copy_scalar_memory(other); + _copy_dynamic_memory(other); + pack_flatten_basis(); + } + return *this; +} + + +ACECTildeBasisSet::~ACECTildeBasisSet() { + ACECTildeBasisSet::_clean(); +} + +void ACECTildeBasisSet::_clean() { + // call parent method + ACEFlattenBasisSet::_clean(); + _clean_contiguous_arrays(); + _clean_basis_arrays(); +} + +void ACECTildeBasisSet::_copy_scalar_memory(const ACECTildeBasisSet &src) { + ACEFlattenBasisSet::_copy_scalar_memory(src); + num_ctilde_max = src.num_ctilde_max; +} + +void ACECTildeBasisSet::_copy_dynamic_memory(const ACECTildeBasisSet &src) {//allocate new memory + ACEFlattenBasisSet::_copy_dynamic_memory(src); + + if (src.basis_rank1 == nullptr) + throw runtime_error("Could not copy ACECTildeBasisSet::basis_rank1 - array not initialized"); + if (src.basis == nullptr) throw runtime_error("Could not copy ACECTildeBasisSet::basis - array not initialized"); + + + basis_rank1 = new ACECTildeBasisFunction *[src.nelements]; + basis = new ACECTildeBasisFunction *[src.nelements]; + + //copy basis arrays + for (SPECIES_TYPE mu = 0; mu < src.nelements; ++mu) { + basis_rank1[mu] = new ACECTildeBasisFunction[src.total_basis_size_rank1[mu]]; + + for (size_t i = 0; i < src.total_basis_size_rank1[mu]; i++) { + basis_rank1[mu][i] = src.basis_rank1[mu][i]; + } + + + basis[mu] = new ACECTildeBasisFunction[src.total_basis_size[mu]]; + for (size_t i = 0; i < src.total_basis_size[mu]; i++) { + basis[mu][i] = src.basis[mu][i]; + } + } + //DON"T COPY CONTIGUOUS ARRAY, REBUILD THEM +} + +void ACECTildeBasisSet::_clean_contiguous_arrays() { + ACEFlattenBasisSet::_clean_contiguous_arrays(); + + delete[] full_c_tildes_rank1; + full_c_tildes_rank1 = nullptr; + + delete[] full_c_tildes; + full_c_tildes = nullptr; +} + +//re-pack the constituent dynamic arrays of all basis functions in contiguous arrays +void ACECTildeBasisSet::pack_flatten_basis() { + compute_array_sizes(basis_rank1, basis); + + //1. clean contiguous arrays + _clean_contiguous_arrays(); + //2. allocate contiguous arrays + delete[] full_ns_rank1; + full_ns_rank1 = new NS_TYPE[rank_array_total_size_rank1]; + delete[] full_ls_rank1; + full_ls_rank1 = new NS_TYPE[rank_array_total_size_rank1]; + delete[] full_mus_rank1; + full_mus_rank1 = new SPECIES_TYPE[rank_array_total_size_rank1]; + delete[] full_ms_rank1; + full_ms_rank1 = new MS_TYPE[rank_array_total_size_rank1]; + + delete[] full_c_tildes_rank1; + full_c_tildes_rank1 = new DOUBLE_TYPE[coeff_array_total_size_rank1]; + + + delete[] full_ns; + full_ns = new NS_TYPE[rank_array_total_size]; + delete[] full_ls; + full_ls = new LS_TYPE[rank_array_total_size]; + delete[] full_mus; + full_mus = new SPECIES_TYPE[rank_array_total_size]; + delete[] full_ms; + full_ms = new MS_TYPE[ms_array_total_size]; + + delete[] full_c_tildes; + full_c_tildes = new DOUBLE_TYPE[coeff_array_total_size]; + + + //3. copy the values from private C_tilde_B_basis_function arrays to new contigous space + //4. clean private memory + //5. reassign private array pointers + + //r = 0, rank = 1 + size_t rank_array_ind_rank1 = 0; + size_t coeff_array_ind_rank1 = 0; + size_t ms_array_ind_rank1 = 0; + + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + for (int func_ind_r1 = 0; func_ind_r1 < total_basis_size_rank1[mu]; ++func_ind_r1) { + ACECTildeBasisFunction &func = basis_rank1[mu][func_ind_r1]; + + //copy values ns from c_tilde_basis_function private memory to contigous memory part + full_ns_rank1[rank_array_ind_rank1] = func.ns[0]; + + //copy values ls from c_tilde_basis_function private memory to contigous memory part + full_ls_rank1[rank_array_ind_rank1] = func.ls[0]; + + //copy values mus from c_tilde_basis_function private memory to contigous memory part + full_mus_rank1[rank_array_ind_rank1] = func.mus[0]; + + //copy values ctildes from c_tilde_basis_function private memory to contigous memory part + memcpy(&full_c_tildes_rank1[coeff_array_ind_rank1], func.ctildes, + func.ndensity * sizeof(DOUBLE_TYPE)); + + + //copy values mus from c_tilde_basis_function private memory to contigous memory part + memcpy(&full_ms_rank1[ms_array_ind_rank1], func.ms_combs, + func.num_ms_combs * + func.rank * sizeof(MS_TYPE)); + + //release memory of each ACECTildeBasisFunction if it is not proxy + func._clean(); + + func.mus = &full_mus_rank1[rank_array_ind_rank1]; + func.ns = &full_ns_rank1[rank_array_ind_rank1]; + func.ls = &full_ls_rank1[rank_array_ind_rank1]; + func.ms_combs = &full_ms_rank1[ms_array_ind_rank1]; + func.ctildes = &full_c_tildes_rank1[coeff_array_ind_rank1]; + func.is_proxy = true; + + rank_array_ind_rank1 += func.rank; + ms_array_ind_rank1 += func.rank * + func.num_ms_combs; + coeff_array_ind_rank1 += func.num_ms_combs * func.ndensity; + + } + } + + + //rank>1, r>0 + size_t rank_array_ind = 0; + size_t coeff_array_ind = 0; + size_t ms_array_ind = 0; + + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + for (int func_ind = 0; func_ind < total_basis_size[mu]; ++func_ind) { + ACECTildeBasisFunction &func = basis[mu][func_ind]; + + //copy values mus from c_tilde_basis_function private memory to contigous memory part + memcpy(&full_mus[rank_array_ind], func.mus, + func.rank * sizeof(SPECIES_TYPE)); + + //copy values ns from c_tilde_basis_function private memory to contigous memory part + memcpy(&full_ns[rank_array_ind], func.ns, + func.rank * sizeof(NS_TYPE)); + //copy values ls from c_tilde_basis_function private memory to contigous memory part + memcpy(&full_ls[rank_array_ind], func.ls, + func.rank * sizeof(LS_TYPE)); + //copy values mus from c_tilde_basis_function private memory to contigous memory part + memcpy(&full_ms[ms_array_ind], func.ms_combs, + func.num_ms_combs * + func.rank * sizeof(MS_TYPE)); + + //copy values ctildes from c_tilde_basis_function private memory to contigous memory part + memcpy(&full_c_tildes[coeff_array_ind], func.ctildes, + func.num_ms_combs * func.ndensity * sizeof(DOUBLE_TYPE)); + + + //release memory of each ACECTildeBasisFunction if it is not proxy + func._clean(); + + func.ns = &full_ns[rank_array_ind]; + func.ls = &full_ls[rank_array_ind]; + func.mus = &full_mus[rank_array_ind]; + func.ctildes = &full_c_tildes[coeff_array_ind]; + func.ms_combs = &full_ms[ms_array_ind]; + func.is_proxy = true; + + rank_array_ind += func.rank; + ms_array_ind += func.rank * + func.num_ms_combs; + coeff_array_ind += func.num_ms_combs * func.ndensity; + } + } +} + +void fwrite_c_tilde_b_basis_func(FILE *fptr, ACECTildeBasisFunction &func) { + RANK_TYPE r; + fprintf(fptr, "ctilde_basis_func: "); + fprintf(fptr, "rank=%d ndens=%d mu0=%d ", func.rank, func.ndensity, func.mu0); + + fprintf(fptr, "mu=("); + for (r = 0; r < func.rank; ++r) + fprintf(fptr, " %d ", func.mus[r]); + fprintf(fptr, ")\n"); + + fprintf(fptr, "n=("); + for (r = 0; r < func.rank; ++r) + fprintf(fptr, " %d ", func.ns[r]); + fprintf(fptr, ")\n"); + + fprintf(fptr, "l=("); + for (r = 0; r < func.rank; ++r) + fprintf(fptr, " %d ", func.ls[r]); + fprintf(fptr, ")\n"); + + fprintf(fptr, "num_ms=%d\n", func.num_ms_combs); + + for (int m_ind = 0; m_ind < func.num_ms_combs; m_ind++) { + fprintf(fptr, "<"); + for (r = 0; r < func.rank; ++r) + fprintf(fptr, " %d ", func.ms_combs[m_ind * func.rank + r]); + fprintf(fptr, ">: "); + for (DENSITY_TYPE p = 0; p < func.ndensity; p++) + fprintf(fptr, " %.18f ", func.ctildes[m_ind * func.ndensity + p]); + fprintf(fptr, "\n"); + } + +} + +void ACECTildeBasisSet::save(const string &filename) { + FILE *fptr; + fptr = fopen(filename.c_str(), "w"); + + fprintf(fptr, "nelements=%d\n", nelements); + + //elements mapping + fprintf(fptr, "elements:"); + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) + fprintf(fptr, " %s", elements_name[mu].c_str()); + fprintf(fptr, "\n\n"); + + fprintf(fptr, "lmax=%d\n\n", lmax); + + fprintf(fptr, "embedding-function: %s\n", npoti.c_str()); + + fprintf(fptr, "%ld FS parameters: ", FS_parameters.size()); + for (int i = 0; i < FS_parameters.size(); ++i) { + fprintf(fptr, " %f", FS_parameters.at(i)); + } + fprintf(fptr, "\n"); + + //hard-core energy cutoff repulsion + fprintf(fptr, "core energy-cutoff parameters: "); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + fprintf(fptr, "%.18f %.18f\n", rho_core_cutoffs(mu_i), drho_core_cutoffs(mu_i)); + + // save E0 values + fprintf(fptr, "E0:"); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + fprintf(fptr, " %.18f", E0vals(mu_i)); + fprintf(fptr, "\n"); + + + fprintf(fptr, "\n"); + + + fprintf(fptr, "radbasename=%s\n", radial_functions->radbasename.c_str()); + fprintf(fptr, "nradbase=%d\n", nradbase); + fprintf(fptr, "nradmax=%d\n", nradmax); + + + fprintf(fptr, "cutoffmax=%f\n", cutoffmax); + + fprintf(fptr, "deltaSplineBins=%f\n", deltaSplineBins); + + //hard-core repulsion + fprintf(fptr, "core repulsion parameters: "); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) + fprintf(fptr, "%.18f %.18f\n", radial_functions->prehc(mu_i, mu_j), radial_functions->lambdahc(mu_j, mu_j)); + + + + + + //TODO: radial functions + //radparameter + fprintf(fptr, "radparameter="); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) + fprintf(fptr, " %.18f", radial_functions->lambda(mu_i, mu_j)); + fprintf(fptr, "\n"); + + fprintf(fptr, "cutoff="); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) + fprintf(fptr, " %.18f", radial_functions->cut(mu_i, mu_j)); + fprintf(fptr, "\n"); + + fprintf(fptr, "dcut="); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) + fprintf(fptr, " %.18f", radial_functions->dcut(mu_i, mu_j)); + fprintf(fptr, "\n"); + + fprintf(fptr, "crad="); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { + for (NS_TYPE k = 0; k < nradbase; k++) { + for (NS_TYPE n = 0; n < nradmax; n++) { + for (LS_TYPE l = 0; l <= lmax; l++) { + fprintf(fptr, " %.18f", radial_functions->crad(mu_i, mu_j, n, l, k)); + } + fprintf(fptr, "\n"); + } + } + } + + fprintf(fptr, "\n"); + + fprintf(fptr, "rankmax=%d\n", rankmax); + fprintf(fptr, "ndensitymax=%d\n", ndensitymax); + fprintf(fptr, "\n"); + + //num_c_tilde_max + fprintf(fptr, "num_c_tilde_max=%d\n", num_ctilde_max); + fprintf(fptr, "num_ms_combinations_max=%d\n", num_ms_combinations_max); + + + //write total_basis_size and total_basis_size_rank1 + fprintf(fptr, "total_basis_size_rank1: "); + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + fprintf(fptr, "%d ", total_basis_size_rank1[mu]); + } + fprintf(fptr, "\n"); + + for (SPECIES_TYPE mu = 0; mu < nelements; mu++) + for (SHORT_INT_TYPE func_ind = 0; func_ind < total_basis_size_rank1[mu]; ++func_ind) + fwrite_c_tilde_b_basis_func(fptr, basis_rank1[mu][func_ind]); + + fprintf(fptr, "total_basis_size: "); + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + fprintf(fptr, "%d ", total_basis_size[mu]); + } + fprintf(fptr, "\n"); + + for (SPECIES_TYPE mu = 0; mu < nelements; mu++) + for (SHORT_INT_TYPE func_ind = 0; func_ind < total_basis_size[mu]; ++func_ind) + fwrite_c_tilde_b_basis_func(fptr, basis[mu][func_ind]); + + + fclose(fptr); +} + +void fread_c_tilde_b_basis_func(FILE *fptr, ACECTildeBasisFunction &func) { + RANK_TYPE r; + int res; + char buf[3][128]; + + res = fscanf(fptr, " ctilde_basis_func: "); + + res = fscanf(fptr, "rank=%s ndens=%s mu0=%s ", buf[0], buf[1], buf[2]); + if (res != 3) + throw invalid_argument("Could not read C-tilde basis function"); + + func.rank = (RANK_TYPE) stol(buf[0]); + func.ndensity = (DENSITY_TYPE) stol(buf[1]); + func.mu0 = (SPECIES_TYPE) stol(buf[2]); + + func.mus = new SPECIES_TYPE[func.rank]; + func.ns = new NS_TYPE[func.rank]; + func.ls = new LS_TYPE[func.rank]; + + res = fscanf(fptr, " mu=("); + for (r = 0; r < func.rank; ++r) { + res = fscanf(fptr, "%s", buf[0]); + if (res != 1) + throw invalid_argument("Could not read C-tilde basis function"); + func.mus[r] = (SPECIES_TYPE) stol(buf[0]); + } + res = fscanf(fptr, " )"); // ")" + + res = fscanf(fptr, " n=("); // "n=" + for (r = 0; r < func.rank; ++r) { + res = fscanf(fptr, "%s", buf[0]); + if (res != 1) + throw invalid_argument("Could not read C-tilde basis function"); + + func.ns[r] = (NS_TYPE) stol(buf[0]); + } + res = fscanf(fptr, " )"); + + res = fscanf(fptr, " l=("); + for (r = 0; r < func.rank; ++r) { + res = fscanf(fptr, "%s", buf[0]); + if (res != 1) + throw invalid_argument("Could not read C-tilde basis function"); + func.ls[r] = (NS_TYPE) stol(buf[0]); + } + res = fscanf(fptr, " )"); + + res = fscanf(fptr, " num_ms=%s\n", buf[0]); + if (res != 1) + throw invalid_argument("Could not read C-tilde basis function"); + + func.num_ms_combs = (SHORT_INT_TYPE) stoi(buf[0]); + + func.ms_combs = new MS_TYPE[func.rank * func.num_ms_combs]; + func.ctildes = new DOUBLE_TYPE[func.ndensity * func.num_ms_combs]; + + for (int m_ind = 0; m_ind < func.num_ms_combs; m_ind++) { + res = fscanf(fptr, " <"); + for (r = 0; r < func.rank; ++r) { + res = fscanf(fptr, "%s", buf[0]); + if (res != 1) + throw invalid_argument("Could not read C-tilde basis function"); + func.ms_combs[m_ind * func.rank + r] = stoi(buf[0]); + } + res = fscanf(fptr, " >:"); + for (DENSITY_TYPE p = 0; p < func.ndensity; p++) { + res = fscanf(fptr, "%s", buf[0]); + if (res != 1) + throw invalid_argument("Could not read C-tilde basis function"); + func.ctildes[m_ind * func.ndensity + p] = stod(buf[0]); + } + } +} + +string +format_error_message(const char *buffer, const string &filename, const string &var_name, const string &expected) { + string err_message = "File '" + filename + "': couldn't read '" + var_name + "'"; + if (buffer) + err_message = err_message + ", read:'" + buffer + "'"; + if (!expected.empty()) + err_message = err_message + ". Expected format: '" + expected + "'"; + return err_message; +} + +void throw_error(const string &filename, const string &var_name, const string expected = "") { + throw invalid_argument(format_error_message(nullptr, filename, var_name, expected)); +} + +DOUBLE_TYPE stod_err(const char *buffer, const string &filename, const string &var_name, const string expected = "") { + try { + return stod(buffer); + } catch (invalid_argument &exc) { + throw invalid_argument(format_error_message(buffer, filename, var_name, expected).c_str()); + } +} + +int stoi_err(const char *buffer, const string &filename, const string &var_name, const string expected = "") { + try { + return stoi(buffer); + } catch (invalid_argument &exc) { + throw invalid_argument(format_error_message(buffer, filename, var_name, expected).c_str()); + } +} + +long int stol_err(const char *buffer, const string &filename, const string &var_name, const string expected = "") { + try { + return stol(buffer); + } catch (invalid_argument &exc) { + throw invalid_argument(format_error_message(buffer, filename, var_name, expected).c_str()); + } +} + +void ACECTildeBasisSet::load(const string filename) { + int res; + char buffer[1024], buffer2[1024]; + string radbasename = "ChebExpCos"; + + FILE *fptr; + fptr = fopen(filename.c_str(), "r"); + if (fptr == NULL) + throw invalid_argument("Could not open file " + filename); + + //read number of elements + res = fscanf(fptr, " nelements="); + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "nelements", "nelements=[number]"); + nelements = stoi_err(buffer, filename, "nelements", "nelements=[number]"); + + //elements mapping + elements_name = new string[nelements]; + res = fscanf(fptr, " elements:"); + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "elements", "elements: Ele1 Ele2 ..."); + elements_name[mu] = buffer; + } + + // load angular basis - only need spherical harmonics parameter + res = fscanf(fptr, " lmax=%s\n", buffer); + if (res != 1) + throw_error(filename, "lmax", "lmax=[number]"); + lmax = stoi_err(buffer, filename, "lmax", "lmax=[number]"); + spherical_harmonics.init(lmax); + + + // reading "embedding-function:" + bool is_embedding_function_specified = false; + res = fscanf(fptr, " embedding-function: %s", buffer); + if (res == 0) { + //throw_error(filename, "E0", " E0: E0-species1 E0-species2 ..."); + this->npoti = "FinnisSinclair"; // default values + //printf("Warning! No embedding-function is specified, embedding-function: FinnisSinclair would be assumed\n"); + is_embedding_function_specified = false; + } else { + this->npoti = buffer; + is_embedding_function_specified = true; + } + int parameters_size; + res = fscanf(fptr, "%s FS parameters:", buffer); + if (res != 1) + throw_error(filename, "FS parameters size", "[number] FS parameters: par1 par2 ..."); + parameters_size = stoi_err(buffer, filename, "FS parameters size", "[number] FS parameters"); + FS_parameters.resize(parameters_size); + for (int i = 0; i < FS_parameters.size(); ++i) { + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "FS parameter", "[number] FS parameters: [par1] [par2] ..."); + FS_parameters[i] = stod_err(buffer, filename, "FS parameter", "[number] FS parameters: [par1] [par2] ..."); + } + + if (!is_embedding_function_specified) { + // assuming non-linear potential, and embedding function type is important + for (int j = 1; j < parameters_size; j += 2) + if (FS_parameters[j] != 1.0) { //if not ensure linearity of embedding function parameters + printf("ERROR! Your potential is non-linear\n"); + printf("Please specify 'embedding-function: FinnisSinclair' or 'embedding-function: FinnisSinclairShiftedScaled' before 'FS parameters size' line\n"); + throw_error(filename, "embedding-function", "FinnisSinclair or FinnisSinclairShiftedScaled"); + } + printf("Notice! No embedding-function is specified, but potential has linear embedding, default embedding-function: FinnisSinclair would be assumed\n"); + } + + //hard-core energy cutoff repulsion + res = fscanf(fptr, " core energy-cutoff parameters:"); + if (res != 0) + throw_error(filename, "core energy-cutoff parameters", "core energy-cutoff parameters: [par1] [par2]"); + + rho_core_cutoffs.init(nelements, "rho_core_cutoffs"); + drho_core_cutoffs.init(nelements, "drho_core_cutoffs"); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) { + res = fscanf(fptr, "%s %s", buffer, buffer2); + if (res != 2) + throw_error(filename, "core energy-cutoff parameters", + "core energy-cutoff parameters: [rho_core_cut] [drho_core_cutoff] ..."); + rho_core_cutoffs(mu_i) = stod_err(buffer, filename, "rho core cutoff", + "core energy-cutoff parameters: [rho_core_cut] [drho_core_cutoff] ..."); + drho_core_cutoffs(mu_i) = stod_err(buffer2, filename, "drho_core_cutoff", + "core energy-cutoff parameters: [rho_core_cut] [drho_core_cutoff] ..."); + } + + // atom energy shift E0 (energy of isolated atom) + E0vals.init(nelements); + + // reading "E0:" + res = fscanf(fptr, " E0: %s", buffer); + if (res == 0) { + //throw_error(filename, "E0", " E0: E0-species1 E0-species2 ..."); + E0vals.fill(0.0); + } else { + double E0 = atof(buffer); + E0vals(0) = E0; + + for (SPECIES_TYPE mu_i = 1; mu_i < nelements; ++mu_i) { + res = fscanf(fptr, " %lf", &E0); + if (res != 1) + throw_error(filename, "E0", " couldn't read one of the E0 values"); + E0vals(mu_i) = E0; + } + res = fscanf(fptr, "\n"); + if (res != 0) + printf("file %s : format seems broken near E0; trying to continue...\n", filename.c_str()); + } + + // check which radial basis we need to load + res = fscanf(fptr, " radbasename=%s\n", buffer); + if (res != 1) { + throw_error(filename, "radbasename", "rabbasename=ChebExpCos|ChebPow|ACE.jl.Basic"); + } else { + radbasename = buffer; + } + +// printf("radbasename = `%s`\n", radbasename.c_str()); + if (radbasename == "ChebExpCos" | radbasename == "ChebPow") { + _load_radial_ACERadial(fptr, filename, radbasename); + } else if (radbasename == "ACE.jl.Basic") { + _load_radial_SHIPsBasic(fptr, filename, radbasename); + } else { + throw invalid_argument( + ("File '" + filename + "': I don't know how to read radbasename = " + radbasename).c_str()); + } + + res = fscanf(fptr, " rankmax="); + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "rankmax", "rankmax=[number]"); + rankmax = stoi_err(buffer, filename, "rankmax", "rankmax=[number]"); + + res = fscanf(fptr, " ndensitymax="); + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "ndensitymax", "ndensitymax=[number]"); + ndensitymax = stoi_err(buffer, filename, "ndensitymax", "ndensitymax=[number]"); + + // read the list of correlations to be put into the basis + //num_c_tilde_max + res = fscanf(fptr, " num_c_tilde_max="); + res = fscanf(fptr, "%s\n", buffer); + if (res != 1) + throw_error(filename, "num_c_tilde_max", "num_c_tilde_max=[number]"); + num_ctilde_max = stol_err(buffer, filename, "num_c_tilde_max", "num_c_tilde_max=[number]"); + + res = fscanf(fptr, " num_ms_combinations_max="); + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "num_ms_combinations_max", "num_ms_combinations_max=[number]"); +// throw invalid_argument(("File '" + filename + "': couldn't read num_ms_combinations_max").c_str()); + num_ms_combinations_max = stol_err(buffer, filename, "num_ms_combinations_max", "num_ms_combinations_max=[number]"); + + //read total_basis_size_rank1 + total_basis_size_rank1 = new SHORT_INT_TYPE[nelements]; + basis_rank1 = new ACECTildeBasisFunction *[nelements]; + res = fscanf(fptr, " total_basis_size_rank1: "); + + + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "total_basis_size_rank1", "total_basis_size_rank1: [size_ele1] [size_ele2] ..."); +// throw invalid_argument(("File '" + filename + "': couldn't read total_basis_size_rank1").c_str()); + total_basis_size_rank1[mu] = stoi_err(buffer, filename, "total_basis_size_rank1", + "total_basis_size_rank1: [size_ele1] [size_ele2] ..."); + basis_rank1[mu] = new ACECTildeBasisFunction[total_basis_size_rank1[mu]]; + } + for (SPECIES_TYPE mu = 0; mu < nelements; mu++) + for (SHORT_INT_TYPE func_ind = 0; func_ind < total_basis_size_rank1[mu]; ++func_ind) { + fread_c_tilde_b_basis_func(fptr, basis_rank1[mu][func_ind]); + } + + //read total_basis_size + res = fscanf(fptr, " total_basis_size: "); + total_basis_size = new SHORT_INT_TYPE[nelements]; + basis = new ACECTildeBasisFunction *[nelements]; + + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "total_basis_size", "total_basis_size: [size_ele1] [size_ele2] ..."); + total_basis_size[mu] = stoi_err(buffer, filename, "total_basis_size", + "total_basis_size: [size_ele1] [size_ele2] ..."); + basis[mu] = new ACECTildeBasisFunction[total_basis_size[mu]]; + } + for (SPECIES_TYPE mu = 0; mu < nelements; mu++) + for (SHORT_INT_TYPE func_ind = 0; func_ind < total_basis_size[mu]; ++func_ind) { + fread_c_tilde_b_basis_func(fptr, basis[mu][func_ind]); + } + + fclose(fptr); + +// radial_functions->radbasename = radbasename; + radial_functions->setuplookupRadspline(); + pack_flatten_basis(); +} + +void ACECTildeBasisSet::compute_array_sizes(ACECTildeBasisFunction **basis_rank1, ACECTildeBasisFunction **basis) { + //compute arrays sizes + rank_array_total_size_rank1 = 0; + //ms_array_total_size_rank1 = rank_array_total_size_rank1; + coeff_array_total_size_rank1 = 0; + + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + if (total_basis_size_rank1[mu] > 0) { + rank_array_total_size_rank1 += total_basis_size_rank1[mu]; + + ACEAbstractBasisFunction &func = basis_rank1[mu][0];//TODO: get total density instead of density from first function + coeff_array_total_size_rank1 += total_basis_size_rank1[mu] * func.ndensity; + } + } + + rank_array_total_size = 0; + coeff_array_total_size = 0; + + ms_array_total_size = 0; + max_dB_array_size = 0; + + + max_B_array_size = 0; + + size_t cur_ms_size = 0; + size_t cur_ms_rank_size = 0; + + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + + cur_ms_size = 0; + cur_ms_rank_size = 0; + for (int func_ind = 0; func_ind < total_basis_size[mu]; ++func_ind) { + auto &func = basis[mu][func_ind]; + rank_array_total_size += func.rank; + ms_array_total_size += func.rank * func.num_ms_combs; + coeff_array_total_size += func.ndensity * func.num_ms_combs; + + cur_ms_size += func.num_ms_combs; + cur_ms_rank_size += func.rank * func.num_ms_combs; + } + + if (cur_ms_size > max_B_array_size) + max_B_array_size = cur_ms_size; + + if (cur_ms_rank_size > max_dB_array_size) + max_dB_array_size = cur_ms_rank_size; + } +} + +void ACECTildeBasisSet::_clean_basis_arrays() { + if (basis_rank1 != nullptr) + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + delete[] basis_rank1[mu]; + basis_rank1[mu] = nullptr; + } + + if (basis != nullptr) + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + delete[] basis[mu]; + basis[mu] = nullptr; + } + delete[] basis; + basis = nullptr; + + delete[] basis_rank1; + basis_rank1 = nullptr; +} + +//pack into 1D array with all basis functions +void ACECTildeBasisSet::flatten_basis(C_tilde_full_basis_vector2d &mu0_ctilde_basis_vector) { + + _clean_basis_arrays(); + basis_rank1 = new ACECTildeBasisFunction *[nelements]; + basis = new ACECTildeBasisFunction *[nelements]; + + delete[] total_basis_size_rank1; + delete[] total_basis_size; + total_basis_size_rank1 = new SHORT_INT_TYPE[nelements]; + total_basis_size = new SHORT_INT_TYPE[nelements]; + + + size_t tot_size_rank1 = 0; + size_t tot_size = 0; + + for (SPECIES_TYPE mu = 0; mu < this->nelements; ++mu) { + tot_size = 0; + tot_size_rank1 = 0; + + for (auto &func: mu0_ctilde_basis_vector[mu]) { + if (func.rank == 1) tot_size_rank1 += 1; + else tot_size += 1; + } + + total_basis_size_rank1[mu] = tot_size_rank1; + basis_rank1[mu] = new ACECTildeBasisFunction[tot_size_rank1]; + + total_basis_size[mu] = tot_size; + basis[mu] = new ACECTildeBasisFunction[tot_size]; + } + + + for (SPECIES_TYPE mu = 0; mu < this->nelements; ++mu) { + size_t ind_rank1 = 0; + size_t ind = 0; + + for (auto &func: mu0_ctilde_basis_vector[mu]) { + if (func.rank == 1) { //r=0, rank=1 + basis_rank1[mu][ind_rank1] = func; + ind_rank1 += 1; + } else { //r>0, rank>1 + basis[mu][ind] = func; + ind += 1; + } + } + + } +} + + +void ACECTildeBasisSet::_load_radial_ACERadial(FILE *fptr, + const string filename, + const string radbasename) { + int res; + char buffer[1024], buffer2[1024]; + + res = fscanf(fptr, " nradbase="); + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "nradbase", "nradbase=[number]"); +// throw invalid_argument(("File '" + filename + "': couldn't read nradbase").c_str()); + nradbase = stoi_err(buffer, filename, "nradbase", "nradbase=[number]"); + + res = fscanf(fptr, " nradmax="); + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "nradmax", "nradmax=[number]"); + nradmax = stoi_err(buffer, filename, "nradmax", "nradmax=[number]"); + + res = fscanf(fptr, " cutoffmax="); + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "cutoffmax", "cutoffmax=[number]"); + cutoffmax = stod_err(buffer, filename, "cutoffmax", "cutoffmax=[number]"); + + + res = fscanf(fptr, " deltaSplineBins="); + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "deltaSplineBins", "deltaSplineBins=[spline density, Angstroms]"); +// throw invalid_argument(("File '" + filename + "': couldn't read ntot").c_str()); + deltaSplineBins = stod_err(buffer, filename, "deltaSplineBins", "deltaSplineBins=[spline density, Angstroms]"); + + + if (radial_functions == nullptr) + radial_functions = new ACERadialFunctions(nradbase, lmax, nradmax, + deltaSplineBins, + nelements, + cutoffmax, radbasename); + else + radial_functions->init(nradbase, lmax, nradmax, + deltaSplineBins, + nelements, + cutoffmax, radbasename); + + + //hard-core repulsion + res = fscanf(fptr, " core repulsion parameters:"); + if (res != 0) + throw_error(filename, "core repulsion parameters", "core repulsion parameters: [prehc lambdahc] ..."); +// throw invalid_argument(("File '" + filename + "': couldn't read core repulsion parameters").c_str()); + + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { + res = fscanf(fptr, "%s %s", buffer, buffer2); + if (res != 2) + throw_error(filename, "core repulsion parameters", "core repulsion parameters: [prehc lambdahc] ..."); + radial_functions->prehc(mu_i, mu_j) = stod_err(buffer, filename, "core repulsion parameters", + "core repulsion parameters: [prehc lambdahc] ..."); + radial_functions->lambdahc(mu_i, mu_j) = stod_err(buffer2, filename, "core repulsion parameters", + "core repulsion parameters: [prehc lambdahc] ..."); + } + + + + //read radial functions parameter + res = fscanf(fptr, " radparameter="); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "radparameter", "radparameter=[param_ele1] [param_ele2]"); + radial_functions->lambda(mu_i, mu_j) = stod_err(buffer, filename, "radparameter", + "radparameter=[param_ele1] [param_ele2]"); + } + + + res = fscanf(fptr, " cutoff="); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "cutoff", "cutoff=[param_ele1] [param_ele2]"); + radial_functions->cut(mu_i, mu_j) = stod_err(buffer, filename, "cutoff", + "cutoff=[param_ele1] [param_ele2]"); + } + + + res = fscanf(fptr, " dcut="); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { + res = fscanf(fptr, " %s", buffer); + if (res != 1) + throw_error(filename, "dcut", "dcut=[param_ele1] [param_ele2]"); + radial_functions->dcut(mu_i, mu_j) = stod_err(buffer, filename, "dcut", "dcut=[param_ele1] [param_ele2]"); + } + + + res = fscanf(fptr, " crad="); + for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) + for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) + for (NS_TYPE k = 0; k < nradbase; k++) + for (NS_TYPE n = 0; n < nradmax; n++) + for (LS_TYPE l = 0; l <= lmax; l++) { + res = fscanf(fptr, "%s", buffer); + if (res != 1) + throw_error(filename, "crad", "crad=[crad_]...[crad_knl]: nradbase*nrad*(l+1) times"); + radial_functions->crad(mu_i, mu_j, n, l, k) = stod_err(buffer, filename, "crad", + "crad=[crad_]...[crad_knl]: nradbase*nrad*(l+1) times"); + } +} + +void ACECTildeBasisSet::_load_radial_SHIPsBasic(FILE *fptr, + const string filename, + const string radbasename) { + // create a radial basis object, and read it from the file pointer + SHIPsRadialFunctions *ships_radial_functions = new SHIPsRadialFunctions(); + ships_radial_functions->fread(fptr); + + //mimic ships_radial_functions to ACERadialFunctions + ships_radial_functions->nradial = ships_radial_functions->get_maxn(); + ships_radial_functions->nradbase = ships_radial_functions->get_maxn(); + + nradbase = ships_radial_functions->get_maxn(); + nradmax = ships_radial_functions->get_maxn(); + cutoffmax = ships_radial_functions->get_rcut(); + deltaSplineBins = 0.001; + + ships_radial_functions->init(nradbase, lmax, nradmax, + deltaSplineBins, + nelements, + cutoffmax, radbasename); + + + if (radial_functions) delete radial_functions; + radial_functions = ships_radial_functions; + radial_functions->prehc.fill(0); + radial_functions->lambdahc.fill(1); + radial_functions->lambda.fill(0); + + + radial_functions->cut.fill(ships_radial_functions->get_rcut()); + radial_functions->dcut.fill(0); + + radial_functions->crad.fill(0); + +} \ No newline at end of file diff --git a/lib/pace/ace_c_basis.h b/lib/pace/ace_c_basis.h new file mode 100644 index 0000000000..ec6b9e8afc --- /dev/null +++ b/lib/pace/ace_c_basis.h @@ -0,0 +1,155 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Yury Lysogorskiy on 1.04.20. + +#ifndef ACE_C_BASIS_H +#define ACE_C_BASIS_H + +#include "ace_flatten_basis.h" + +typedef vector> C_tilde_full_basis_vector2d; + +/** + * ACE basis set of C-tilde basis functions + */ +class ACECTildeBasisSet : public ACEFlattenBasisSet { +public: + + ACECTildeBasisFunction **basis_rank1 = nullptr; ///< two-dimensional array of first-rank basis function with indices: [species index][func index] + ACECTildeBasisFunction **basis = nullptr; ///< two-dimensional array of higher rank basis function with indices: [species index][func index] + + DOUBLE_TYPE *full_c_tildes_rank1 = nullptr; ///< C_tilde coefficients contiguous package, size: coeff_array_total_size_rank1 + DOUBLE_TYPE *full_c_tildes = nullptr; ///< C_tilde coefficients contiguous package, size: coeff_array_total_size + + //TODO: remove? + SHORT_INT_TYPE num_ctilde_max = 0; + + + /** + * Default constructor + */ + ACECTildeBasisSet() = default; + + /** + * Constructor from .ace file + */ + ACECTildeBasisSet(const string filename); + + /** + * Copy constructor (see. Rule of Three) + * @param other + */ + ACECTildeBasisSet(const ACECTildeBasisSet &other); + + /** + * operator= (see. Rule of Three) + * @param other + * @return + */ + ACECTildeBasisSet &operator=(const ACECTildeBasisSet &other); + + /** + * Destructor (see. Rule of Three) + */ + ~ACECTildeBasisSet() override; + + /** + * Cleaning dynamic memory of the class (see. Rule of Three) + */ + void _clean() override; + + /** + * Copying and cleaning dynamic memory of the class (see. Rule of Three) + * @param src + */ + void _copy_dynamic_memory(const ACECTildeBasisSet &src); + + /** + * Copying scalar variables + * @param src + */ + void _copy_scalar_memory(const ACECTildeBasisSet &src); + + /** + * Clean contiguous arrays (full_c_tildes_rank1, full_c_tildes) and those of base class + */ + void _clean_contiguous_arrays() override ; + + /** + * Save potential to .ace file + * @param filename .ace file name + */ + void save(const string &filename) override; + + /** + * Load potential from .ace + * @param filename .ace file name + */ + void load(const string filename) override; + + /** + * Load the ACE type radial basis + */ + void _load_radial_ACERadial(FILE *fptr, + const string filename, + const string radbasename); + + void _load_radial_SHIPsBasic(FILE * fptr, + const string filename, + const string radbasename ); + + /** + * Re-pack the constituent dynamic arrays of all basis functions in contiguous arrays + */ + void pack_flatten_basis() override; + + /** + * Computes flatten array sizes + * @param basis_rank1 two-dimensional array of first-rank ACECTildeBasisFunctions + * @param basis two-dimensional array of higher-rank ACECTildeBasisFunctions + */ + void compute_array_sizes(ACECTildeBasisFunction** basis_rank1, ACECTildeBasisFunction** basis); + + /** + * Clean basis arrays 'basis_rank1' and 'basis' + */ + void _clean_basis_arrays(); + + /** + * Pack two-dimensional vector of ACECTildeBasisFunction into 1D dynami array with all basis functions + * @param mu0_ctilde_basis_vector vector> + */ + void flatten_basis(C_tilde_full_basis_vector2d& mu0_ctilde_basis_vector); + + /** + * Empty stub implementation + */ + void flatten_basis() override{}; +}; + +#endif //ACE_C_BASIS_H diff --git a/lib/pace/ace_c_basisfunction.h b/lib/pace/ace_c_basisfunction.h new file mode 100644 index 0000000000..4e2795590e --- /dev/null +++ b/lib/pace/ace_c_basisfunction.h @@ -0,0 +1,251 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Yury Lysogorskiy on 26.02.20. + +#ifndef ACE_C_BASISFUNCTION_H +#define ACE_C_BASISFUNCTION_H + +#include +#include +#include +#include + +#include "ace_types.h" + +//macros for copying the member-array from "other" object for C-tilde and B-basis +#define basis_mem_copy(other, array, size, type) if(other.array) { \ + if(!is_proxy) delete[] array;\ + array = new type[(size)];\ + is_proxy = false;\ + memcpy(array, other.array, (size) * sizeof(type));\ +} + +/** + * Abstract basis function, that stores general quantities + */ +struct ACEAbstractBasisFunction { + /** + * flattened array of computed combinations of (m1, m2, ..., m_rank) + * which have non-zero general Clebsch-Gordan coefficient: + * \f$ \mathbf{m}_1, \dots, \mathbf{m}_\mathrm{num ms combs}\f$ = + * \f$ (m_1, m_2, \dots, m_{rank})_1, \dots, (m_1, m_2, \dots, m_{rank})_{\mathrm{num ms combs}} \f$, + * size = num_ms_combs * rank, + * effective shape: [num_ms_combs][rank] + */ + MS_TYPE *ms_combs = nullptr; + + /** + * species types of neighbours atoms \f$ \mathbf{\mu} = (\mu_1, \mu_2, \dots, \mu_{rank}) \f$, + * should be lexicographically sorted, + * size = rank, + * effective shape: [rank] + */ + SPECIES_TYPE *mus = nullptr; + + /** + * indices for radial part \f$ \mathbf{n} = (n_1, n_2, \dots, n_{rank}) \f$, + * should be lexicographically sorted, + * size = rank, + * effective shape: [rank] + */ + NS_TYPE *ns = nullptr; + + + /** + * indices for radial part \f$ \mathbf{l} = (l_1, l_2, \dots, l_{rank}) \f$, + * should be lexicographically sorted, + * size = rank, + * effective shape: [rank] + */ + LS_TYPE *ls = nullptr; + + SHORT_INT_TYPE num_ms_combs = 0; ///< number of different ms-combinations + + RANK_TYPE rank = 0; ///< number of atomic base functions "A"s in basis function product B + + DENSITY_TYPE ndensity = 0; ///< number of densities + + SPECIES_TYPE mu0 = 0; ///< species type of central atom + + /** + * whether ms array contains only "non-negative" ms-combinations. + * positive ms-combination is when the first non-zero m is positive (0 1 -1) + * negative ms-combination is when the first non-zero m is negative (0 -1 1) + */ + bool is_half_ms_basis = false; + + /* + * flag, whether object is "owner" (i.e. responsible for memory cleaning) of + * the ms, ns, ls, mus and other dynamically allocated arrases or just a proxy for them + */ + bool is_proxy = false; + + /** + * Copying static and dynamic memory variables from another ACEAbstractBasisFunction. + * Always copy the dynamic memory, even if the source is a proxy object + * @param other + */ + virtual void _copy_from(const ACEAbstractBasisFunction &other) { + rank = other.rank; + ndensity = other.ndensity; + mu0 = other.mu0; + num_ms_combs = other.num_ms_combs; + is_half_ms_basis = other.is_half_ms_basis; + is_proxy = false; + + basis_mem_copy(other, mus, rank, SPECIES_TYPE) + basis_mem_copy(other, ns, rank, NS_TYPE) + basis_mem_copy(other, ls, rank, LS_TYPE) + basis_mem_copy(other, ms_combs, num_ms_combs * rank, MS_TYPE) + } + + /** + * Clean the dynamically allocated memory if object is responsible for it + */ + virtual void _clean() { + //release memory if the structure is not proxy + if (!is_proxy) { + delete[] mus; + delete[] ns; + delete[] ls; + delete[] ms_combs; + } + + mus = nullptr; + ns = nullptr; + ls = nullptr; + ms_combs = nullptr; + } + +}; + +/** + * Representation of C-tilde basis function, i.e. the function that is summed up over a group of B-functions + * that differs only by intermediate coupling orbital moment \f$ L \f$ and coefficients. + */ +struct ACECTildeBasisFunction : public ACEAbstractBasisFunction { + + /** + * c_tilde coefficients for all densities, + * size = num_ms_combs*ndensity, + * effective shape [num_ms_combs][ndensity] + */ + DOUBLE_TYPE *ctildes = nullptr; + + /* + * Default constructor + */ + ACECTildeBasisFunction() = default; + + // Because the ACECTildeBasisFunction contains dynamically allocated arrays, the Rule of Three should be + // fulfilled, i.e. copy constructor (copy the dynamic arrays), operator= (release previous arrays and + // copy the new dynamic arrays) and destructor (release all dynamically allocated memory) + + /** + * Copy constructor, to fulfill the Rule of Three. + * Always copy the dynamic memory, even if the source is a proxy object. + */ + ACECTildeBasisFunction(const ACECTildeBasisFunction &other) { + _copy_from(other); + } + + /* + * operator=, to fulfill the Rule of Three. + * Always copy the dynamic memory, even if the source is a proxy object + */ + ACECTildeBasisFunction &operator=(const ACECTildeBasisFunction &other) { + _clean(); + _copy_from(other); + return *this; + } + + /* + * Destructor + */ + ~ACECTildeBasisFunction() { + _clean(); + } + + /** + * Copy from another object, always copy the memory, even if the source is a proxy object + * @param other + */ + void _copy_from(const ACECTildeBasisFunction &other) { + ACEAbstractBasisFunction::_copy_from(other); + is_proxy = false; + basis_mem_copy(other, ctildes, num_ms_combs * ndensity, DOUBLE_TYPE) + } + + /** + * Clean the dynamically allocated memory if object is responsible for it + */ + void _clean() override { + ACEAbstractBasisFunction::_clean(); + //release memory if the structure is not proxy + if (!is_proxy) { + delete[] ctildes; + } + ctildes = nullptr; + } + + /** + * Print the information about basis function to cout, in order to ease the output redirection. + */ + void print() const { + using namespace std; + cout << "ACECTildeBasisFunction: ndensity= " << (int) this->ndensity << ", mu0 = " << (int) this->mu0 << " "; + cout << " mus=("; + for (RANK_TYPE r = 0; r < this->rank; r++) + cout << (int) this->mus[r] << " "; + cout << "), ns=("; + for (RANK_TYPE r = 0; r < this->rank; r++) + cout << this->ns[r] << " "; + cout << "), ls=("; + for (RANK_TYPE r = 0; r < this->rank; r++) + cout << this->ls[r] << " "; + + cout << "), " << this->num_ms_combs << " m_s combinations: {" << endl; + + for (int i = 0; i < this->num_ms_combs; i++) { + cout << "\t< "; + for (RANK_TYPE r = 0; r < this->rank; r++) + cout << this->ms_combs[i * this->rank + r] << " "; + cout << " >: c_tilde="; + for (DENSITY_TYPE p = 0; p < this->ndensity; ++p) + cout << " " << this->ctildes[i * this->ndensity + p] << " "; + cout << endl; + } + if (this->is_proxy) + cout << "proxy "; + if (this->is_half_ms_basis) + cout << "half_ms_basis"; + cout << "}" << endl; + } +}; + +#endif //ACE_C_BASISFUNCTION_H diff --git a/lib/pace/ace_complex.h b/lib/pace/ace_complex.h new file mode 100644 index 0000000000..5fdb4b5b93 --- /dev/null +++ b/lib/pace/ace_complex.h @@ -0,0 +1,266 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Yury Lysogorskiy on 26.02.20. + +#ifndef ACE_COMPLEX_H +#define ACE_COMPLEX_H + + +/** +A custom data structure for complex numbers and overloaded operations with them. +*/ +struct ACEComplex { +public: + /** + Double, real part of the complex number + */ + DOUBLE_TYPE real; + /** + Double, imaginary part of the complex number + */ + DOUBLE_TYPE img; + + ACEComplex &operator=(const ACEComplex &rhs) = default; + + ACEComplex &operator=(const DOUBLE_TYPE &rhs) { + this->real = rhs; + this->img = 0.; + return *this; + } + + /** + Overloading of arithmetical operator += ACEComplex + */ + ACEComplex &operator+=(const ACEComplex &rhs) { + this->real += rhs.real; + this->img += rhs.img; + return *this; // return the result by reference + } + + /** + Overloading of arithmetical operator += DOUBLE_TYPE + */ + ACEComplex &operator+=(const DOUBLE_TYPE &rhs) { + this->real += rhs; + return *this; // return the result by reference + } + + /** + Overloading of arithmetical operator *= DOUBLE_TYPE + */ + ACEComplex &operator*=(const DOUBLE_TYPE &rhs) { + this->real *= rhs; + this->img *= rhs; + return *this; // return the result by reference + } + + /** + Overloading of arithmetical operator *= ACEComplex + */ + ACEComplex &operator*=(const ACEComplex &rhs) { + DOUBLE_TYPE old_real = this->real; + this->real = old_real * rhs.real - this->img * rhs.img; + this->img = old_real * rhs.img + this->img * rhs.real; + return *this; // return the result by reference + } + + /** + Overloading of arithmetical operator * ACEComplex + */ + ACEComplex operator*(const ACEComplex &cm2) const { + ACEComplex res{real * cm2.real - img * cm2.img, + real * cm2.img + img * cm2.real}; + return res; + } + + /* + * Return complex conjugated copy of itself + */ + ACEComplex conjugated() const { + ACEComplex res{real, -img}; + return res; + } + + /* + * Complex conjugate itself inplace + */ + void conjugate() { + img = -img; + } + + /* + * Multiplication by ACEComplex and return real-part only + */ + DOUBLE_TYPE real_part_product(const ACEComplex &cm2) const { + return real * cm2.real - img * cm2.img; + } + + /* + * Multiplication by DOUBLE_TYPE and return real-part only + */ + DOUBLE_TYPE real_part_product(const DOUBLE_TYPE &cm2) const { + return real * cm2; + } + + /* + * Overloading of arithmetical operator * by DOUBLE_TYPE + */ + ACEComplex operator*(const DOUBLE_TYPE &cm2) const { + ACEComplex res{real * cm2, + img * cm2}; + return res; + } + + /* + * Overloading of arithmetical operator + ACEComplex + */ + ACEComplex operator+(const ACEComplex &cm2) const { + ACEComplex res{real + cm2.real, + img + cm2.img}; + return res; + } + + /* + * Overloading of arithmetical operator + with DOUBLE_TYPE + */ + ACEComplex operator+(const DOUBLE_TYPE &cm2) const { + ACEComplex res{real + cm2, img}; + return res; + } + + /* + * Overloading of arithmetical operator == ACEComplex + */ + bool operator==(const ACEComplex &c2) const { + return (real == c2.real) && (img == c2.img); + } + + /* + * Overloading of arithmetical operator == DOUBLE_TYPE + */ + bool operator==(const DOUBLE_TYPE &d2) const { + return (real == d2) && (img == 0.); + } + + /* + * Overloading of arithmetical operator != ACEComplex + */ + bool operator!=(const ACEComplex &c2) const { + return (real != c2.real) || (img != c2.img); + } + + /* + * Overloading of arithmetical operator != DOUBLE_TYPE + */ + bool operator!=(const DOUBLE_TYPE &d2) const { + return (real != d2) || (img != 0.); + } + +}; + +/* + * double * complex for commutativity with complex * double + */ +inline ACEComplex operator*(const DOUBLE_TYPE &real, const ACEComplex &cm) { + return cm * real; +} + +/* + * double + complex for commutativity with complex + double + */ +inline ACEComplex operator+(const DOUBLE_TYPE &real, const ACEComplex &cm) { + return cm + real; +} + +/** +A structure to store the derivative of \f$ Y_{lm} \f$ +*/ +struct ACEDYcomponent { +public: + /** + complex, contains the three components of derivative of Ylm, + \f$ \frac{dY_{lm}}{dx}, \frac{dY_{lm}}{dy} and \frac{dY_{lm}}{dz}\f$ + */ + ACEComplex a[3]; + + /* + * Overloading of arithmetical operator*= DOUBLE_TYPE + */ + ACEDYcomponent &operator*=(const DOUBLE_TYPE &rhs) { + this->a[0] *= rhs; + this->a[1] *= rhs; + this->a[2] *= rhs; + return *this; + } + + /* + * Overloading of arithmetical operator * ACEComplex + */ + ACEDYcomponent operator*(const ACEComplex &rhs) const { + ACEDYcomponent res; + res.a[0] = this->a[0] * rhs; + res.a[1] = this->a[1] * rhs; + res.a[2] = this->a[2] * rhs; + return res; + } + + /* + * Overloading of arithmetical operator * DOUBLE_TYPE + */ + ACEDYcomponent operator*(const DOUBLE_TYPE &rhs) const { + ACEDYcomponent res; + res.a[0] = this->a[0] * rhs; + res.a[1] = this->a[1] * rhs; + res.a[2] = this->a[2] * rhs; + return res; + } + + /* + * Return conjugated copy of itself + */ + ACEDYcomponent conjugated() const { + ACEDYcomponent res; + res.a[0] = this->a[0].conjugated(); + res.a[1] = this->a[1].conjugated(); + res.a[2] = this->a[2].conjugated(); + return res; + } + + /* + * Conjugated itself in-place + */ + void conjugate() { + this->a[0].conjugate(); + this->a[1].conjugate(); + this->a[2].conjugate(); + } + +}; + + +#endif //ACE_COMPLEX_H diff --git a/lib/pace/ace_contigous_array.h b/lib/pace/ace_contigous_array.h new file mode 100644 index 0000000000..f008fa203f --- /dev/null +++ b/lib/pace/ace_contigous_array.h @@ -0,0 +1,249 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Yury Lysogorskiy on 11.01.20. +#ifndef ACE_CONTIGUOUSARRAYND_H +#define ACE_CONTIGUOUSARRAYND_H + +#include + +#include "ace_types.h" + +using namespace std; + +/** + * Common predecessor class to represent multidimensional array of type T + * and store it in memory contiguous form + * + * @tparam T data type + */ +template +class ContiguousArrayND { +protected: + T *data = nullptr; ///< pointer to contiguous data + size_t size = 0; ///< total array size + string array_name = "Array"; /// 0) { + data = new T[size]; + for (size_t ind = 0; ind < size; ind++) + data[ind] = other.data[ind]; + } + } else { //is proxy, then copy the pointer + data = other.data; + } + } + + /** + * Overload operator= + * @param other another ContiguousArrayND + * @return itself + */ + + ContiguousArrayND &operator=(const ContiguousArrayND &other) { +#ifdef MULTIARRAY_LIFE_CYCLE + cout< 0) { + + if(data!=nullptr) delete[] data; + data = new T[size]; + + for (size_t ind = 0; ind < size; ind++) + data[ind] = other.data[ind]; + } + } else { //is proxy, then copy the pointer + data = other.data; + } + } + return *this; + } + + + //TODO: make destructor virtual, check the destructors in inherited classes + + /** + * Destructor + */ + ~ContiguousArrayND() { +#ifdef MULTIARRAY_LIFE_CYCLE + cout<array_name = name; + } + + /** + * Get total number of elements in array (its size) + * @return array size + */ + size_t get_size() const { + return size; + } + + /** + * Fill array with value + * @param value value to fill + */ + void fill(T value) { + for (size_t ind = 0; ind < size; ind++) + data[ind] = value; + } + + /** + * Get array data at absolute index ind for reading + * @param ind absolute index + * @return array value + */ + inline const T &get_data(size_t ind) const { +#ifdef MULTIARRAY_INDICES_CHECK + if ((ind < 0) | (ind >= size)) { + printf("%s: get_data ind=%d out of range (0, %d)\n", array_name, ind, size); + exit(EXIT_FAILURE); + } +#endif + return data[ind]; + } + + /** + * Get array data at absolute index ind for writing + * @param ind absolute index + * @return array value + */ + inline T &get_data(size_t ind) { +#ifdef MULTIARRAY_INDICES_CHECK + if ((ind < 0) | (ind >= size)) { + printf("%s: get_data ind=%ld out of range (0, %ld)\n", array_name.c_str(), ind, size); + exit(EXIT_FAILURE); + } +#endif + return data[ind]; + } + + /** + * Get array data pointer + * @return data array pointer + */ + inline T* get_data() const { + return data; + } + + /** + * Overload comparison operator== + * Compare the total size and array values elementwise. + * + * @param other another array + * @return + */ + bool operator==(const ContiguousArrayND &other) const { + if (this->size != other.size) + return false; + + for (size_t i = 0; i < this->size; ++i) + if (this->data[i] != other.data[i]) + return false; + + return true; + } + + + /** + * Convert to flatten vector container + * @return vector container + */ + vector to_flatten_vector() const { + vector res; + + res.resize(size); + size_t vec_ind = 0; + + for (int vec_ind = 0; vec_ind < size; vec_ind++) + res.at(vec_ind) = data[vec_ind]; + + return res; + } // end to_flatten_vector() + + + /** + * Set values from flatten vector container + * @param vec container + */ + void set_flatten_vector(const vector &vec) { + if (vec.size() != size) + throw std::invalid_argument("Flatten vector size is not consistent with expected size"); + for (size_t i = 0; i < size; i++) { + data[i] = vec[i]; + } + } + + bool is_proxy(){ + return is_proxy_; + } + +}; + + +#endif //ACE_CONTIGUOUSARRAYND_H \ No newline at end of file diff --git a/lib/pace/ace_evaluator.cpp b/lib/pace/ace_evaluator.cpp new file mode 100644 index 0000000000..987f4502bf --- /dev/null +++ b/lib/pace/ace_evaluator.cpp @@ -0,0 +1,660 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Yury Lysogorskiy on 31.01.20. + +#include "ace_evaluator.h" + +#include "ace_abstract_basis.h" +#include "ace_types.h" + +void ACEEvaluator::init(ACEAbstractBasisSet *basis_set) { + A.init(basis_set->nelements, basis_set->nradmax + 1, basis_set->lmax + 1, "A"); + A_rank1.init(basis_set->nelements, basis_set->nradbase, "A_rank1"); + + rhos.init(basis_set->ndensitymax + 1, "rhos"); // +1 density for core repulsion + dF_drho.init(basis_set->ndensitymax + 1, "dF_drho"); // +1 density for core repulsion +} + +void ACEEvaluator::init_timers() { + loop_over_neighbour_timer.init(); + forces_calc_loop_timer.init(); + forces_calc_neighbour_timer.init(); + energy_calc_timer.init(); + per_atom_calc_timer.init(); + total_time_calc_timer.init(); +} + +//================================================================================================================ + +void ACECTildeEvaluator::set_basis(ACECTildeBasisSet &bas) { + basis_set = &bas; + init(basis_set); +} + +void ACECTildeEvaluator::init(ACECTildeBasisSet *basis_set) { + + ACEEvaluator::init(basis_set); + + + weights.init(basis_set->nelements, basis_set->nradmax + 1, basis_set->lmax + 1, + "weights"); + + weights_rank1.init(basis_set->nelements, basis_set->nradbase, "weights_rank1"); + + + DG_cache.init(1, basis_set->nradbase, "DG_cache"); + DG_cache.fill(0); + + R_cache.init(1, basis_set->nradmax, basis_set->lmax + 1, "R_cache"); + R_cache.fill(0); + + DR_cache.init(1, basis_set->nradmax, basis_set->lmax + 1, "DR_cache"); + DR_cache.fill(0); + + Y_cache.init(1, basis_set->lmax + 1, "Y_cache"); + Y_cache.fill({0, 0}); + + DY_cache.init(1, basis_set->lmax + 1, "dY_dense_cache"); + DY_cache.fill({0.}); + + //hard-core repulsion + DCR_cache.init(1, "DCR_cache"); + DCR_cache.fill(0); + dB_flatten.init(basis_set->max_dB_array_size, "dB_flatten"); + + +} + +void ACECTildeEvaluator::resize_neighbours_cache(int max_jnum) { + if(basis_set== nullptr) { + throw std::invalid_argument("ACECTildeEvaluator: basis set is not assigned"); + } + if (R_cache.get_dim(0) < max_jnum) { + + //TODO: implement grow + R_cache.resize(max_jnum, basis_set->nradmax, basis_set->lmax + 1); + R_cache.fill(0); + + DR_cache.resize(max_jnum, basis_set->nradmax, basis_set->lmax + 1); + DR_cache.fill(0); + + DG_cache.resize(max_jnum, basis_set->nradbase); + DG_cache.fill(0); + + Y_cache.resize(max_jnum, basis_set->lmax + 1); + Y_cache.fill({0, 0}); + + DY_cache.resize(max_jnum, basis_set->lmax + 1); + DY_cache.fill({0}); + + //hard-core repulsion + DCR_cache.init(max_jnum, "DCR_cache"); + DCR_cache.fill(0); + } +} + + + +// double** r - atomic coordinates of atom I +// int* types - atomic types if atom I +// int **firstneigh - ptr to 1st J int value of each I atom. Usage: jlist = firstneigh[i]; +// Usage: j = jlist_of_i[jj]; +// jnum - number of J neighbors for each I atom. jnum = numneigh[i]; + +void +ACECTildeEvaluator::compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) { + if(basis_set== nullptr) { + throw std::invalid_argument("ACECTildeEvaluator: basis set is not assigned"); + } + per_atom_calc_timer.start(); +#ifdef PRINT_MAIN_STEPS + printf("\n ATOM: ind = %d r_norm=(%f, %f, %f)\n",i, x[i][0], x[i][1], x[i][2]); +#endif + DOUBLE_TYPE evdwl = 0, evdwl_cut = 0, rho_core = 0; + DOUBLE_TYPE r_norm; + DOUBLE_TYPE xn, yn, zn, r_xyz; + DOUBLE_TYPE R, GR, DGR, R_over_r, DR, DCR; + DOUBLE_TYPE *r_hat; + + SPECIES_TYPE mu_j; + RANK_TYPE r, rank, t; + NS_TYPE n; + LS_TYPE l; + MS_TYPE m, m_t; + + SPECIES_TYPE *mus; + NS_TYPE *ns; + LS_TYPE *ls; + MS_TYPE *ms; + + int j, jj, func_ind, ms_ind; + SHORT_INT_TYPE factor; + + ACEComplex Y{0}, Y_DR{0.}; + ACEComplex B{0.}; + ACEComplex dB{0}; + ACEComplex A_cache[basis_set->rankmax]; + + dB_flatten.fill({0.}); + + ACEDYcomponent grad_phi_nlm{0}, DY{0.}; + + //size is +1 of max to avoid out-of-boundary array access in double-triangular scheme + ACEComplex A_forward_prod[basis_set->rankmax + 1]; + ACEComplex A_backward_prod[basis_set->rankmax + 1]; + + DOUBLE_TYPE inv_r_norm; + DOUBLE_TYPE r_norms[jnum]; + DOUBLE_TYPE inv_r_norms[jnum]; + DOUBLE_TYPE rhats[jnum][3];//normalized vector + SPECIES_TYPE elements[jnum]; + const DOUBLE_TYPE xtmp = x[i][0]; + const DOUBLE_TYPE ytmp = x[i][1]; + const DOUBLE_TYPE ztmp = x[i][2]; + DOUBLE_TYPE f_ji[3]; + + bool is_element_mapping = element_type_mapping.get_size() > 0; + SPECIES_TYPE mu_i; + if (is_element_mapping) + mu_i = element_type_mapping(type[i]); + else + mu_i = type[i]; + + const SHORT_INT_TYPE total_basis_size_rank1 = basis_set->total_basis_size_rank1[mu_i]; + const SHORT_INT_TYPE total_basis_size = basis_set->total_basis_size[mu_i]; + + ACECTildeBasisFunction *basis_rank1 = basis_set->basis_rank1[mu_i]; + ACECTildeBasisFunction *basis = basis_set->basis[mu_i]; + + DOUBLE_TYPE rho_cut, drho_cut, fcut, dfcut; + DOUBLE_TYPE dF_drho_core; + + //TODO: lmax -> lmaxi (get per-species type) + const LS_TYPE lmaxi = basis_set->lmax; + + //TODO: nradmax -> nradiali (get per-species type) + const NS_TYPE nradiali = basis_set->nradmax; + + //TODO: nradbase -> nradbasei (get per-species type) + const NS_TYPE nradbasei = basis_set->nradbase; + + //TODO: get per-species type number of densities + const DENSITY_TYPE ndensity= basis_set->ndensitymax; + + neighbours_forces.resize(jnum, 3); + neighbours_forces.fill(0); + + //TODO: shift nullifications to place where arrays are used + weights.fill({0}); + weights_rank1.fill(0); + A.fill({0}); + A_rank1.fill(0); + rhos.fill(0); + dF_drho.fill(0); + +#ifdef EXTRA_C_PROJECTIONS + basis_projections_rank1.init(total_basis_size_rank1, ndensity, "c_projections_rank1"); + basis_projections.init(total_basis_size, ndensity, "c_projections"); +#endif + + //proxy references to spherical harmonics and radial functions arrays + const Array2DLM &ylm = basis_set->spherical_harmonics.ylm; + const Array2DLM &dylm = basis_set->spherical_harmonics.dylm; + + const Array2D &fr = basis_set->radial_functions->fr; + const Array2D &dfr = basis_set->radial_functions->dfr; + + const Array1D &gr = basis_set->radial_functions->gr; + const Array1D &dgr = basis_set->radial_functions->dgr; + + loop_over_neighbour_timer.start(); + + int jj_actual = 0; + SPECIES_TYPE type_j = 0; + int neighbour_index_mapping[jnum]; // jj_actual -> jj + //loop over neighbours, compute distance, consider only atoms within with rradial_functions->cut(mu_i, mu_j); + r_xyz = sqrt(xn * xn + yn * yn + zn * zn); + + if (r_xyz >= current_cutoff) + continue; + + inv_r_norm = 1 / r_xyz; + + r_norms[jj_actual] = r_xyz; + inv_r_norms[jj_actual] = inv_r_norm; + rhats[jj_actual][0] = xn * inv_r_norm; + rhats[jj_actual][1] = yn * inv_r_norm; + rhats[jj_actual][2] = zn * inv_r_norm; + elements[jj_actual] = mu_j; + neighbour_index_mapping[jj_actual] = jj; + jj_actual++; + } + + int jnum_actual = jj_actual; + + //ALGORITHM 1: Atomic base A + for (jj = 0; jj < jnum_actual; ++jj) { + r_norm = r_norms[jj]; + mu_j = elements[jj]; + r_hat = rhats[jj]; + + //proxies + Array2DLM &Y_jj = Y_cache(jj); + Array2DLM &DY_jj = DY_cache(jj); + + + basis_set->radial_functions->evaluate(r_norm, basis_set->nradbase, nradiali, mu_i, mu_j); + basis_set->spherical_harmonics.compute_ylm(r_hat[0], r_hat[1], r_hat[2], lmaxi); + //loop for computing A's + //rank = 1 + for (n = 0; n < basis_set->nradbase; n++) { + GR = gr(n); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("-neigh atom %d\n", jj); + printf("gr(n=%d)(r=%f) = %f\n", n, r_norm, gr(n)); + printf("dgr(n=%d)(r=%f) = %f\n", n, r_norm, dgr(n)); +#endif + DG_cache(jj, n) = dgr(n); + A_rank1(mu_j, n) += GR * Y00; + } + //loop for computing A's + // for rank > 1 + for (n = 0; n < nradiali; n++) { + auto &A_lm = A(mu_j, n); + for (l = 0; l <= lmaxi; l++) { + R = fr(n, l); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("R(nl=%d,%d)(r=%f)=%f\n", n + 1, l, r_norm, R); +#endif + + DR_cache(jj, n, l) = dfr(n, l); + R_cache(jj, n, l) = R; + + for (m = 0; m <= l; m++) { + Y = ylm(l, m); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("Y(lm=%d,%d)=(%f, %f)\n", l, m, Y.real, Y.img); +#endif + A_lm(l, m) += R * Y; //accumulation sum over neighbours + Y_jj(l, m) = Y; + DY_jj(l, m) = dylm(l, m); + } + } + } + + //hard-core repulsion + rho_core += basis_set->radial_functions->cr; + DCR_cache(jj) = basis_set->radial_functions->dcr; + + } //end loop over neighbours + + //complex conjugate A's (for NEGATIVE (-m) terms) + // for rank > 1 + for (mu_j = 0; mu_j < basis_set->nelements; mu_j++) { + for (n = 0; n < nradiali; n++) { + auto &A_lm = A(mu_j, n); + for (l = 0; l <= lmaxi; l++) { + //fill in -m part in the outer loop using the same m <-> -m symmetry as for Ylm + for (m = 1; m <= l; m++) { + factor = m % 2 == 0 ? 1 : -1; + A_lm(l, -m) = A_lm(l, m).conjugated() * factor; + } + } + } + } //now A's are constructed + loop_over_neighbour_timer.stop(); + + // ==================== ENERGY ==================== + + energy_calc_timer.start(); +#ifdef EXTRA_C_PROJECTIONS + basis_projections_rank1.fill(0); + basis_projections.fill(0); +#endif + + //ALGORITHM 2: Basis functions B with iterative product and density rho(p) calculation + //rank=1 + for (int func_rank1_ind = 0; func_rank1_ind < total_basis_size_rank1; ++func_rank1_ind) { + ACECTildeBasisFunction *func = &basis_rank1[func_rank1_ind]; +// ndensity = func->ndensity; +#ifdef PRINT_LOOPS_INDICES + printf("Num density = %d r = 0\n",(int) ndensity ); + print_C_tilde_B_basis_function(*func); +#endif + double A_cur = A_rank1(func->mus[0], func->ns[0] - 1); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("A_r=1(x=%d, n=%d)=(%f)\n", func->mus[0], func->ns[0], A_cur); + printf(" coeff[0] = %f\n", func->ctildes[0]); +#endif + for (DENSITY_TYPE p = 0; p < ndensity; ++p) { + //for rank=1 (r=0) only 1 ms-combination exists (ms_ind=0), so index of func.ctildes is 0..ndensity-1 + rhos(p) += func->ctildes[p] * A_cur; +#ifdef EXTRA_C_PROJECTIONS + //aggregate C-projections separately + basis_projections_rank1(func_rank1_ind, p)+= func->ctildes[p] * A_cur; +#endif + } + } // end loop for rank=1 + + //rank>1 + int func_ms_ind = 0; + int func_ms_t_ind = 0;// index for dB + + for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { + ACECTildeBasisFunction *func = &basis[func_ind]; + //TODO: check if func->ctildes are zero, then skip +// ndensity = func->ndensity; + rank = func->rank; + r = rank - 1; +#ifdef PRINT_LOOPS_INDICES + printf("Num density = %d r = %d\n",(int) ndensity, (int)r ); + print_C_tilde_B_basis_function(*func); +#endif + mus = func->mus; + ns = func->ns; + ls = func->ls; + + //loop over {ms} combinations in sum + for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { + ms = &func->ms_combs[ms_ind * rank]; // current ms-combination (of length = rank) + + //loop over m, collect B = product of A with given ms + A_forward_prod[0] = 1; + A_backward_prod[r] = 1; + + //fill forward A-product triangle + for (t = 0; t < rank; t++) { + //TODO: optimize ns[t]-1 -> ns[t] during functions construction + A_cache[t] = A(mus[t], ns[t] - 1, ls[t], ms[t]); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("A(x=%d, n=%d, l=%d, m=%d)=(%f,%f)\n", mus[t], ns[t], ls[t], ms[t], A_cache[t].real, + A_cache[t].img); +#endif + A_forward_prod[t + 1] = A_forward_prod[t] * A_cache[t]; + } + + B = A_forward_prod[t]; + +#ifdef DEBUG_FORCES_CALCULATIONS + printf("B = (%f, %f)\n", (B).real, (B).img); +#endif + //fill backward A-product triangle + for (t = r; t >= 1; t--) { + A_backward_prod[t - 1] = + A_backward_prod[t] * A_cache[t]; + } + + for (t = 0; t < rank; ++t, ++func_ms_t_ind) { + dB = A_forward_prod[t] * A_backward_prod[t]; //dB - product of all A's except t-th + dB_flatten(func_ms_t_ind) = dB; +#ifdef DEBUG_FORCES_CALCULATIONS + m_t = ms[t]; + printf("dB(n,l,m)(%d,%d,%d) = (%f, %f)\n", ns[t], ls[t], m_t, (dB).real, (dB).img); +#endif + } + + for (DENSITY_TYPE p = 0; p < ndensity; ++p) { + //real-part only multiplication + rhos(p) += B.real_part_product(func->ctildes[ms_ind * ndensity + p]); + +#ifdef EXTRA_C_PROJECTIONS + //aggregate C-projections separately + basis_projections(func_ind, p)+=B.real_part_product(func->ctildes[ms_ind * ndensity + p]); +#endif + +#ifdef PRINT_INTERMEDIATE_VALUES + printf("rhos(%d) += %f\n", p, B.real_part_product(func->ctildes[ms_ind * ndensity + p])); + printf("Rho[i = %d][p = %d] = %f\n", i , p , rhos(p)); +#endif + } + }//end of loop over {ms} combinations in sum + }// end loop for rank>1 + +#ifdef DEBUG_FORCES_CALCULATIONS + printf("rhos = "); + for(DENSITY_TYPE p =0; prho_core_cutoffs(mu_i); + drho_cut = basis_set->drho_core_cutoffs(mu_i); + + basis_set->inner_cutoff(rho_core, rho_cut, drho_cut, fcut, dfcut); + basis_set->FS_values_and_derivatives(rhos, evdwl, dF_drho, ndensity); + + dF_drho_core = evdwl * dfcut + 1; + for (DENSITY_TYPE p = 0; p < ndensity; ++p) + dF_drho(p) *= fcut; + evdwl_cut = evdwl * fcut + rho_core; + + // E0 shift + evdwl_cut += basis_set->E0vals(mu_i); + +#ifdef DEBUG_FORCES_CALCULATIONS + printf("dFrhos = "); + for(DENSITY_TYPE p =0; pndensity; + for (DENSITY_TYPE p = 0; p < ndensity; ++p) { + //for rank=1 (r=0) only 1 ms-combination exists (ms_ind=0), so index of func.ctildes is 0..ndensity-1 + weights_rank1(func->mus[0], func->ns[0] - 1) += dF_drho(p) * func->ctildes[p]; + } + } + + // rank>1 + func_ms_ind = 0; + func_ms_t_ind = 0;// index for dB + DOUBLE_TYPE theta = 0; + for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { + ACECTildeBasisFunction *func = &basis[func_ind]; +// ndensity = func->ndensity; + rank = func->rank; + mus = func->mus; + ns = func->ns; + ls = func->ls; + for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { + ms = &func->ms_combs[ms_ind * rank]; + theta = 0; + for (DENSITY_TYPE p = 0; p < ndensity; ++p) { + theta += dF_drho(p) * func->ctildes[ms_ind * ndensity + p]; +#ifdef DEBUG_FORCES_CALCULATIONS + printf("(p=%d) theta += dF_drho[p] * func.ctildes[ms_ind * ndensity + p] = %f * %f = %f\n",p, dF_drho(p), func->ctildes[ms_ind * ndensity + p],dF_drho(p)*func->ctildes[ms_ind * ndensity + p]); + printf("theta=%f\n",theta); +#endif + } + + theta *= 0.5; // 0.5 factor due to possible double counting ??? + for (t = 0; t < rank; ++t, ++func_ms_t_ind) { + m_t = ms[t]; + factor = (m_t % 2 == 0 ? 1 : -1); + dB = dB_flatten(func_ms_t_ind); + weights(mus[t], ns[t] - 1, ls[t], m_t) += theta * dB; //Theta_array(func_ms_ind); + // update -m_t (that could also be positive), because the basis is half_basis + weights(mus[t], ns[t] - 1, ls[t], -m_t) += + theta * (dB).conjugated() * factor;// Theta_array(func_ms_ind); +#ifdef DEBUG_FORCES_CALCULATIONS + printf("dB(n,l,m)(%d,%d,%d) = (%f, %f)\n", ns[t], ls[t], m_t, (dB).real, (dB).img); + printf("theta = %f\n",theta); + printf("weights(n,l,m)(%d,%d,%d) += (%f, %f)\n", ns[t], ls[t], m_t, (theta * dB * 0.5).real, + (theta * dB * 0.5).img); + printf("weights(n,l,-m)(%d,%d,%d) += (%f, %f)\n", ns[t], ls[t], -m_t, + ( theta * (dB).conjugated() * factor * 0.5).real, + ( theta * (dB).conjugated() * factor * 0.5).img); +#endif + } + } + } + energy_calc_timer.stop(); + +// ==================== FORCES ==================== +#ifdef PRINT_MAIN_STEPS + printf("\nFORCE CALCULATION\n"); + printf("loop over neighbours\n"); +#endif + + forces_calc_loop_timer.start(); +// loop over neighbour atoms for force calculations + for (jj = 0; jj < jnum_actual; ++jj) { + mu_j = elements[jj]; + r_hat = rhats[jj]; + inv_r_norm = inv_r_norms[jj]; + + Array2DLM &Y_cache_jj = Y_cache(jj); + Array2DLM &DY_cache_jj = DY_cache(jj); + +#ifdef PRINT_LOOPS_INDICES + printf("\nneighbour atom #%d\n", jj); + printf("rhat = (%f, %f, %f)\n", r_hat[0], r_hat[1], r_hat[2]); +#endif + + forces_calc_neighbour_timer.start(); + + f_ji[0] = f_ji[1] = f_ji[2] = 0; + +//for rank = 1 + for (n = 0; n < nradbasei; ++n) { + if (weights_rank1(mu_j, n) == 0) + continue; + auto &DG = DG_cache(jj, n); + DGR = DG * Y00; + DGR *= weights_rank1(mu_j, n); +#ifdef DEBUG_FORCES_CALCULATIONS + printf("r=1: (n,l,m)=(%d, 0, 0)\n",n+1); + printf("\tGR(n=%d, r=%f)=%f\n",n+1,r_norm, gr(n)); + printf("\tDGR(n=%d, r=%f)=%f\n",n+1,r_norm, dgr(n)); + printf("\tdF+=(%f, %f, %f)\n",DGR * r_hat[0], DGR * r_hat[1], DGR * r_hat[2]); +#endif + f_ji[0] += DGR * r_hat[0]; + f_ji[1] += DGR * r_hat[1]; + f_ji[2] += DGR * r_hat[2]; + } + +//for rank > 1 + for (n = 0; n < nradiali; n++) { + for (l = 0; l <= lmaxi; l++) { + R_over_r = R_cache(jj, n, l) * inv_r_norm; + DR = DR_cache(jj, n, l); + + // for m>=0 + for (m = 0; m <= l; m++) { + ACEComplex w = weights(mu_j, n, l, m); + if (w == 0) + continue; + //counting for -m cases if m>0 + if (m > 0) w *= 2; + + DY = DY_cache_jj(l, m); + Y_DR = Y_cache_jj(l, m) * DR; + + grad_phi_nlm.a[0] = Y_DR * r_hat[0] + DY.a[0] * R_over_r; + grad_phi_nlm.a[1] = Y_DR * r_hat[1] + DY.a[1] * R_over_r; + grad_phi_nlm.a[2] = Y_DR * r_hat[2] + DY.a[2] * R_over_r; +#ifdef DEBUG_FORCES_CALCULATIONS + printf("d_phi(n=%d, l=%d, m=%d) = ((%f,%f), (%f,%f), (%f,%f))\n",n+1,l,m, + grad_phi_nlm.a[0].real, grad_phi_nlm.a[0].img, + grad_phi_nlm.a[1].real, grad_phi_nlm.a[1].img, + grad_phi_nlm.a[2].real, grad_phi_nlm.a[2].img); + + printf("weights(n,l,m)(%d,%d,%d) = (%f,%f)\n", n+1, l, m,w.real, w.img); + //if (m>0) w*=2; + printf("dF(n,l,m)(%d, %d, %d) += (%f, %f, %f)\n", n + 1, l, m, + w.real_part_product(grad_phi_nlm.a[0]), + w.real_part_product(grad_phi_nlm.a[1]), + w.real_part_product(grad_phi_nlm.a[2]) + ); +#endif +// real-part multiplication only + f_ji[0] += w.real_part_product(grad_phi_nlm.a[0]); + f_ji[1] += w.real_part_product(grad_phi_nlm.a[1]); + f_ji[2] += w.real_part_product(grad_phi_nlm.a[2]); + } + } + } + + +#ifdef PRINT_INTERMEDIATE_VALUES + printf("f_ji(jj=%d, i=%d)=(%f, %f, %f)\n", jj, i, + f_ji[0], f_ji[1], f_ji[2] + ); +#endif + + //hard-core repulsion + DCR = DCR_cache(jj); +#ifdef DEBUG_FORCES_CALCULATIONS + printf("DCR = %f\n",DCR); +#endif + f_ji[0] += dF_drho_core * DCR * r_hat[0]; + f_ji[1] += dF_drho_core * DCR * r_hat[1]; + f_ji[2] += dF_drho_core * DCR * r_hat[2]; +#ifdef PRINT_INTERMEDIATE_VALUES + printf("with core-repulsion\n"); + printf("f_ji(jj=%d, i=%d)=(%f, %f, %f)\n", jj, i, + f_ji[0], f_ji[1], f_ji[2] + ); + printf("neighbour_index_mapping[jj=%d]=%d\n",jj,neighbour_index_mapping[jj]); +#endif + + neighbours_forces(neighbour_index_mapping[jj], 0) = f_ji[0]; + neighbours_forces(neighbour_index_mapping[jj], 1) = f_ji[1]; + neighbours_forces(neighbour_index_mapping[jj], 2) = f_ji[2]; + + forces_calc_neighbour_timer.stop(); + }// end loop over neighbour atoms for forces + + forces_calc_loop_timer.stop(); + + //now, energies and forces are ready + //energies(i) = evdwl + rho_core; + e_atom = evdwl_cut; + +#ifdef PRINT_INTERMEDIATE_VALUES + printf("energies(i) = FS(...rho_p_accum...) = %f\n", evdwl); +#endif + per_atom_calc_timer.stop(); +} \ No newline at end of file diff --git a/lib/pace/ace_evaluator.h b/lib/pace/ace_evaluator.h new file mode 100644 index 0000000000..356ea52563 --- /dev/null +++ b/lib/pace/ace_evaluator.h @@ -0,0 +1,230 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Yury Lysogorskiy on 31.01.20. + +#ifndef ACE_EVALUATOR_H +#define ACE_EVALUATOR_H + +#include "ace_abstract_basis.h" +#include "ace_arraynd.h" +#include "ace_array2dlm.h" +#include "ace_c_basis.h" +#include "ace_complex.h" +#include "ace_timing.h" +#include "ace_types.h" + +/** + * Basic evaluator class, that should accept the basis set and implement the "compute_atom" method using given basis set. + */ +class ACEEvaluator { +protected: + + Array2D A_rank1 = Array2D("A_rank1"); ///< 2D-array for storing A's for rank=1, shape: A(mu_j,n) + Array4DLM A = Array4DLM("A"); ///< 4D array with (l,m) last indices for storing A's for rank>1: A(mu_j, n, l, m) + + Array1D rhos = Array1D("rhos"); ///< densities \f$ \rho^{(p)} \f$(ndensity), p = 0 .. ndensity-1 + Array1D dF_drho = Array1D("dF_drho"); ///< derivatives of cluster functional wrt. densities, index = 0 .. ndensity-1 + + /** + * Initialize internal arrays according to basis set sizes + * @param basis_set + */ + void init(ACEAbstractBasisSet *basis_set); + +public: + // set of timers for code profiling + + ACETimer loop_over_neighbour_timer; ///< timer for loop over neighbours when constructing A's for single central atom + ACETimer per_atom_calc_timer; ///< timer for single compute_atom call + + + ACETimer forces_calc_loop_timer; ///< timer for forces calculations for single central atom + ACETimer forces_calc_neighbour_timer; ///< timer for loop over neighbour atoms for force calculations + + ACETimer energy_calc_timer; ///< timer for energy calculation + ACETimer total_time_calc_timer; ///< timer for total calculations of all atoms within given atomic environment system + + /** + * Initialize all timers + */ + void init_timers(); + + /** + * Mapping from external atoms types, i.e. LAMMPS, to internal SPECIES_TYPE, used in basis functions + */ + Array1D element_type_mapping = Array1D("element_type_mapping"); + + + DOUBLE_TYPE e_atom = 0; ///< energy of current atom, including core-repulsion + + /** + * temporary array for the pair forces between current atom_i and its neighbours atom_k + * neighbours_forces(k,3), k = 0..num_of_neighbours(atom_i)-1 + */ + Array2D neighbours_forces = Array2D("neighbours_forces"); + + ACEEvaluator() = default; + + virtual ~ACEEvaluator() = default; + + /** + * The key method to compute energy and forces for atom 'i'. + * Method will update the "e_atom" variable and "neighbours_forces(jj, alpha)" array + * + * @param i atom index + * @param x atomic positions array of the real and ghost atoms, shape: [atom_ind][3] + * @param type atomic types array of the real and ghost atoms, shape: [atom_ind] + * @param jnum number of neighbours of atom_i + * @param jlist array of neighbour indices, shape: [jnum] + */ + virtual void compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) = 0; + + /** + * Resize all caches over neighbours atoms + * @param max_jnum maximum number of neighbours + */ + virtual void resize_neighbours_cache(int max_jnum) = 0; + +#ifdef EXTRA_C_PROJECTIONS + /** + * 2D array to store projections of basis function for rank = 1, shape: [func_ind][ndensity] + */ + Array2D basis_projections_rank1 = Array2D("basis_projections_rank1"); + + /** + * 2D array to store projections of basis function for rank > 1, shape: [func_ind][ndensity] + */ + Array2D basis_projections = Array2D("basis_projections"); +#endif +}; + +//TODO: split into separate file +/** + * Evaluator for C-tilde basis set, that should accept the basis set and implement the "compute_atom" method using given basis set. + */ +class ACECTildeEvaluator : public ACEEvaluator { + + /** + * Weights \f$ \omega_{i \mu n 0 0} \f$ for rank = 1, see Eq.(10) from implementation notes, + * 'i' is fixed for the current atom, shape: [nelements][nradbase] + */ + Array2D weights_rank1 = Array2D("weights_rank1"); + + /** + * Weights \f$ \omega_{i \mu n l m} \f$ for rank > 1, see Eq.(10) from implementation notes, + * 'i' is fixed for the current atom, shape: [nelements][nradbase][l=0..lmax, m] + */ + Array4DLM weights = Array4DLM("weights"); + + /** + * cache for gradients of \f$ g(r)\f$: grad_phi(jj,n)=A2DLM(l,m) + * shape:[max_jnum][nradbase] + */ + Array2D DG_cache = Array2D("DG_cache"); + + + /** + * cache for \f$ R_{nl}(r)\f$ + * shape:[max_jnum][nradbase][0..lmax] + */ + Array3D R_cache = Array3D("R_cache"); + /** + * cache for derivatives of \f$ R_{nl}(r)\f$ + * shape:[max_jnum][nradbase][0..lmax] + */ + Array3D DR_cache = Array3D("DR_cache"); + /** + * cache for \f$ Y_{lm}(\hat{r})\f$ + * shape:[max_jnum][0..lmax][m] + */ + Array3DLM Y_cache = Array3DLM("Y_cache"); + /** + * cache for \f$ \nabla Y_{lm}(\hat{r})\f$ + * shape:[max_jnum][0..lmax][m] + */ + Array3DLM DY_cache = Array3DLM("dY_dense_cache"); + + /** + * cache for derivatives of hard-core repulsion + * shape:[max_jnum] + */ + Array1D DCR_cache = Array1D("DCR_cache"); + + /** + * Partial derivatives \f$ dB_{i \mu n l m t}^{(r)} \f$ with sequential numbering over [func_ind][ms_ind][r], + * shape:[func_ms_r_ind] + */ + Array1D dB_flatten = Array1D("dB_flatten"); + + /** + * pointer to the ACEBasisSet object + */ + ACECTildeBasisSet *basis_set = nullptr; + + /** + * Initialize internal arrays according to basis set sizes + * @param basis_set + */ + void init(ACECTildeBasisSet *basis_set); + +public: + + ACECTildeEvaluator() = default; + + explicit ACECTildeEvaluator(ACECTildeBasisSet &bas) { + set_basis(bas); + } + + /** + * set the basis function to the ACE evaluator + * @param bas + */ + void set_basis(ACECTildeBasisSet &bas); + + /** + * The key method to compute energy and forces for atom 'i'. + * Method will update the "e_atom" variable and "neighbours_forces(jj, alpha)" array + * + * @param i atom index + * @param x atomic positions array of the real and ghost atoms, shape: [atom_ind][3] + * @param type atomic types array of the real and ghost atoms, shape: [atom_ind] + * @param jnum number of neighbours of atom_i + * @param jlist array of neighbour indices, shape: [jnum] + */ + void compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) override; + + /** + * Resize all caches over neighbours atoms + * @param max_jnum maximum number of neighbours + */ + void resize_neighbours_cache(int max_jnum) override; +}; + + +#endif //ACE_EVALUATOR_H \ No newline at end of file diff --git a/lib/pace/ace_flatten_basis.cpp b/lib/pace/ace_flatten_basis.cpp new file mode 100644 index 0000000000..541785a202 --- /dev/null +++ b/lib/pace/ace_flatten_basis.cpp @@ -0,0 +1,130 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by yury on 28.04.2020. + +#include "ace_flatten_basis.h" + +ACEFlattenBasisSet::ACEFlattenBasisSet(const ACEFlattenBasisSet &other) { + _copy_scalar_memory(other); + _copy_dynamic_memory(other); +} + +ACEFlattenBasisSet &ACEFlattenBasisSet::operator=(const ACEFlattenBasisSet &other) { + if (this != &other) { + _clean(); + _copy_scalar_memory(other); + _copy_dynamic_memory(other); + } + return *this; +} + + +ACEFlattenBasisSet::~ACEFlattenBasisSet() { + ACEFlattenBasisSet::_clean(); +} + +void ACEFlattenBasisSet::_clean() { + //chained call of base class method + ACEAbstractBasisSet::_clean(); + _clean_contiguous_arrays(); + _clean_basissize_arrays(); + +} + +void ACEFlattenBasisSet::_clean_basissize_arrays() { + delete[] total_basis_size; + total_basis_size = nullptr; + + delete[] total_basis_size_rank1; + total_basis_size_rank1 = nullptr; +} + +void ACEFlattenBasisSet::_clean_contiguous_arrays() { + delete[] full_ns_rank1; + full_ns_rank1 = nullptr; + + delete[] full_ls_rank1; + full_ls_rank1 = nullptr; + + delete[] full_mus_rank1; + full_mus_rank1 = nullptr; + + delete[] full_ms_rank1; + full_ms_rank1 = nullptr; + + ////// + + delete[] full_ns; + full_ns = nullptr; + + delete[] full_ls; + full_ls = nullptr; + + delete[] full_mus; + full_mus = nullptr; + + delete[] full_ms; + full_ms = nullptr; +} + +void ACEFlattenBasisSet::_copy_scalar_memory(const ACEFlattenBasisSet &src) { + ACEAbstractBasisSet::_copy_scalar_memory(src); + + rank_array_total_size_rank1 = src.rank_array_total_size_rank1; + coeff_array_total_size_rank1 = src.coeff_array_total_size_rank1; + rank_array_total_size = src.rank_array_total_size; + ms_array_total_size = src.ms_array_total_size; + coeff_array_total_size = src.coeff_array_total_size; + + max_B_array_size = src.max_B_array_size; + max_dB_array_size = src.max_dB_array_size; + num_ms_combinations_max = src.num_ms_combinations_max; +} + +void ACEFlattenBasisSet::_copy_dynamic_memory(const ACEFlattenBasisSet &src) { //allocate new memory + + ACEAbstractBasisSet::_copy_dynamic_memory(src); + + if (src.total_basis_size_rank1 == nullptr) + throw runtime_error("Could not copy ACEFlattenBasisSet::total_basis_size_rank1 - array not initialized"); + if (src.total_basis_size == nullptr) + throw runtime_error("Could not copy ACEFlattenBasisSet::total_basis_size - array not initialized"); + + delete[] total_basis_size_rank1; + total_basis_size_rank1 = new SHORT_INT_TYPE[nelements]; + delete[] total_basis_size; + total_basis_size = new SHORT_INT_TYPE[nelements]; + + //copy + for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { + total_basis_size_rank1[mu] = src.total_basis_size_rank1[mu]; + total_basis_size[mu] = src.total_basis_size[mu]; + } +} + diff --git a/lib/pace/ace_flatten_basis.h b/lib/pace/ace_flatten_basis.h new file mode 100644 index 0000000000..e21cbb749a --- /dev/null +++ b/lib/pace/ace_flatten_basis.h @@ -0,0 +1,135 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Lysogroskiy Yury on 28.04.2020. + +#ifndef ACE_EVALUATOR_ACE_FLATTEN_BASIS_H +#define ACE_EVALUATOR_ACE_FLATTEN_BASIS_H + + +#include "ace_abstract_basis.h" +#include "ace_c_basisfunction.h" +#include "ace_radial.h" +#include "ace_spherical_cart.h" +#include "ace_types.h" + +/** + * Basis set with basis function attributes, i.e. \f$ \mathbf{n}, \mathbf{l}, \mathbf{m}\f$, etc. + * packed into contiguous arrays for the cache-friendly memory layout. + */ +class ACEFlattenBasisSet : public ACEAbstractBasisSet { +public: + //arrays and its sizes for rank = 1 basis functions for packed basis + + size_t rank_array_total_size_rank1 = 0; ///< size for full_ns_rank1, full_ls_rank1, full_Xs_rank1 + size_t coeff_array_total_size_rank1 = 0; ///< size for full coefficients array (depends on B or C-Tilde basis) + + NS_TYPE *full_ns_rank1 = nullptr; ///< ns contiguous package [rank_array_total_size_rank1] + LS_TYPE *full_ls_rank1 = nullptr; ///< ls contiguous package [rank_array_total_size_rank1] + SPECIES_TYPE *full_mus_rank1 = nullptr; ///< mus contiguous package [rank_array_total_size_rank1] + MS_TYPE *full_ms_rank1 = nullptr; ///< m_s contiguous package[rank_array_total_size_rank1] + + //arrays and its sizes for rank > 1 basis functions for packed basis + size_t rank_array_total_size = 0; ///< size for full_ns, full_ls, full_Xs + size_t ms_array_total_size = 0; ///< size for full_ms array + size_t coeff_array_total_size = 0;///< size for full coefficients arrays (depends on B- or C- basis) + + NS_TYPE *full_ns = nullptr; ///< ns contiguous package [rank_array_total_size] + LS_TYPE *full_ls = nullptr; ///< ls contiguous package [rank_array_total_size] + SPECIES_TYPE *full_mus = nullptr; ///< mus contiguous package [rank_array_total_size] + MS_TYPE *full_ms = nullptr; ///< //m_s contiguous package [ms_array_total_size] + + /** + * Rearrange basis functions in contiguous memory to optimize cache access + */ + virtual void pack_flatten_basis() = 0; + + virtual void flatten_basis() = 0; + + //1D flat array basis representation: [mu] + SHORT_INT_TYPE *total_basis_size_rank1 = nullptr; ///< per-species type array of total_basis_rank1[mu] sizes + SHORT_INT_TYPE *total_basis_size = nullptr; ///< per-species type array of total_basis[mu] sizes + + size_t max_B_array_size = 0; ///< maximum over elements array size for B[func_ind][ms_ind] + size_t max_dB_array_size = 0; ///< maximum over elements array size for dB[func_ind][ms_ind][r] + + SHORT_INT_TYPE num_ms_combinations_max = 0; ///< maximum number of ms combinations among all basis functions + + /** + * Default constructor + */ + ACEFlattenBasisSet() = default; + + /** + * Copy constructor (see Rule of Three) + * @param other + */ + ACEFlattenBasisSet(const ACEFlattenBasisSet &other); + + /** + * operator= (see Rule of Three) + * @param other + * @return + */ + ACEFlattenBasisSet &operator=(const ACEFlattenBasisSet &other); + + /** + * Destructor (see Rule of Three) + */ + ~ACEFlattenBasisSet() override; + + // routines for copying and cleaning dynamic memory of the class (see Rule of Three) + /** + * Cleaning dynamic memory of the class (see. Rule of Three), + * must be idempotent for safety + */ + void _clean() override; + + /** + * Copying scalar variables + * @param src + */ + void _copy_scalar_memory(const ACEFlattenBasisSet &src); + + /** + * Copying and cleaning dynamic memory of the class (see. Rule of Three) + * @param src + */ + void _copy_dynamic_memory(const ACEFlattenBasisSet &src); + + /** + * Clean contiguous arrays + */ + virtual void _clean_contiguous_arrays(); + + /** + * Release dynamic arrays with basis set sizes + */ + void _clean_basissize_arrays(); +}; + +#endif //ACE_EVALUATOR_ACE_FLATTEN_BASIS_H diff --git a/lib/pace/ace_radial.cpp b/lib/pace/ace_radial.cpp new file mode 100644 index 0000000000..01348a719c --- /dev/null +++ b/lib/pace/ace_radial.cpp @@ -0,0 +1,566 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include +#include +#include + +#include "ace_radial.h" + +const DOUBLE_TYPE pi = 3.14159265358979323846264338327950288419; // pi + +ACERadialFunctions::ACERadialFunctions(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, + SPECIES_TYPE nelements, + DOUBLE_TYPE cutoff, string radbasename) { + init(nradb, lmax, nradial, deltaSplineBins, nelements, cutoff, radbasename); +} + +void ACERadialFunctions::init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, + SPECIES_TYPE nelements, + DOUBLE_TYPE cutoff, string radbasename) { + this->nradbase = nradb; + this->lmax = lmax; + this->nradial = nradial; + this->deltaSplineBins = deltaSplineBins; + this->nelements = nelements; + this->cutoff = cutoff; + this->radbasename = radbasename; + + gr.init(nradbase, "gr"); + dgr.init(nradbase, "dgr"); + d2gr.init(nradbase, "d2gr"); + + + fr.init(nradial, lmax + 1, "fr"); + dfr.init(nradial, lmax + 1, "dfr"); + d2fr.init(nradial, lmax + 1, "d2fr"); + + + cheb.init(nradbase + 1, "cheb"); + dcheb.init(nradbase + 1, "dcheb"); + cheb2.init(nradbase + 1, "cheb2"); + + + splines_gk.init(nelements, nelements, "splines_gk"); + splines_rnl.init(nelements, nelements, "splines_rnl"); + splines_hc.init(nelements, nelements, "splines_hc"); + + lambda.init(nelements, nelements, "lambda"); + lambda.fill(1.); + + cut.init(nelements, nelements, "cut"); + cut.fill(1.); + + dcut.init(nelements, nelements, "dcut"); + dcut.fill(1.); + + crad.init(nelements, nelements, nradial, (lmax + 1), nradbase, "crad"); + crad.fill(0.); + + //hard-core repulsion + prehc.init(nelements, nelements, "prehc"); + prehc.fill(0.); + + lambdahc.init(nelements, nelements, "lambdahc"); + lambdahc.fill(1.); + +} + + +/** +Function that computes Chebyshev polynomials of first and second kind + to setup the radial functions and the derivatives + +@param n, x + +@returns cheb1, dcheb1 +*/ +void ACERadialFunctions::calcCheb(NS_TYPE n, DOUBLE_TYPE x) { + if (n < 0) { + char s[1024]; + sprintf(s, "The order n of the polynomials should be positive %d\n", n); + throw std::invalid_argument(s); + } + DOUBLE_TYPE twox = 2.0 * x; + cheb(0) = 1.; + dcheb(0) = 0.; + cheb2(0) = 1.; + + if (nradbase > 1) { + cheb(1) = x; + cheb2(1) = twox; + } + for (NS_TYPE m = 1; m <= n - 1; m++) { + cheb(m + 1) = twox * cheb(m) - cheb(m - 1); + cheb2(m + 1) = twox * cheb2(m) - cheb2(m - 1); + } + for (NS_TYPE m = 1; m <= n; m++) { + dcheb(m) = m * cheb2(m - 1); + } +#ifdef DEBUG_RADIAL + for ( NS_TYPE m=0; m<=n; m++ ) { + printf(" m %d cheb %f dcheb %f \n", m, cheb(m), dcheb(m)); + } +#endif +} + +/** +Function that computes radial basis. + +@param lam, nradbase, cut, dcut, r + +@returns gr, dgr +*/ +void ACERadialFunctions::radbase(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r) { + /*lam is given by the formula (24), that contains cut */ + + if (r < cut) { + if (radbasename == "ChebExpCos") { + chebExpCos(lam, cut, dcut, r); + } else if (radbasename == "ChebPow") { + chebPow(lam, cut, dcut, r); + } else if (radbasename == "ChebLinear") { + chebLinear(lam, cut, dcut, r); + } else { + throw invalid_argument("Unknown radial basis function name: " + radbasename); + } + } else { + gr.fill(0); + dgr.fill(0); + } +} + +/*** + * Radial function: ChebExpCos, cheb exp scaling including cos envelope + * @param lam function parameter + * @param cut cutoff distance + * @param r function input argument + * @return fills in gr and dgr arrays + */ +void +ACERadialFunctions::chebExpCos(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r) { + DOUBLE_TYPE y2, y1, x, dx; + DOUBLE_TYPE env, denv, fcut, dfcut; + /* scaled distance x and derivative*/ + y1 = exp(-lam * r / cut); + y2 = exp(-lam); + x = 1.0 - 2.0 * ((y1 - y2) / (1 - y2)); + dx = 2 * (lam / cut) * (y1 / (1 - y2)); + /* calculation of Chebyshev polynomials from the recursion */ + calcCheb(nradbase - 1, x); + gr(0) = cheb(0); + dgr(0) = dcheb(0) * dx; + for (NS_TYPE n = 2; n <= nradbase; n++) { + gr(n - 1) = 0.5 - 0.5 * cheb(n - 1); + dgr(n - 1) = -0.5 * dcheb(n - 1) * dx; + } + env = 0.5 * (1.0 + cos(M_PI * r / cut)); + denv = -0.5 * sin(M_PI * r / cut) * M_PI / cut; + for (NS_TYPE n = 0; n < nradbase; n++) { + dgr(n) = gr(n) * denv + dgr(n) * env; + gr(n) = gr(n) * env; + } + // for radtype = 3 a smooth cut is already included in the basis function + dx = cut - dcut; + if (r > dx) { + fcut = 0.5 * (1.0 + cos(M_PI * (r - dx) / dcut)); + dfcut = -0.5 * sin(M_PI * (r - dx) / dcut) * M_PI / dcut; + for (NS_TYPE n = 0; n < nradbase; n++) { + dgr(n) = gr(n) * dfcut + dgr(n) * fcut; + gr(n) = gr(n) * fcut; + } + } +} + +/*** +* Radial function: ChebPow, Radial function: ChebPow +* - argument of Chebyshev polynomials +* x = 2.0*( 1.0 - (1.0 - r/rcut)^lam ) - 1.0 +* - radial function +* gr(n) = ( 1.0 - Cheb(n) )/2.0, n = 1,...,nradbase +* - the function fulfills: +* gr(n) = 0 at rcut +* dgr(n) = 0 at rcut for lam >= 1 +* second derivative zero at rcut for lam >= 2 +* -> the radial function does not require a separate cutoff function +* - corresponds to radial basis radtype=5 in Fortran code +* +* @param lam function parameter +* @param cut cutoff distance +* @param r function input argument +* @return fills in gr and dgr arrays +*/ +void +ACERadialFunctions::chebPow(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r) { + DOUBLE_TYPE y, dy, x, dx; + /* scaled distance x and derivative*/ + y = (1.0 - r / cut); + dy = pow(y, (lam - 1.0)); + y = dy * y; + dy = -lam / cut * dy; + + x = 2.0 * (1.0 - y) - 1.0; + dx = -2.0 * dy; + calcCheb(nradbase, x); + for (NS_TYPE n = 1; n <= nradbase; n++) { + gr(n - 1) = 0.5 - 0.5 * cheb(n); + dgr(n - 1) = -0.5 * dcheb(n) * dx; + } +} + + +void +ACERadialFunctions::chebLinear(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r) { + DOUBLE_TYPE x, dx; + /* scaled distance x and derivative*/ + x = (1.0 - r / cut); + dx = -1 / cut; + calcCheb(nradbase, x); + for (NS_TYPE n = 1; n <= nradbase; n++) { + gr(n - 1) = 0.5 - 0.5 * cheb(n); + dgr(n - 1) = -0.5 * dcheb(n) * dx; + } +} + +/** +Function that computes radial functions. + +@param nradbase, nelements, elei, elej + +@returns fr, dfr +*/ +void ACERadialFunctions::radfunc(SPECIES_TYPE elei, SPECIES_TYPE elej) { + DOUBLE_TYPE frval, dfrval; + for (NS_TYPE n = 0; n < nradial; n++) { + for (LS_TYPE l = 0; l <= lmax; l++) { + frval = 0.0; + dfrval = 0.0; + for (NS_TYPE k = 0; k < nradbase; k++) { + frval += crad(elei, elej, n, l, k) * gr(k); + dfrval += crad(elei, elej, n, l, k) * dgr(k); + } + fr(n, l) = frval; + dfr(n, l) = dfrval; + } + } +} + + +void ACERadialFunctions::all_radfunc(SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, DOUBLE_TYPE r) { + DOUBLE_TYPE lam = lambda(mu_i, mu_j); + DOUBLE_TYPE r_cut = cut(mu_i, mu_j); + DOUBLE_TYPE dr_cut = dcut(mu_i, mu_j); + // set up radial functions + radbase(lam, r_cut, dr_cut, r); //update gr, dgr + radfunc(mu_i, mu_j); // update fr(nr, l), dfr(nr, l) +} + + +void ACERadialFunctions::setuplookupRadspline() { + using namespace std::placeholders; + DOUBLE_TYPE lam, r_cut, dr_cut; + DOUBLE_TYPE cr_c, dcr_c, pre, lamhc; + + // at r = rcut + eps the function and its derivatives is zero + for (SPECIES_TYPE elei = 0; elei < nelements; elei++) { + for (SPECIES_TYPE elej = 0; elej < nelements; elej++) { + + lam = lambda(elei, elej); + r_cut = cut(elei, elej); + dr_cut = dcut(elei, elej); + + splines_gk(elei, elej).setupSplines(gr.get_size(), + std::bind(&ACERadialFunctions::radbase, this, lam, r_cut, dr_cut, + _1),//update gr, dgr + gr.get_data(), + dgr.get_data(), deltaSplineBins, cutoff); + + splines_rnl(elei, elej).setupSplines(fr.get_size(), + std::bind(&ACERadialFunctions::all_radfunc, this, elei, elej, + _1), // update fr(nr, l), dfr(nr, l) + fr.get_data(), + dfr.get_data(), deltaSplineBins, cutoff); + + + pre = prehc(elei, elej); + lamhc = lambdahc(elei, elej); +// radcore(r, pre, lamhc, cutoff, cr_c, dcr_c); + splines_hc(elei, elej).setupSplines(1, + std::bind(&ACERadialFunctions::radcore, _1, pre, lamhc, cutoff, + std::ref(cr_c), std::ref(dcr_c)), + &cr_c, + &dcr_c, deltaSplineBins, cutoff); + } + } + +} + +/** +Function that gets radial function from look-up table using splines. + +@param r, nradbase_c, nradial_c, lmax, mu_i, mu_j + +@returns fr, dfr, gr, dgr, cr, dcr +*/ +void +ACERadialFunctions::evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, + SPECIES_TYPE mu_j, bool calc_second_derivatives) { + auto &spline_gk = splines_gk(mu_i, mu_j); + auto &spline_rnl = splines_rnl(mu_i, mu_j); + auto &spline_hc = splines_hc(mu_i, mu_j); + + spline_gk.calcSplines(r, calc_second_derivatives); // populate splines_gk.values, splines_gk.derivatives; + for (NS_TYPE nr = 0; nr < nradbase_c; nr++) { + gr(nr) = spline_gk.values(nr); + dgr(nr) = spline_gk.derivatives(nr); + if (calc_second_derivatives) + d2gr(nr) = spline_gk.second_derivatives(nr); + } + + spline_rnl.calcSplines(r, calc_second_derivatives); + for (size_t ind = 0; ind < fr.get_size(); ind++) { + fr.get_data(ind) = spline_rnl.values.get_data(ind); + dfr.get_data(ind) = spline_rnl.derivatives.get_data(ind); + if (calc_second_derivatives) + d2fr.get_data(ind) = spline_rnl.second_derivatives.get_data(ind); + } + + spline_hc.calcSplines(r, calc_second_derivatives); + cr = spline_hc.values(0); + dcr = spline_hc.derivatives(0); + if (calc_second_derivatives) + d2cr = spline_hc.second_derivatives(0); +} + + +void +ACERadialFunctions::radcore(DOUBLE_TYPE r, DOUBLE_TYPE pre, DOUBLE_TYPE lambda, DOUBLE_TYPE cutoff, DOUBLE_TYPE &cr, + DOUBLE_TYPE &dcr) { +/* pseudocode for hard core repulsion +in: + r: distance + pre: prefactor: read from input, depends on pair of atoms mu_i mu_j + lambda: exponent: read from input, depends on pair of atoms mu_i mu_j + cutoff: cutoff distance: read from input, depends on pair of atoms mu_i mu_j +out: +cr: hard core repulsion +dcr: derivative of hard core repulsion + + function + \$f f_{core} = pre \exp( - \lambda r^2 ) / r \$f + +*/ + + DOUBLE_TYPE r2, lr2, y, x0, env, denv; + +// repulsion strictly positive and decaying + pre = abs(pre); + lambda = abs(lambda); + + r2 = r * r; + lr2 = lambda * r2; + if (lr2 < 50.0) { + y = exp(-lr2); + cr = pre * y / r; + dcr = -pre * y * (2.0 * lr2 + 1.0) / r2; + + x0 = r / cutoff; + env = 0.5 * (1.0 + cos(pi * x0)); + denv = -0.5 * sin(pi * x0) * pi / cutoff; + dcr = cr * denv + dcr * env; + cr = cr * env; + } else { + cr = 0.0; + dcr = 0.0; + } + +} + +void +ACERadialFunctions::evaluate_range(vector r_vec, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, + SPECIES_TYPE mu_j) { + if (nradbase_c > nradbase) + throw invalid_argument("nradbase_c couldn't be larger than nradbase"); + if (nradial_c > nradial) + throw invalid_argument("nradial_c couldn't be larger than nradial"); + if (mu_i > nelements) + throw invalid_argument("mu_i couldn't be larger than nelements"); + if (mu_j > nelements) + throw invalid_argument("mu_j couldn't be larger than nelements"); + + gr_vec.resize(r_vec.size(), nradbase_c); + dgr_vec.resize(r_vec.size(), nradbase_c); + d2gr_vec.resize(r_vec.size(), nradbase_c); + + fr_vec.resize(r_vec.size(), fr.get_dim(0), fr.get_dim(1)); + dfr_vec.resize(r_vec.size(), fr.get_dim(0), fr.get_dim(1)); + d2fr_vec.resize(r_vec.size(), fr.get_dim(0), fr.get_dim(1)); + + for (size_t i = 0; i < r_vec.size(); i++) { + DOUBLE_TYPE r = r_vec[i]; + this->evaluate(r, nradbase_c, nradial_c, mu_i, mu_j, true); + for (NS_TYPE nr = 0; nr < nradbase_c; nr++) { + gr_vec(i, nr) = gr(nr); + dgr_vec(i, nr) = dgr(nr); + d2gr_vec(i, nr) = d2gr(nr); + } + + for (NS_TYPE nr = 0; nr < nradial_c; nr++) { + for (LS_TYPE l = 0; l <= lmax; l++) { + fr_vec(i, nr, l) = fr(nr, l); + dfr_vec(i, nr, l) = dfr(nr, l); + d2fr_vec(i, nr, l) = d2fr(nr, l); + + } + } + } + +} + +void SplineInterpolator::setupSplines(int num_of_functions, RadialFunctions func, + DOUBLE_TYPE *values, + DOUBLE_TYPE *dvalues, DOUBLE_TYPE deltaSplineBins, DOUBLE_TYPE cutoff) { + + this->deltaSplineBins = deltaSplineBins; + this->cutoff = cutoff; + this->ntot = static_cast(cutoff / deltaSplineBins); + + DOUBLE_TYPE r, c[4]; + this->num_of_functions = num_of_functions; + this->values.resize(num_of_functions); + this->derivatives.resize(num_of_functions); + this->second_derivatives.resize(num_of_functions); + + Array1D f1g(num_of_functions); + Array1D f1gd1(num_of_functions); + f1g.fill(0); + f1gd1.fill(0); + + nlut = ntot; + DOUBLE_TYPE f0, f1, f0d1, f1d1; + int idx; + + // cutoff is global cutoff + rscalelookup = (DOUBLE_TYPE) nlut / cutoff; + invrscalelookup = 1.0 / rscalelookup; + + lookupTable.init(ntot + 1, num_of_functions, 4); + if (values == nullptr & num_of_functions > 0) + throw invalid_argument("SplineInterpolator::setupSplines: values could not be null"); + if (dvalues == nullptr & num_of_functions > 0) + throw invalid_argument("SplineInterpolator::setupSplines: dvalues could not be null"); + + for (int n = nlut; n >= 1; n--) { + r = invrscalelookup * DOUBLE_TYPE(n); + func(r); //populate values and dvalues arrays + for (int func_id = 0; func_id < num_of_functions; func_id++) { + f0 = values[func_id]; + f1 = f1g(func_id); + f0d1 = dvalues[func_id] * invrscalelookup; + f1d1 = f1gd1(func_id); + // evaluate coefficients + c[0] = f0; + c[1] = f0d1; + c[2] = 3.0 * (f1 - f0) - f1d1 - 2.0 * f0d1; + c[3] = -2.0 * (f1 - f0) + f1d1 + f0d1; + // store coefficients + for (idx = 0; idx <= 3; idx++) + lookupTable(n, func_id, idx) = c[idx]; + + // evaluate function values and derivatives at current position + f1g(func_id) = c[0]; + f1gd1(func_id) = c[1]; + } + } + + +} + + +void SplineInterpolator::calcSplines(DOUBLE_TYPE r, bool calc_second_derivatives) { + DOUBLE_TYPE wl, wl2, wl3, w2l1, w3l2, w4l2; + DOUBLE_TYPE c[4]; + int func_id, idx; + DOUBLE_TYPE x = r * rscalelookup; + int nl = static_cast(floor(x)); + + if (nl <= 0) + throw std::invalid_argument("Encountered very small distance. Stopping."); + + if (nl < nlut) { + wl = x - DOUBLE_TYPE(nl); + wl2 = wl * wl; + wl3 = wl2 * wl; + w2l1 = 2.0 * wl; + w3l2 = 3.0 * wl2; + w4l2 = 6.0 * wl; + for (func_id = 0; func_id < num_of_functions; func_id++) { + for (idx = 0; idx <= 3; idx++) { + c[idx] = lookupTable(nl, func_id, idx); + } + values(func_id) = c[0] + c[1] * wl + c[2] * wl2 + c[3] * wl3; + derivatives(func_id) = (c[1] + c[2] * w2l1 + c[3] * w3l2) * rscalelookup; + if (calc_second_derivatives) + second_derivatives(func_id) = (c[2] + c[3] * w4l2) * rscalelookup * rscalelookup * 2; + } + } else { // fill with zeroes + values.fill(0); + derivatives.fill(0); + if (calc_second_derivatives) + second_derivatives.fill(0); + } +} + +void SplineInterpolator::calcSplines(DOUBLE_TYPE r, SHORT_INT_TYPE func_ind) { + DOUBLE_TYPE wl, wl2, wl3, w2l1, w3l2; + DOUBLE_TYPE c[4]; + int idx; + DOUBLE_TYPE x = r * rscalelookup; + int nl = static_cast(floor(x)); + + if (nl <= 0) + throw std::invalid_argument("Encountered very small distance. Stopping."); + + if (nl < nlut) { + wl = x - DOUBLE_TYPE(nl); + wl2 = wl * wl; + wl3 = wl2 * wl; + w2l1 = 2.0 * wl; + w3l2 = 3.0 * wl2; + + for (idx = 0; idx <= 3; idx++) { + c[idx] = lookupTable(nl, func_ind, idx); + } + values(func_ind) = c[0] + c[1] * wl + c[2] * wl2 + c[3] * wl3; + derivatives(func_ind) = (c[1] + c[2] * w2l1 + c[3] * w3l2) * rscalelookup; + + } else { // fill with zeroes + values(func_ind) = 0; + derivatives(func_ind) = 0; + } +} diff --git a/lib/pace/ace_radial.h b/lib/pace/ace_radial.h new file mode 100644 index 0000000000..e45cfaec79 --- /dev/null +++ b/lib/pace/ace_radial.h @@ -0,0 +1,324 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef ACE_RADIAL_FUNCTIONS_H +#define ACE_RADIAL_FUNCTIONS_H + +#include "ace_arraynd.h" +#include "ace_types.h" +#include + +using namespace std; + +//typedef void (*RadialFunctions)(DOUBLE_TYPE x); +typedef std::function RadialFunctions; + +/** + * Class that implement spline interpolation and caching for radial functions + */ +class SplineInterpolator { +public: + DOUBLE_TYPE cutoff = 0; ///< cutoff + DOUBLE_TYPE deltaSplineBins = 0.001; + int ntot = 10000; ///< Number of bins for look-up tables. + int nlut = 10000; ///< number of nodes in look-up table + DOUBLE_TYPE invrscalelookup = 1; ///< inverse of conversion coefficient from distance to lookup table within cutoff range + DOUBLE_TYPE rscalelookup = 1; ///< conversion coefficient from distance to lookup table within cutoff range + int num_of_functions = 0;///< number of functions to spline-interpolation + + Array1D values;// = Array1D("values"); ///< shape: [func_ind] + Array1D derivatives;// = Array1D("derivatives");///< shape: [func_ind] + Array1D second_derivatives;// = Array1D("second_derivatives");///< shape: [func_ind] + + Array3D lookupTable = Array3D("lookupTable");///< shape: [ntot+1][func_ind][4] + + /** + * Setup splines + * + * @param num_of_functions number of functions + * @param func subroutine, that update `values` and `dvalues` arrays + * @param values values + * @param dvalues derivatives + */ + void setupSplines(int num_of_functions, RadialFunctions func, + DOUBLE_TYPE *values, + DOUBLE_TYPE *dvalues, DOUBLE_TYPE deltaSplineBins, DOUBLE_TYPE cutoff); + + /** + * Populate `values` and `derivatives` arrays with a spline-interpolation for + * all functions + * + * @param r + * + * @return: populate 'values' and 'derivatives' + */ + void calcSplines(DOUBLE_TYPE r, bool calc_second_derivatives = false); + + /** + * Populate `values` and `derivatives` arrays with a spline-interpolation for + * all functions + * + * @param r + * + * @return: populate 'values' and 'derivatives' + */ + void calcSplines(DOUBLE_TYPE r, SHORT_INT_TYPE func_ind); +}; + +/** + * Interface class for radial basis functions with rank=1 (g_k), R_nl (rank>1) and hard-core repulsion radial functions + */ +class AbstractRadialBasis { +public: + SPECIES_TYPE nelements = 0; ///< number of elements + Array2D cut = Array2D("cut"); ///< cutoffs, shape: [nelements][nelements] + Array2D dcut = Array2D("dcut"); ///< decay of cutoff, shape: [nelements][nelements] + DOUBLE_TYPE cutoff = 0; ///< cutoff + +// int ntot = 10000; ///< Number of bins for look-up tables. + DOUBLE_TYPE deltaSplineBins; + LS_TYPE lmax = 0; ///< maximum value of `l` + NS_TYPE nradial = 0; ///< maximum number `n` of radial functions \f$ R_{nl}(r) \f$ + NS_TYPE nradbase = 0; ///< number of radial basis functions \f$ g_k(r) \f$ + + // Arrays for look-up tables. + Array2D splines_gk; ///< array of spline interpolator to store g_k, shape: [nelements][nelements] + Array2D splines_rnl; ///< array of spline interpolator to store R_nl, shape: [nelements][nelements] + Array2D splines_hc; ///< array of spline interpolator to store R_nl shape: [nelements][nelements] + //-------------------------------------------------------------------------- + + string radbasename = "ChebExpCos"; ///< type of radial basis functions \f$ g_{k}(r) \f$ (default="ChebExpCos") + + /** + Arrays to store radial functions. + */ + Array1D gr = Array1D("gr"); ///< g_k(r) functions, shape: [nradbase] + Array1D dgr = Array1D("dgr"); ///< derivatives of g_k(r) functions, shape: [nradbase] + Array1D d2gr = Array1D("d2gr"); ///< derivatives of g_k(r) functions, shape: [nradbase] + + Array2D fr = Array2D("fr"); ///< R_nl(r) functions, shape: [nradial][lmax+1] + Array2D dfr = Array2D( + "dfr"); ///< derivatives of R_nl(r) functions, shape: [nradial][lmax+1] + Array2D d2fr = Array2D( + "d2fr"); ///< derivatives of R_nl(r) functions, shape: [nradial][lmax+1] + + + + DOUBLE_TYPE cr; ///< hard-core repulsion + DOUBLE_TYPE dcr; ///< derivative of hard-core repulsion + DOUBLE_TYPE d2cr; ///< derivative of hard-core repulsion + + Array5D crad = Array5D( + "crad"); ///< expansion coefficients of radial functions into radial basis function, see Eq. (27) of PRB, shape: [nelements][nelements][lmax + 1][nradial][nradbase] + Array2D lambda = Array2D( + "lambda"); ///< distance scaling parameter Eq.(24) of PRB, shape: [nelements][nelements] + + Array2D prehc = Array2D( + "prehc"); ///< hard-core repulsion coefficients (prefactor), shape: [nelements][nelements] + Array2D lambdahc = Array2D( + "lambdahc");; ///< hard-core repulsion coefficients (lambdahc), shape: [nelements][nelements] + + virtual void + evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, + bool calc_second_derivatives = false) = 0; + + virtual void + init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, SPECIES_TYPE nelements, + DOUBLE_TYPE cutoff, + string radbasename = "ChebExpCos") = 0; + + /** + * Function that sets up the look-up tables for spline-representation of radial functions. + */ + virtual void setuplookupRadspline() = 0; + + virtual AbstractRadialBasis *clone() const = 0; + + virtual ~AbstractRadialBasis() = default; +}; + + +/** +Class to store radial functions and their associated functions. \n +*/ +class ACERadialFunctions final : public AbstractRadialBasis { +public: + + //-------------------------------------------------------------------------- + + /** + Arrays to store Chebyshev polynomials. + */ + Array1D cheb = Array1D( + "cheb"); ///< Chebyshev polynomials of the first kind, shape: [nradbase+1] + Array1D dcheb = Array1D( + "dcheb"); ///< derivatives Chebyshev polynomials of the first kind, shape: [nradbase+1] + Array1D cheb2 = Array1D( + "cheb2"); ///< Chebyshev polynomials of the second kind, shape: [nradbase+1] + + //-------------------------------------------------------------------------- + + Array2D gr_vec; + Array2D dgr_vec; + Array2D d2gr_vec; + + Array3D fr_vec; + Array3D dfr_vec; + Array3D d2fr_vec; + //------------------------------------------------------------------------ + /** + * Default constructor + */ + ACERadialFunctions() = default; + + /** + * Parametrized constructor + * + * @param nradb number of radial basis function \f$ g_k(r) \f$ - nradbase + * @param lmax maximum orbital moment - lmax + * @param nradial maximum n-index of radial functions \f$ R_{nl}(r) \f$ - nradial + * @param ntot Number of bins for spline look-up tables. + * @param nelements numer of elements + * @param cutoff cutoff + * @param radbasename type of radial basis function \f$ g_k(r) \f$ (default: "ChebExpCos") + */ + ACERadialFunctions(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, + SPECIES_TYPE nelements, + DOUBLE_TYPE cutoff, string radbasename = "ChebExpCos"); + + /** + * Initialize arrays for given parameters + * + * @param nradb number of radial basis function \f$ g_k(r) \f$ - nradbase + * @param lmax maximum orbital moment - lmax + * @param nradial maximum n-index of radial functions \f$ R_{nl}(r) \f$ - nradial + * @param ntot Number of bins for spline look-up tables. + * @param nelements numer of elements + * @param cutoff cutoff + * @param radbasename type of radial basis function \f$ g_k(r) \f$ (default: "ChebExpCos") + */ + void init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, SPECIES_TYPE nelements, + DOUBLE_TYPE cutoff, + string radbasename = "ChebExpCos") final; + + /** + * Destructor + */ + ~ACERadialFunctions() final = default; + + /** + * Function that computes Chebyshev polynomials of first and second kind + * to setup the radial functions and the derivatives + * + * @param n maximum polynom order + * @param x + * + * @returns fills cheb, dcheb and cheb2 arrays + */ + void calcCheb(NS_TYPE n, DOUBLE_TYPE x); + + /** + * Function that computes radial basis functions \$f g_k(r) \$f, see Eq.(21) of PRB paper + * @param lam \$f \lambda \$f parameter, see eq. (24) of PRB paper + * @param cut cutoff + * @param dcut cutoff decay + * @param r distance + * + * @return function fills gr and dgr arrays + */ + void radbase(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r); + + /** + * Function that computes radial core repulsion \$f f_{core} = pre \exp( - \lambda r^2 ) / r \$f, + * and its derivative, see Eq.(27) of implementation notes. + * + * @param r distance + * @param pre prefactor: read from input, depends on pair of atoms mu_i mu_j + * @param lambda exponent: read from input, depends on pair of atoms mu_i mu_j + * @param cutoff cutoff distance: read from input, depends on pair of atoms mu_i mu_j + * @param cr (out) hard core repulsion + * @param dcr (out) derivative of hard core repulsion + */ + static void radcore(DOUBLE_TYPE r, DOUBLE_TYPE pre, DOUBLE_TYPE lambda, DOUBLE_TYPE cutoff, DOUBLE_TYPE &cr, + DOUBLE_TYPE &dcr); + + /** + * Function that sets up the look-up tables for spline-representation of radial functions. + */ + void setuplookupRadspline() final; + + /** + * Function that computes radial functions \f$ R_{nl}(r)\f$ (see Eq. 27 from PRB paper) + * and its derivatives for all range of n,l, + * ONLY if radial basis functions (gr and dgr) are computed. + * @param elei first species type + * @param elej second species type + * + * @return fills in fr, dfr arrays + */ + void radfunc(SPECIES_TYPE elei, SPECIES_TYPE elej); + + /** + * Compute all radial functions R_nl(r), radial basis functions g_k(r) and hard-core repulsion function hc(r) + * + * @param r distance + * @param nradbase_c + * @param nradial_c + * @param mu_i + * @param mu_j + * + * @return update gr(k), dgr(k), fr(n,l), dfr(n,l), cr, dcr + */ + void evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, + bool calc_second_derivatives = false) final; + + + void + evaluate_range(vector r_vec, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, + SPECIES_TYPE mu_j); + + void chebExpCos(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r); + + void chebPow(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r); + + void chebLinear(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r); + + /** + * Setup all radial functions for element pair mu_i-mu_j and distance r + * @param mu_i first specie type + * @param mu_j second specie type + * @param r distance + * @return update fr(nr, l), dfr(nr, l) + */ + void all_radfunc(SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, DOUBLE_TYPE r); + + ACERadialFunctions *clone() const override { + return new ACERadialFunctions(*this); + }; +}; + +#endif \ No newline at end of file diff --git a/lib/pace/ace_recursive.cpp b/lib/pace/ace_recursive.cpp new file mode 100644 index 0000000000..c895418943 --- /dev/null +++ b/lib/pace/ace_recursive.cpp @@ -0,0 +1,1340 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Christoph Ortner on 20.12.2020 + +#include "ace_recursive.h" + +#include "ace_abstract_basis.h" +#include "ace_types.h" + +/* ------------------------------------------------------------ + * ACEDAG Implementation + * (just the DAG construction, not the traversal) + * ------------------------------------------------------------ */ + +/* Notes on different Tags: + * rec1 - first basic implementation + * rec2 - avoid index arithmetic, contiguous layout, + * canonical evaluator in ACE.jl format + * rec3 - split nodes into interior and leaf nodes + */ + +void ACEDAG::init(Array2D xAspec, + Array2D AAspec, + Array1D orders, + Array2D jl_coeffs, + int _heuristic ) { + + // remember which heuristic we want to use! + heuristic = _heuristic; + + /* stage one of the graph is just extracting the A basis from + * the tensor product format into the linear list; all information + * for that is already stored in Aspec, and the only thing to do here is + * to construct zero-coefficients. Still we have to copy Aspec, since + * the one we have here will (may?) be deleted. */ + int num1 = xAspec.get_dim(0); + Aspec = xAspec; //YL: just copying the multiarray: Aspec = xAspec; + + /* fill the one-particle basis into the DAGmap + * DAGmap[ (i1,...,in) ] = iAA index where the (i1,...,in) basis functions + * lives. + */ + TDAGMAP DAGmap; + for (int iA = 0; iA < num1; iA++) { + vector a(1); + a[0] = iA; + DAGmap[a] = iA; + } + + /* For stage 2 we now want to construct the actual recursion; the + recursion info will be stored in DAGspec, while the + coefficients go into DAGcoeffs. These arrays are initialized to + length `num2`, but they will have to grow as we add additional + artificial nodes into the graph. + + initially we treat all nodes as having children, but then in a + second stage below we reorganize. */ + int num2 = AAspec.get_dim(0); + int ndensity = jl_coeffs.get_dim(1); + nodes_pre.resize(2*num2, 2); + coeffs_pre.resize(2*num2, ndensity); + + /* the first basis function we construct will get index num1, + * since there are already num1 one-particle basis functions + * to collect during stage 1 */ + dag_idx = num1; + /* main loop over AA basis set to transform into DAG */ + for (int iAA = 0; iAA < num2; iAA++) { + // create a vector representing the current basis function + int ord = orders(iAA); + vector aa(ord); + for (int t = 0; t < ord; t++) aa[t] = AAspec(iAA, t); + vector c(ndensity); + for (int p = 0; p < ndensity; p++) c[p] = jl_coeffs(iAA, p); + insert_node(DAGmap, aa, c); + } + + /* convert to 3-stage format through reordering + * interior nodes first, then leaf nodes */ + + // allocate storage + num_nodes = dag_idx; // store total size of dag + // num_nodes - num1 = number of many-body nodes. + nodes.resize(num_nodes - num1, 2); + coeffs.resize(num_nodes - num1, ndensity); + + // find out which nodes have children + haschild.resize(num_nodes - num1); + haschild.fill(false); + for (int iAA = 0; iAA < num_nodes - num1; iAA++) { + if (nodes_pre(iAA, 0) >= num1) + haschild(nodes_pre(iAA, 0)-num1) = true; + if (nodes_pre(iAA, 1) >= num1) + haschild(nodes_pre(iAA, 1)-num1) = true; + } + + // to reorder the graph we need a fresh map from preordered indices to + // postordered indices; for the 1-particle basis the order remains the same. + // TODO: doesn't need to be a map, could be a vector. + map neworder; + for (int iA = 0; iA < num1; iA++) + neworder[iA] = iA; + + // insert all interior nodes + num2_int = 0; + num2_leaf = 0; + dag_idx = num1; + int i1, i2, i1pre, i2pre; + for (int iAA = 0; iAA < num_nodes - num1; iAA++) { + if (haschild(iAA)) { + num2_int += 1; + // indices into AAbuf before reordering + i1pre = nodes_pre(iAA, 0); + i2pre = nodes_pre(iAA, 1); + // indices into AAbuf after reordering + i1 = neworder[i1pre]; + i2 = neworder[i2pre]; + // insert the current node : iAA is old order, dag_idx is new order + neworder[num1+iAA] = dag_idx; + nodes(dag_idx-num1, 0) = i1; + nodes(dag_idx-num1, 1) = i2; + for (int t = 0; t < ndensity; t++) + coeffs(dag_idx-num1, t) = coeffs_pre(iAA, t); + dag_idx++; + } + } + + // insert all leaf nodes + for (int iAA = 0; iAA < num_nodes - num1; iAA++) { + if (!haschild(iAA)) { + num2_leaf += 1; + // indices into AAbuf before reordering + i1pre = nodes_pre(iAA, 0); + i2pre = nodes_pre(iAA, 1); + // insert the current node : no need to remember the new order now + nodes(dag_idx-num1, 0) = neworder[i1pre]; + nodes(dag_idx-num1, 1) = neworder[i2pre]; + for (int t = 0; t < ndensity; t++) + coeffs(dag_idx-num1, t) = coeffs_pre(iAA, t); + dag_idx++; + } + } +#ifdef DEBUG + cout << "num2_int = " << num2_int << "; num2_leaf = " << num2_leaf << "\n"; +#endif + // free up memory that is no longer needed + nodes_pre.resize(0, 0); + coeffs_pre.resize(0, 0); + haschild.resize(0); + + /* finalize dag: allocate buffer storage */ + AAbuf.resize(num1 + num2_int); + w.resize(num_nodes); + // TODO: technically only need num1 + num2_int for w, this can save one + // memory access later, probably not worth the crazy code duplication. +} + +void ACEDAG::insert_node(TDAGMAP &DAGmap, vector a, vector c) { + /* start with a list of all possible partitions into 2 groups + * and check whether any of these nodes are already in the dag */ + auto partitions = find_2partitions(a); + int ndensity = c.size(); + int num1 = get_num1(); + + // TODO: first try to find partitions into nodes that are already parents + // that way we will get more leaf nodes! + for (TPARTITION const& p : partitions) { + /* this is the good case; the parent nodes are both already in the + * graph; add the new node and return. This is also the only place in the + * code where an actual insert happens. */ + if (DAGmap.count(p.first) && DAGmap.count(p.second)) { + if (nodes_pre.get_dim(0) < dag_idx + 1) { //check if array is sufficiently large + int newsize = (dag_idx * 3) / 2; + nodes_pre.resize(newsize, 2); // grow arrays if necessary + coeffs_pre.resize(newsize, ndensity); + } + int i1 = DAGmap[p.first]; + int i2 = DAGmap[p.second]; + nodes_pre(dag_idx - num1, 0) = i1; + nodes_pre(dag_idx - num1, 1) = i2; + DAGmap[a] = dag_idx; + for (int p = 0; p < ndensity; p++) + coeffs_pre(dag_idx - num1, p) = c[p]; + dag_idx += 1; + return; + } + } + + /* if we are here, then this means, the new node cannot yet be inserted. + * We first need to insert some intermediate auxiliary nodes. For this + * we use a simple heuristic: + * try to find a partition where one of the two nodes are already + * in the graph, if there are several, then we remember the longest + * (this is a very greedy heuristic!!) + * .... (continue below) .... + */ + TPARTITION longest; + int longest_length = 0; + for (auto const& p : partitions) { + int len = 0; + if (DAGmap.count(p.first)) { + len = p.first.size(); + } else if (DAGmap.count(p.second)) { + len = p.second.size(); + } + if ((len > 0) && (len > longest_length)) { + longest_length = len; + longest = p; + } + } + + /* sanity check */ + if (longest_length == 0) { + std::stringstream error_message; + error_message << "WARNING : something has gone horribly wrong! `longest_length == 0`! \n"; + error_message << "a = ["; + for (int t = 0; t < a.size(); t++) + error_message << a[t] << ", "; + error_message << "]\n"; + throw std::logic_error(error_message.str()); +// return; + } + + /* If there is a partition with one component already in the graph, + * then we only need to add in the other component. Note that there will + * always be at least one such partition, namely all those containing + * a one-element node e.g. (1,2,3,4) -> (1,) (2,3,4) then (1,) is + * a one-particle basis function and hence always in the graph. + * If heuristic == 0, then we just take one of those partitionas and move on. + * + * We also accept the found partition if longest_length > 1. + * And we also accept it if we have a 2- or 3-correlation. + */ + + if ( (heuristic == 0) + || (longest_length > 1) + || (a.size() <= 3)) { + /* insert the other node that isn't in the DAG yet + * this is an artificial node so it gets zero-coefficients + * This step is recursive, so more than one node might be inserted here */ + vector cz(ndensity); + for (int i = 0; i < ndensity; i++) cz[i] = 0.0; + TPARTITION p = longest; + if (DAGmap.count(p.first)) + insert_node(DAGmap, p.second, cz); + else + insert_node(DAGmap, p.first, cz); + } + + /* Second heuristic : heuristic == 1 + * Focus on inserting artificial 2-correlations + */ + else if (heuristic == 1) { + // and we also know that longest_length == 1 and nu = a.size >= 4. + int nu = a.size(); + // generate an artificial partition + vector a1(2); + for (int i = 0; i < 2; i++) a1[i] = a[i]; + vector a2(nu - 2); + for (int i = 0; i < nu - 2; i++) a2[i] = a[2 + i]; + vector cz(ndensity); + for (int i = 0; i < cz.size(); i++) cz[i] = 0.0; + // and insert both (we know neither are in the DAG yet) + insert_node(DAGmap, a1, cz); + insert_node(DAGmap, a2, cz); + } else { + cout << "WARNING : something has gone horribly wrong! \n"; + // TODO: Throw and error here?!? + return; + } + + + + /* now we should be ready to insert the entire tuple `a` since there is now + * an eligible parent pair. Here we recompute the partition of `a`, but + * that's a small price to pay for a clearer code. Maybe this can be + * optimized a bit by wrapping it all into a while loop or having a second + * version of `insert_node` ... */ + insert_node(DAGmap, a, c); +} + +TPARTITIONS ACEDAG::find_2partitions(vector v) { + int N = v.size(); + int zo; + TPARTITIONS partitions; + TPARTITION part; + /* This is a fun little hack to extract all subsets of the indices 1:N + * the number i will have binary representation with each digit indicating + * whether or not that index belongs to the selected subset */ + for (int i = 1; i < (1< v1(N1); + vector v2(N2); + int i1 =0, i2 = 0; + p = 1; + for (int n = 0; n < N; n++) { + zo = ((i / p) % 2); + p *= 2; + if (zo == 1) { + v1[i1] = v[n]; + i1 += 1; + } else { + v2[i2] = v[n]; + i2 += 1; + } + } + part = make_pair(v1, v2); + partitions.push_back(part); + } + return partitions; +} + +void ACEDAG::print() { + cout << "DAG Specification: \n" ; + cout << " n1 : " << get_num1() << "\n"; + cout << " n2 : " << get_num2() << "\n"; + cout << " num_nodes : " << num_nodes << "\n"; + cout << "--------------------\n"; + cout << "A-spec: \n"; + for (int iA = 0; iA < get_num1(); iA++) { + cout << iA << " : " << Aspec(iA, 0) << + Aspec(iA, 1) << Aspec(iA, 2) << Aspec(iA, 3) << "\n"; + } + + cout << "-----------\n"; + cout << "AA-tree\n"; + + for (int iAA = 0; iAA < get_num2(); iAA++) { + cout << iAA + get_num1() << " : " << + nodes(iAA, 0) << ", " << nodes(iAA, 1) << "\n"; + } +} + + +/* ------------------------------------------------------------ + * ACERecursiveEvaluator + * ------------------------------------------------------------ */ + + +void ACERecursiveEvaluator::set_basis(ACECTildeBasisSet &bas, int heuristic) { + basis_set = &bas; + init(basis_set, heuristic); +} + +void ACERecursiveEvaluator::init(ACECTildeBasisSet *basis_set, int heuristic) { + + ACEEvaluator::init(basis_set); + + + weights.init(basis_set->nelements, basis_set->nradmax + 1, basis_set->lmax + 1, + "weights"); + + weights_rank1.init(basis_set->nelements, basis_set->nradbase, "weights_rank1"); + + + DG_cache.init(1, basis_set->nradbase, "DG_cache"); + DG_cache.fill(0); + + R_cache.init(1, basis_set->nradmax, basis_set->lmax + 1, "R_cache"); + R_cache.fill(0); + + DR_cache.init(1, basis_set->nradmax, basis_set->lmax + 1, "DR_cache"); + DR_cache.fill(0); + + Y_cache.init(1, basis_set->lmax + 1, "Y_cache"); + Y_cache.fill({0, 0}); + + DY_cache.init(1, basis_set->lmax + 1, "dY_dense_cache"); + DY_cache.fill({0.}); + + //hard-core repulsion + DCR_cache.init(1, "DCR_cache"); + DCR_cache.fill(0); + dB_flatten.init(basis_set->max_dB_array_size, "dB_flatten"); + + /* convert to ACE.jl format to prepare for construction of DAG + * This will fill the arrays jl_Aspec, jl_AAspec, jl_orders + */ + acejlformat(); + + // test_acejlformat(); + + // now pass this info into the DAG + dag.init(jl_Aspec, jl_AAspec, jl_orders, jl_coeffs, heuristic); + + // finally empty the temporary arrays to clear up the memory... + // TODO +} + + +void ACERecursiveEvaluator::acejlformat() { + + int func_ms_ind = 0; + int func_ms_t_ind = 0;// index for dB + int j, jj, func_ind, ms_ind; + + SPECIES_TYPE mu_i = 0;//TODO: multispecies + const SHORT_INT_TYPE total_basis_size = basis_set->total_basis_size[mu_i]; + ACECTildeBasisFunction *basis = basis_set->basis[mu_i]; + + int AAidx = 0; + RANK_TYPE order, t; + SPECIES_TYPE *mus; + NS_TYPE *ns; + LS_TYPE *ls; + MS_TYPE *ms; + + /* transform basis into new format: + [A1 ... A_num1] + [(i1,i2)(i1,i2)(...)(i1,i2,i3)(...)] + where each ia represents an A_{ia} + */ + + /* compute max values for mu, n, l, m */ + SPECIES_TYPE maxmu = 0; //TODO: multispecies + NS_TYPE maxn = basis_set->nradmax; + LS_TYPE maxl = basis_set->lmax; + RANK_TYPE maxorder = basis_set->rankmax; + const DENSITY_TYPE ndensity = basis_set->ndensitymax; + + int num1 = 0; + + + /* create a 4D lookup table for the 1-p basis + * TODO: replace with a map?? + */ + Array4D A_lookup(int(maxmu+1), int(maxn), int(maxl+1), int(2*maxl+1)); + for (int mu = 0; mu < maxmu+1; mu++) + for (int n = 0; n < maxn; n++) + for (int l = 0; l < maxl+1; l++) + for (int m = 0; m < 2*maxl+1; m++) + A_lookup(mu, n, l, m) = -1; + int A_idx = 0; // linear index of A basis function (1-particle) + for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { + ACECTildeBasisFunction *func = &basis[func_ind]; +// func->print(); + order = func->rank; mus = func->mus; ns = func->ns; ls = func->ls; + for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { + ms = &func->ms_combs[ms_ind * order]; + for (t = 0; t < order; t++) { + int iA = A_lookup(mus[t], ns[t]-1, ls[t], ms[t]+ls[t]); + if (iA == -1) { + A_lookup(mus[t], ns[t] - 1, ls[t], ms[t] + ls[t]) = A_idx; + A_idx += 1; + } + } + } + } + + /* create the reverse list: linear indixes to mu,l,m,n + this keeps only the basis functions we really need */ + num1 = A_idx; + Array2D & Aspec = jl_Aspec; + Aspec.resize(num1, 4); + // Array2D Aspec(num1, 4); + for (int mu = 0; mu <= maxmu; mu++) + for (int n = 1; n <= maxn; n++) + for (int l = 0; l <= maxl; l++) + for (int m = -l; m <= l; m++) { + int iA = A_lookup(mu, n-1, l, l+m); + if (iA != -1) { + Aspec(iA, 0) = mu; + Aspec(iA, 1) = n; + Aspec(iA, 2) = l; + Aspec(iA, 3) = m; + } + } + + /* ============ HALF-BASIS TRICK START ============ */ + for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { + ACECTildeBasisFunction *func = &basis[func_ind]; + order = func->rank; mus = func->mus; ns = func->ns; ls = func->ls; + if (!( (mus[0] <= maxmu) && (ns[0] <= maxn) && (ls[0] <= maxl) )) + continue; + + for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { + ms = &func->ms_combs[ms_ind * order]; + + // find first positive and negative index + int pos_idx = order + 1; + int neg_idx = order + 1; + for (t = order-1; t >= 0; t--) + if (ms[t] > 0) pos_idx = t; + else if (ms[t] < 0) neg_idx = t; + + // if neg_idx < pos_idx then this means that ms is non-zero + // and that the first non-zero index is negative, hence this is + // a negative-sign tuple which we want to combine into + // its opposite. + if (neg_idx < pos_idx) { + // find the opposite tuple + int ms_ind2 = 0; + MS_TYPE *ms2; + bool found_opposite = false; + for (ms_ind2 = 0; ms_ind2 < func->num_ms_combs; ++ms_ind2) { + ms2 = &func->ms_combs[ms_ind2 * order]; + bool isopposite = true; + for (t = 0; t < order; t++) + if (ms[t] != -ms2[t]) { + isopposite = false; + break; + } + if (isopposite) { + found_opposite = true; + break; + } + } + + if (ms_ind == ms_ind2) { + cout << "WARNING - ms_ind == ms_ind2 \n"; + } + + // now we need to overwrite the coefficients + if (found_opposite) { + int sig = 1; + for (t = 0; t < order; t++) + if (ms[t] < 0) + sig *= -1; + for (int p = 0; p < ndensity; ++p) { + func->ctildes[ms_ind2 * ndensity + p] += + func->ctildes[ms_ind * ndensity + p]; + func->ctildes[ms_ind * ndensity + p] = 0.0; + } + } + } + } + } + + // /* ============ HALF-BASIS TRICK END ============ */ + + + /* count number of basis functions, keep only non-zero!! */ + int num2 = 0; + for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { + ACECTildeBasisFunction *func = &basis[func_ind]; + for (ms_ind = 0; ms_ind < (&basis[func_ind])->num_ms_combs; ++ms_ind, ++func_ms_ind) { + // check that the coefficients are actually non-zero + bool isnonzero = false; + for (DENSITY_TYPE p = 0; p < ndensity; ++p) + if (func->ctildes[ms_ind * ndensity + p] != 0.0) + isnonzero = true; + if (isnonzero) + num2++; + } + } + + + /* Now create the AA basis links into the A basis */ + num1 = A_idx; // total number of A-basis functions that we keep + // Array1D AAorders(num2); + Array1D & AAorders = jl_orders; + AAorders.resize(num2); + // Array2D AAspec(num2, maxorder); // specs of AA basis functions + Array2D & AAspec = jl_AAspec; + AAspec.resize(num2, maxorder); + jl_coeffs.resize(num2, ndensity); + AAidx = 0; // linear index into AA basis function + int len_flat = 0; + for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { + ACECTildeBasisFunction *func = &basis[func_ind]; + order = func->rank; mus = func->mus; ns = func->ns; ls = func->ls; + if (!((mus[0] <= maxmu) && (ns[0] <= maxn) && (ls[0] <= maxl))) //fool-proofing of functions + continue; + + for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { + ms = &func->ms_combs[ms_ind * order]; + + // check that the coefficients are actually non-zero + bool iszero = true; + for (DENSITY_TYPE p = 0; p < ndensity; ++p) + if (func->ctildes[ms_ind * ndensity + p] != 0.0) + iszero = false; + if (iszero) continue; + + AAorders(AAidx) = order; + for (t = 0; t < order; t++) { + int Ait = A_lookup(int(mus[t]), int(ns[t]-1), int(ls[t]), int(ms[t])+int(ls[t])); + AAspec(AAidx, t) = Ait; + len_flat += 1; + } + for (t = order; t < maxorder; t++) AAspec(AAidx, t) = -1; + /* copy over the coefficients */ + for (DENSITY_TYPE p = 0; p < ndensity; ++p) + jl_coeffs(AAidx, p) = func->ctildes[ms_ind * ndensity + p]; + AAidx += 1; + } + } + + // flatten the AAspec array + jl_AAspec_flat.resize(len_flat); + int idx_spec = 0; + for (int AAidx = 0; AAidx < jl_AAspec.get_dim(0); AAidx++) + for (int p = 0; p < jl_orders(AAidx); p++, idx_spec++) + jl_AAspec_flat(idx_spec) = jl_AAspec(AAidx, p); + +} + +void ACERecursiveEvaluator::test_acejlformat() { + + Array2D AAspec = jl_AAspec; + Array2D Aspec = jl_Aspec; + Array1D AAorders = jl_orders; + cout << "num2 = " << AAorders.get_dim(0) << "\n"; + int func_ms_ind = 0; + int func_ms_t_ind = 0;// index for dB + int j, jj, func_ind, ms_ind; + + SPECIES_TYPE mu_i = 0; + const SHORT_INT_TYPE total_basis_size = basis_set->total_basis_size[mu_i]; + ACECTildeBasisFunction *basis = basis_set->basis[mu_i]; + + RANK_TYPE order, t; + SPECIES_TYPE *mus; + NS_TYPE *ns; + LS_TYPE *ls; + MS_TYPE *ms; + + /* ==== test by printing the basis spec ====*/ + // TODO: convert this into an automatic consistency test + int iAA = 0; + for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { + ACECTildeBasisFunction *func = &basis[func_ind]; + order = func->rank; mus = func->mus; ns = func->ns; ls = func->ls; + // func->print(); + //loop over {ms} combinations in sum + for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { + ms = &func->ms_combs[ms_ind * order]; + + + cout << iAA << " : |"; + for (t = 0; t < order; t++) + cout << mus[t] << ";" << ns[t] << "," << ls[t] << "," << ms[t] << "|"; + cout << "\n"; + + cout << " ["; + for (t = 0; t < AAorders(iAA); t++) + cout << AAspec(iAA, int(t)) << ","; + cout << "]\n"; + cout << " |"; + for (t = 0; t < AAorders(iAA); t++) { + int iA = AAspec(iAA, t); + // cout << iA << ","; + cout << Aspec(iA, 0) << ";" + << Aspec(iA, 1) << "," + << Aspec(iA, 2) << "," + << Aspec(iA, 3) << "|"; + } + cout << "\n"; + iAA += 1; + } + } + /* ==== END TEST ==== */ + + +} + + + + +void ACERecursiveEvaluator::resize_neighbours_cache(int max_jnum) { + if(basis_set== nullptr) { + throw std::invalid_argument("ACERecursiveEvaluator: basis set is not assigned"); + } + if (R_cache.get_dim(0) < max_jnum) { + + //TODO: implement grow + R_cache.resize(max_jnum, basis_set->nradmax, basis_set->lmax + 1); + R_cache.fill(0); + + DR_cache.resize(max_jnum, basis_set->nradmax, basis_set->lmax + 1); + DR_cache.fill(0); + + DG_cache.resize(max_jnum, basis_set->nradbase); + DG_cache.fill(0); + + Y_cache.resize(max_jnum, basis_set->lmax + 1); + Y_cache.fill({0, 0}); + + DY_cache.resize(max_jnum, basis_set->lmax + 1); + DY_cache.fill({0}); + + //hard-core repulsion + DCR_cache.init(max_jnum, "DCR_cache"); + DCR_cache.fill(0); + } +} + + + +// double** r - atomic coordinates of atom I +// int* types - atomic types if atom I +// int **firstneigh - ptr to 1st J int value of each I atom. Usage: jlist = firstneigh[i]; +// Usage: j = jlist_of_i[jj]; +// jnum - number of J neighbors for each I atom. jnum = numneigh[i]; + +void +ACERecursiveEvaluator::compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) { + if(basis_set== nullptr) { + throw std::invalid_argument("ACERecursiveEvaluator: basis set is not assigned"); + } + per_atom_calc_timer.start(); +#ifdef PRINT_MAIN_STEPS + printf("\n ATOM: ind = %d r_norm=(%f, %f, %f)\n",i, x[i][0], x[i][1], x[i][2]); +#endif + DOUBLE_TYPE evdwl = 0, evdwl_cut = 0, rho_core = 0; + DOUBLE_TYPE r_norm; + DOUBLE_TYPE xn, yn, zn, r_xyz; + DOUBLE_TYPE R, GR, DGR, R_over_r, DR, DCR; + DOUBLE_TYPE *r_hat; + + SPECIES_TYPE mu_j; + RANK_TYPE r, rank, t; + NS_TYPE n; + LS_TYPE l; + MS_TYPE m, m_t; + + SPECIES_TYPE *mus; + NS_TYPE *ns; + LS_TYPE *ls; + MS_TYPE *ms; + + int j, jj, func_ind, ms_ind; + SHORT_INT_TYPE factor; + + ACEComplex Y{0}, Y_DR{0.}; + ACEComplex B{0.}; + ACEComplex dB{0}; + ACEComplex A_cache[basis_set->rankmax]; + + ACEComplex dA[basis_set->rankmax]; + int spec[basis_set->rankmax]; + + dB_flatten.fill({0.}); + + ACEDYcomponent grad_phi_nlm{0}, DY{0.}; + + //size is +1 of max to avoid out-of-boundary array access in double-triangular scheme + ACEComplex A_forward_prod[basis_set->rankmax + 1]; + ACEComplex A_backward_prod[basis_set->rankmax + 1]; + + DOUBLE_TYPE inv_r_norm; + DOUBLE_TYPE r_norms[jnum]; + DOUBLE_TYPE inv_r_norms[jnum]; + DOUBLE_TYPE rhats[jnum][3];//normalized vector + SPECIES_TYPE elements[jnum]; + const DOUBLE_TYPE xtmp = x[i][0]; + const DOUBLE_TYPE ytmp = x[i][1]; + const DOUBLE_TYPE ztmp = x[i][2]; + DOUBLE_TYPE f_ji[3]; + + bool is_element_mapping = element_type_mapping.get_size() > 0; + SPECIES_TYPE mu_i; + if (is_element_mapping) + mu_i = element_type_mapping(type[i]); + else + mu_i = type[i]; + + const SHORT_INT_TYPE total_basis_size_rank1 = basis_set->total_basis_size_rank1[mu_i]; + const SHORT_INT_TYPE total_basis_size = basis_set->total_basis_size[mu_i]; + + ACECTildeBasisFunction *basis_rank1 = basis_set->basis_rank1[mu_i]; + ACECTildeBasisFunction *basis = basis_set->basis[mu_i]; + + DOUBLE_TYPE rho_cut, drho_cut, fcut, dfcut; + DOUBLE_TYPE dF_drho_core; + + //TODO: lmax -> lmaxi (get per-species type) + const LS_TYPE lmaxi = basis_set->lmax; + + //TODO: nradmax -> nradiali (get per-species type) + const NS_TYPE nradiali = basis_set->nradmax; + + //TODO: nradbase -> nradbasei (get per-species type) + const NS_TYPE nradbasei = basis_set->nradbase; + + //TODO: get per-species type number of densities + const DENSITY_TYPE ndensity= basis_set->ndensitymax; + + neighbours_forces.resize(jnum, 3); + neighbours_forces.fill(0); + + //TODO: shift nullifications to place where arrays are used + weights.fill({0}); + weights_rank1.fill(0); + A.fill({0}); + A_rank1.fill(0); + rhos.fill(0); + dF_drho.fill(0); + +#ifdef EXTRA_C_PROJECTIONS + basis_projections_rank1.init(total_basis_size_rank1, ndensity, "c_projections_rank1"); + basis_projections.init(total_basis_size, ndensity, "c_projections"); +#endif + + //proxy references to spherical harmonics and radial functions arrays + const Array2DLM &ylm = basis_set->spherical_harmonics.ylm; + const Array2DLM &dylm = basis_set->spherical_harmonics.dylm; + + const Array2D &fr = basis_set->radial_functions->fr; + const Array2D &dfr = basis_set->radial_functions->dfr; + + const Array1D &gr = basis_set->radial_functions->gr; + const Array1D &dgr = basis_set->radial_functions->dgr; + + loop_over_neighbour_timer.start(); + + int jj_actual = 0; + SPECIES_TYPE type_j = 0; + int neighbour_index_mapping[jnum]; // jj_actual -> jj + //loop over neighbours, compute distance, consider only atoms within with rradial_functions->cut(mu_i, mu_j); + r_xyz = sqrt(xn * xn + yn * yn + zn * zn); + + if (r_xyz >= current_cutoff) + continue; + + inv_r_norm = 1 / r_xyz; + + r_norms[jj_actual] = r_xyz; + inv_r_norms[jj_actual] = inv_r_norm; + rhats[jj_actual][0] = xn * inv_r_norm; + rhats[jj_actual][1] = yn * inv_r_norm; + rhats[jj_actual][2] = zn * inv_r_norm; + elements[jj_actual] = mu_j; + neighbour_index_mapping[jj_actual] = jj; + jj_actual++; + } + + int jnum_actual = jj_actual; + + //ALGORITHM 1: Atomic base A + for (jj = 0; jj < jnum_actual; ++jj) { + r_norm = r_norms[jj]; + mu_j = elements[jj]; + r_hat = rhats[jj]; + + //proxies + Array2DLM &Y_jj = Y_cache(jj); + Array2DLM &DY_jj = DY_cache(jj); + + + basis_set->radial_functions->evaluate(r_norm, basis_set->nradbase, nradiali, mu_i, mu_j); + basis_set->spherical_harmonics.compute_ylm(r_hat[0], r_hat[1], r_hat[2], lmaxi); + //loop for computing A's + //rank = 1 + for (n = 0; n < basis_set->nradbase; n++) { + GR = gr(n); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("-neigh atom %d\n", jj); + printf("gr(n=%d)(r=%f) = %f\n", n, r_norm, gr(n)); + printf("dgr(n=%d)(r=%f) = %f\n", n, r_norm, dgr(n)); +#endif + DG_cache(jj, n) = dgr(n); + A_rank1(mu_j, n) += GR * Y00; + } + //loop for computing A's + // for rank > 1 + for (n = 0; n < nradiali; n++) { + auto &A_lm = A(mu_j, n); + for (l = 0; l <= lmaxi; l++) { + R = fr(n, l); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("R(nl=%d,%d)(r=%f)=%f\n", n + 1, l, r_norm, R); +#endif + + DR_cache(jj, n, l) = dfr(n, l); + R_cache(jj, n, l) = R; + + for (m = 0; m <= l; m++) { + Y = ylm(l, m); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("Y(lm=%d,%d)=(%f, %f)\n", l, m, Y.real, Y.img); +#endif + A_lm(l, m) += R * Y; //accumulation sum over neighbours + Y_jj(l, m) = Y; + DY_jj(l, m) = dylm(l, m); + } + } + } + + //hard-core repulsion + rho_core += basis_set->radial_functions->cr; + DCR_cache(jj) = basis_set->radial_functions->dcr; + + } //end loop over neighbours + + //complex conjugate A's (for NEGATIVE (-m) terms) + // for rank > 1 + for (mu_j = 0; mu_j < basis_set->nelements; mu_j++) { + for (n = 0; n < nradiali; n++) { + auto &A_lm = A(mu_j, n); + for (l = 0; l <= lmaxi; l++) { + //fill in -m part in the outer loop using the same m <-> -m symmetry as for Ylm + for (m = 1; m <= l; m++) { + factor = m % 2 == 0 ? 1 : -1; + A_lm(l, -m) = A_lm(l, m).conjugated() * factor; + } + } + } + } //now A's are constructed + loop_over_neighbour_timer.stop(); + + // ==================== ENERGY ==================== + + energy_calc_timer.start(); +#ifdef EXTRA_C_PROJECTIONS + basis_projections_rank1.fill(0); + basis_projections.fill(0); +#endif + + //ALGORITHM 2: Basis functions B with iterative product and density rho(p) calculation + //rank=1 + for (int func_rank1_ind = 0; func_rank1_ind < total_basis_size_rank1; ++func_rank1_ind) { + ACECTildeBasisFunction *func = &basis_rank1[func_rank1_ind]; +// ndensity = func->ndensity; +#ifdef PRINT_LOOPS_INDICES + printf("Num density = %d r = 0\n",(int) ndensity ); + print_C_tilde_B_basis_function(*func); +#endif + double A_cur = A_rank1(func->mus[0], func->ns[0] - 1); +#ifdef DEBUG_ENERGY_CALCULATIONS + printf("A_r=1(x=%d, n=%d)=(%f)\n", func->mus[0], func->ns[0], A_cur); + printf(" coeff[0] = %f\n", func->ctildes[0]); +#endif + for (DENSITY_TYPE p = 0; p < ndensity; ++p) { + //for rank=1 (r=0) only 1 ms-combination exists (ms_ind=0), so index of func.ctildes is 0..ndensity-1 + rhos(p) += func->ctildes[p] * A_cur; +#ifdef EXTRA_C_PROJECTIONS + //aggregate C-projections separately + basis_projections_rank1(func_rank1_ind, p)+= func->ctildes[p] * A_cur; +#endif + } + } // end loop for rank=1 + + // ================ START RECURSIVE EVALUATOR ==================== + // (rank > 1 only) + + /* STAGE 1: + * 1-particle basis is already evaluated, so we only need to + * copy it into the AA value buffer + */ + int num1 = dag.get_num1(); + for (int idx = 0; idx < num1; idx++) + dag.AAbuf(idx) = A( dag.Aspec(idx, 0), + dag.Aspec(idx, 1)-1, + dag.Aspec(idx, 2), + dag.Aspec(idx, 3) ); + + + if (recursive) { + /* STAGE 2: FORWARD PASS + * Forward pass: go through the dag and store all intermediate results + */ + + // rhos.fill(0); note the rhos are already reset and started filling above! + ACEComplex AAcur{0.0}; + int i1, i2; + + int * dag_nodes = dag.nodes.get_data(); + int idx_nodes = 0; + + DOUBLE_TYPE * dag_coefs = dag.coeffs.get_data(); + int idx_coefs = 0; + + int num2_int = dag.get_num2_int(); + int num2_leaf = dag.get_num2_leaf(); + + // interior nodes (save AA) + for (int idx = num1; idx < num1+num2_int; idx++) { + i1 = dag_nodes[idx_nodes]; idx_nodes++; + i2 = dag_nodes[idx_nodes]; idx_nodes++; + AAcur = dag.AAbuf(i1) * dag.AAbuf(i2); + dag.AAbuf(idx) = AAcur; + for (int p = 0; p < ndensity; p++, idx_coefs++) + rhos(p) += AAcur.real_part_product(dag_coefs[idx_coefs]); + } + + // leaf nodes -> no need to store in AAbuf + DOUBLE_TYPE AAcur_re = 0.0; + for (int _idx = 0; _idx < num2_leaf; _idx++) { + i1 = dag_nodes[idx_nodes]; idx_nodes++; + i2 = dag_nodes[idx_nodes]; idx_nodes++; + AAcur_re = dag.AAbuf(i1).real_part_product(dag.AAbuf(i2)); + for (int p = 0; p < ndensity; p++, idx_coefs++) + rhos(p) += AAcur_re * dag_coefs[idx_coefs]; + } + + } else { + + /* non-recursive Julia-style evaluator implementation */ + // TODO: fix array access to enable bounds checking again??? + ACEComplex AAcur{1.0}; + int *AAspec = jl_AAspec_flat.get_data(); + DOUBLE_TYPE *coeffs = jl_coeffs.get_data(); + int idx_spec = 0; + int idx_coefs = 0; + int order = 0; + int max_order = jl_AAspec.get_dim(1); + for (int iAA = 0; iAA < jl_AAspec.get_dim(0); iAA ++) { + AAcur = 1.0; + order = jl_orders(iAA); + for (int r = 0; r < order; r++, idx_spec++) + AAcur *= dag.AAbuf( AAspec[idx_spec] ); + for (int p = 0; p < ndensity; p++, idx_coefs++) + rhos(p) += AAcur.real_part_product(coeffs[idx_coefs]); + } + } + + /* we now have rho and can evaluate lots of things. + -------- this is back to the original PACE code --------- */ + +#ifdef DEBUG_FORCES_CALCULATIONS + printf("rhos = "); + for(DENSITY_TYPE p =0; prho_core_cutoffs(mu_i); + drho_cut = basis_set->drho_core_cutoffs(mu_i); + + basis_set->inner_cutoff(rho_core, rho_cut, drho_cut, fcut, dfcut); + basis_set->FS_values_and_derivatives(rhos, evdwl, dF_drho, ndensity); + + dF_drho_core = evdwl * dfcut + 1; + for (DENSITY_TYPE p = 0; p < ndensity; ++p) + dF_drho(p) *= fcut; + evdwl_cut = evdwl * fcut + rho_core; + + // E0 shift + evdwl_cut += basis_set->E0vals(mu_i); + + /* I've moved this from below the weight calculation + since I believe it only times the energy? the weights + are only needed for the forces? + But I believe we could add a third timer for computing just + the weights; this will allow us to check better where the + bottleneck is. + */ + energy_calc_timer.stop(); + + forces_calc_loop_timer.start(); + + +#ifdef DEBUG_FORCES_CALCULATIONS + printf("dFrhos = "); + for(DENSITY_TYPE p =0; pndensity; + for (DENSITY_TYPE p = 0; p < ndensity; ++p) { + //for rank=1 (r=0) only 1 ms-combination exists (ms_ind=0), so index of func.ctildes is 0..ndensity-1 + weights_rank1(func->mus[0], func->ns[0] - 1) += dF_drho(p) * func->ctildes[p]; + } + } + + /* --------- we now continue with the recursive code --------- */ + + if (recursive) { + /* STAGE 2: BACKWARD PASS */ + int i1, i2; + ACEComplex AA1{0.0}; + ACEComplex AA2{0.0}; + ACEComplex wcur{0.0}; + int num2_int = dag.get_num2_int(); + int num2_leaf = dag.get_num2_leaf(); + /* to prepare for the backward we first need to zero the weights */ + dag.w.fill({0.0}); + + int * dag_nodes = dag.nodes.get_data(); + int idx_nodes = 2 * (num2_int + num2_leaf) - 1; + + DOUBLE_TYPE * dag_coefs = dag.coeffs.get_data(); + int idx_coefs = ndensity * (num2_int + num2_leaf) - 1; + + for (int idx = num1+num2_int+num2_leaf - 1; idx >= num1; idx--) { + i2 = dag_nodes[idx_nodes]; idx_nodes--; + i1 = dag_nodes[idx_nodes]; idx_nodes--; + AA1 = dag.AAbuf(i1); + AA2 = dag.AAbuf(i2); + wcur = dag.w(idx); // [***] + for (int p = ndensity-1; p >= 0; p--, idx_coefs--) + wcur += dF_drho(p) * dag_coefs[idx_coefs]; + dag.w(i1) += wcur * AA2; // TODO: replace with explicit muladd? + dag.w(i2) += wcur * AA1; + } + + /* [***] + * Note that these weights don't really need to be stored for the + * leaf nodes. We tested splitting this for loop into two where + * for the leaf nodes the weight would just be initialized to 0.0 + * instead of reading from an array. The improvement was barely + * measurable, ca 3%, so we reverted to this simpler algorithm + */ + + + } else { + + // non-recursive ACE.jl style implemenation of gradients, but with + // a backward differentiation approach to the prod-A + // (cf. Algorithm 3 in the manuscript) + + dag.w.fill({0.0}); + ACEComplex AAf{1.0}, AAb{1.0}, theta{0.0}; + + int *AAspec = jl_AAspec_flat.get_data(); + DOUBLE_TYPE *coeffs = jl_coeffs.get_data(); + int idx_spec = 0; + int idx_coefs = 0; + int order = 0; + int max_order = jl_AAspec.get_dim(1); + for (int iAA = 0; iAA < jl_AAspec.get_dim(0); iAA ++ ) { + order = jl_orders(iAA); + theta = 0.0; + for (int p = 0; p < ndensity; p++, idx_coefs++) + theta += dF_drho(p) * coeffs[idx_coefs]; + dA[0] = 1.0; + AAf = 1.0; + for (int t = 0; t < order-1; t++, idx_spec++) { + spec[t] = AAspec[idx_spec]; + A_cache[t] = dag.AAbuf(spec[t]); + AAf *= A_cache[t]; + dA[t+1] = AAf; + } + spec[order-1] = AAspec[idx_spec]; idx_spec++; + A_cache[order-1] = dag.AAbuf(spec[order-1]); + AAb = 1.0; + for (int t = order-1; t >= 1; t--) { + AAb *= A_cache[t]; + dA[t-1] *= AAb; + dag.w(spec[t]) += theta * dA[t]; + } + dag.w(spec[0]) += theta * dA[0]; + } + + } + + /* STAGE 3: + * get the gradients from the 1-particle basis gradients and write them + * into the dF/drho derivatives. + */ + /* In order to reuse the original PACE code, we copy the weights back + * into the the PACE datastructure. */ + + for (int idx = 0; idx < num1; idx++) { + int m = dag.Aspec(idx, 3); + if (m >= 0) { + weights(dag.Aspec(idx, 0), // mu + dag.Aspec(idx, 1) - 1, // n + dag.Aspec(idx, 2), // l + m ) += dag.w(idx); + } else { + int factor = (m % 2 == 0 ? 1 : -1); + weights(dag.Aspec(idx, 0), // mu + dag.Aspec(idx, 1) - 1, // n + dag.Aspec(idx, 2), // l + -m ) += factor * dag.w(idx).conjugated(); + } + } + + + /* ------ From here we are now back to the original PACE code ---- */ + +// ==================== FORCES ==================== +#ifdef PRINT_MAIN_STEPS + printf("\nFORCE CALCULATION\n"); + printf("loop over neighbours\n"); +#endif + +// loop over neighbour atoms for force calculations + for (jj = 0; jj < jnum_actual; ++jj) { + mu_j = elements[jj]; + r_hat = rhats[jj]; + inv_r_norm = inv_r_norms[jj]; + + Array2DLM &Y_cache_jj = Y_cache(jj); + Array2DLM &DY_cache_jj = DY_cache(jj); + +#ifdef PRINT_LOOPS_INDICES + printf("\nneighbour atom #%d\n", jj); + printf("rhat = (%f, %f, %f)\n", r_hat[0], r_hat[1], r_hat[2]); +#endif + + forces_calc_neighbour_timer.start(); + + f_ji[0] = f_ji[1] = f_ji[2] = 0; + +//for rank = 1 + for (n = 0; n < nradbasei; ++n) { + if (weights_rank1(mu_j, n) == 0) + continue; + auto &DG = DG_cache(jj, n); + DGR = DG * Y00; + DGR *= weights_rank1(mu_j, n); +#ifdef DEBUG_FORCES_CALCULATIONS + printf("r=1: (n,l,m)=(%d, 0, 0)\n",n+1); + printf("\tGR(n=%d, r=%f)=%f\n",n+1,r_norm, gr(n)); + printf("\tDGR(n=%d, r=%f)=%f\n",n+1,r_norm, dgr(n)); + printf("\tdF+=(%f, %f, %f)\n",DGR * r_hat[0], DGR * r_hat[1], DGR * r_hat[2]); +#endif + f_ji[0] += DGR * r_hat[0]; + f_ji[1] += DGR * r_hat[1]; + f_ji[2] += DGR * r_hat[2]; + } + +//for rank > 1 + for (n = 0; n < nradiali; n++) { + for (l = 0; l <= lmaxi; l++) { + R_over_r = R_cache(jj, n, l) * inv_r_norm; + DR = DR_cache(jj, n, l); + + // for m>=0 + for (m = 0; m <= l; m++) { + ACEComplex w = weights(mu_j, n, l, m); + if (w == 0) + continue; + //counting for -m cases if m>0 + // if (m > 0) w *= 2; // not needed for recursive eval + + DY = DY_cache_jj(l, m); + Y_DR = Y_cache_jj(l, m) * DR; + + grad_phi_nlm.a[0] = Y_DR * r_hat[0] + DY.a[0] * R_over_r; + grad_phi_nlm.a[1] = Y_DR * r_hat[1] + DY.a[1] * R_over_r; + grad_phi_nlm.a[2] = Y_DR * r_hat[2] + DY.a[2] * R_over_r; +#ifdef DEBUG_FORCES_CALCULATIONS + printf("d_phi(n=%d, l=%d, m=%d) = ((%f,%f), (%f,%f), (%f,%f))\n",n+1,l,m, + grad_phi_nlm.a[0].real, grad_phi_nlm.a[0].img, + grad_phi_nlm.a[1].real, grad_phi_nlm.a[1].img, + grad_phi_nlm.a[2].real, grad_phi_nlm.a[2].img); + + printf("weights(n,l,m)(%d,%d,%d) = (%f,%f)\n", n+1, l, m, w.real, w.img); + //if (m>0) w*=2; + printf("dF(n,l,m)(%d, %d, %d) += (%f, %f, %f)\n", n + 1, l, m, + w.real_part_product(grad_phi_nlm.a[0]), + w.real_part_product(grad_phi_nlm.a[1]), + w.real_part_product(grad_phi_nlm.a[2]) + ); +#endif +// real-part multiplication only + f_ji[0] += w.real_part_product(grad_phi_nlm.a[0]); + f_ji[1] += w.real_part_product(grad_phi_nlm.a[1]); + f_ji[2] += w.real_part_product(grad_phi_nlm.a[2]); + } + } + } + + +#ifdef PRINT_INTERMEDIATE_VALUES + printf("f_ji(jj=%d, i=%d)=(%f, %f, %f)\n", jj, i, + f_ji[0], f_ji[1], f_ji[2] + ); +#endif + + //hard-core repulsion + DCR = DCR_cache(jj); +#ifdef DEBUG_FORCES_CALCULATIONS + printf("DCR = %f\n",DCR); +#endif + f_ji[0] += dF_drho_core * DCR * r_hat[0]; + f_ji[1] += dF_drho_core * DCR * r_hat[1]; + f_ji[2] += dF_drho_core * DCR * r_hat[2]; +#ifdef PRINT_INTERMEDIATE_VALUES + printf("with core-repulsion\n"); + printf("f_ji(jj=%d, i=%d)=(%f, %f, %f)\n", jj, i, + f_ji[0], f_ji[1], f_ji[2] + ); + printf("neighbour_index_mapping[jj=%d]=%d\n",jj,neighbour_index_mapping[jj]); +#endif + + neighbours_forces(neighbour_index_mapping[jj], 0) = f_ji[0]; + neighbours_forces(neighbour_index_mapping[jj], 1) = f_ji[1]; + neighbours_forces(neighbour_index_mapping[jj], 2) = f_ji[2]; + + forces_calc_neighbour_timer.stop(); + }// end loop over neighbour atoms for forces + + forces_calc_loop_timer.stop(); + + //now, energies and forces are ready + //energies(i) = evdwl + rho_core; + e_atom = evdwl_cut; + +#ifdef PRINT_INTERMEDIATE_VALUES + printf("energies(i) = FS(...rho_p_accum...) = %f\n", evdwl); +#endif + per_atom_calc_timer.stop(); +} \ No newline at end of file diff --git a/lib/pace/ace_recursive.h b/lib/pace/ace_recursive.h new file mode 100644 index 0000000000..78e74feb86 --- /dev/null +++ b/lib/pace/ace_recursive.h @@ -0,0 +1,247 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Christoph Ortner on 20.12.2020 + +#ifndef ACE_RECURSIVE_H +#define ACE_RECURSIVE_H + +#include "ace_abstract_basis.h" +#include "ace_arraynd.h" +#include "ace_array2dlm.h" +#include "ace_c_basis.h" +#include "ace_complex.h" +#include "ace_timing.h" +#include "ace_types.h" +#include "ace_evaluator.h" + +#include +#include +#include +#include +#include + +using namespace std; + + +typedef pair, vector > TPARTITION; +typedef list TPARTITIONS; + +typedef map, int> TDAGMAP; + +class ACEDAG { + + TPARTITIONS find_2partitions(vector v); + + void insert_node(TDAGMAP &dagmap, + vector node, + vector c); + + // the following fields are used only for *construction*, not evaluation + int dag_idx; // current index of dag node + Array2D nodes_pre; //TODO: YL: better to use vector<> + Array2D coeffs_pre; //TODO: YL: better to use vector<> + Array1D haschild; //TODO: YL: better to use vector<> + + /* which heuristic to choose for DAG construction? + * 0 : the simple original heuristic + * 1 : prioritize 2-correlation nodes and build the rest from those + */ + int heuristic = 0; + +public: + + ACEDAG() = default; + + void init(Array2D Aspec, Array2D AAspec, + Array1D orders, Array2D coeffs, + int heuristic ); + + Array1D AAbuf; + Array1D w; + + Array2D Aspec; + + // nodes in the graph + Array2D nodes; + Array2D coeffs; + + // total number of nodes in the dag + int num_nodes; + // number of interior nodes (with children) + int num2_int; + // number of leaf nodes (nc = no child) + int num2_leaf; + + + // number of 1-particle basis functions + // (these will be stored in the first num1 entries of AAbuf) + int get_num1() { return Aspec.get_dim(0); }; + // total number of n-correlation basis functions n > 1. + int get_num2() { return num_nodes - get_num1(); }; + int get_num2_int() { return num2_int; }; // with children + int get_num2_leaf() { return num2_leaf; }; // without children + + // debugging tool + void print(); +}; + + +/** + * Recursive Variant of the ACETildeEvaluator; should be 100% compatible + */ +class ACERecursiveEvaluator : public ACEEvaluator { + + /** + * Weights \f$ \omega_{i \mu n 0 0} \f$ for rank = 1, see Eq.(10) from implementation notes, + * 'i' is fixed for the current atom, shape: [nelements][nradbase] + */ + Array2D weights_rank1 = Array2D("weights_rank1"); + + /** + * Weights \f$ \omega_{i \mu n l m} \f$ for rank > 1, see Eq.(10) from implementation notes, + * 'i' is fixed for the current atom, shape: [nelements][nradbase][l=0..lmax, m] + */ + Array4DLM weights = Array4DLM("weights"); + + /** + * cache for gradients of \f$ g(r)\f$: grad_phi(jj,n)=A2DLM(l,m) + * shape:[max_jnum][nradbase] + */ + Array2D DG_cache = Array2D("DG_cache"); + + + /** + * cache for \f$ R_{nl}(r)\f$ + * shape:[max_jnum][nradbase][0..lmax] + */ + Array3D R_cache = Array3D("R_cache"); + /** + * cache for derivatives of \f$ R_{nl}(r)\f$ + * shape:[max_jnum][nradbase][0..lmax] + */ + Array3D DR_cache = Array3D("DR_cache"); + /** + * cache for \f$ Y_{lm}(\hat{r})\f$ + * shape:[max_jnum][0..lmax][m] + */ + Array3DLM Y_cache = Array3DLM("Y_cache"); + /** + * cache for \f$ \nabla Y_{lm}(\hat{r})\f$ + * shape:[max_jnum][0..lmax][m] + */ + Array3DLM DY_cache = Array3DLM("dY_dense_cache"); + + /** + * cache for derivatives of hard-core repulsion + * shape:[max_jnum] + */ + Array1D DCR_cache = Array1D("DCR_cache"); + + /** + * Partial derivatives \f$ dB_{i \mu n l m t}^{(r)} \f$ with sequential numbering over [func_ind][ms_ind][r], + * shape:[func_ms_r_ind] + */ + Array1D dB_flatten = Array1D("dB_flatten"); + + /** + * pointer to the ACEBasisSet object + */ + ACECTildeBasisSet *basis_set = nullptr; + + /** + * Initialize internal arrays according to basis set sizes + * @param basis_set + */ + void init(ACECTildeBasisSet *basis_set, int heuristic); + + /* convert the PACE to the ACE.jl format to prepare for DAG construction*/ + Array2D jl_Aspec; + Array2D jl_AAspec; + Array1D jl_AAspec_flat; + Array1D jl_orders; + Array2D jl_coeffs; + void acejlformat(); + + /* the main event : the computational graph */ + ACEDAG dag; + + bool recursive = true; + +public: + + + ACERecursiveEvaluator() = default; + + explicit ACERecursiveEvaluator(ACECTildeBasisSet &bas, + bool recursive = true) { + set_recursive(recursive); + set_basis(bas); + } + + /** + * set the basis function to the ACE evaluator + * @param bas + */ + void set_basis(ACECTildeBasisSet &bas, int heuristic = 0); + + /** + * The key method to compute energy and forces for atom 'i'. + * Method will update the "e_atom" variable and "neighbours_forces(jj, alpha)" array + * + * @param i atom index + * @param x atomic positions array of the real and ghost atoms, shape: [atom_ind][3] + * @param type atomic types array of the real and ghost atoms, shape: [atom_ind] + * @param jnum number of neighbours of atom_i + * @param jlist array of neighbour indices, shape: [jnum] + */ + void compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) override; + + /** + * Resize all caches over neighbours atoms + * @param max_jnum maximum number of neighbours + */ + void resize_neighbours_cache(int max_jnum) override; + + /******* public functions related to recursive evaluator ********/ + + // print out the DAG for visual inspection + void print_dag() {dag.print();} + + // print out the jl format for visual inspection + // should be converted into a proper test + void test_acejlformat(); + + void set_recursive(bool tf) { recursive = tf; } + + /********************************/ + +}; + + +#endif //ACE_RECURSIVE_H \ No newline at end of file diff --git a/lib/pace/ace_spherical_cart.cpp b/lib/pace/ace_spherical_cart.cpp new file mode 100644 index 0000000000..f1f0fccced --- /dev/null +++ b/lib/pace/ace_spherical_cart.cpp @@ -0,0 +1,221 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Ralf Drautz, Yury Lysogorskiy + +#include + +#include "ace_spherical_cart.h" + +ACECartesianSphericalHarmonics::ACECartesianSphericalHarmonics(LS_TYPE lm) { + init(lm); +} + +void ACECartesianSphericalHarmonics::init(LS_TYPE lm) { + lmax = lm; + + alm.init(lmax, "alm"); + blm.init(lmax, "blm"); + cl.init(lmax + 1); + dl.init(lmax + 1); + + plm.init(lmax, "plm"); + dplm.init(lmax, "dplm"); + + ylm.init(lmax, "ylm"); + dylm.init(lmax, "dylm"); + + pre_compute(); +} + +/** +Destructor for ACECartesianSphericalHarmonics. + +@param None + +@returns None +*/ +ACECartesianSphericalHarmonics::~ACECartesianSphericalHarmonics() {} + + +void ACECartesianSphericalHarmonics::pre_compute() { + + DOUBLE_TYPE a, b; + DOUBLE_TYPE lsq, ld, l1, l2; + DOUBLE_TYPE msq; + + for (LS_TYPE l = 1; l <= lmax; l++) { + lsq = l * l; + ld = 2 * l; + l1 = (4 * lsq - 1); + l2 = lsq - ld + 1; + for (MS_TYPE m = 0; m < l - 1; m++) { + msq = m * m; + a = sqrt((DOUBLE_TYPE(l1)) / (DOUBLE_TYPE(lsq - msq))); + b = -sqrt((DOUBLE_TYPE(l2 - msq)) / (DOUBLE_TYPE(4 * l2 - 1))); + alm(l, m) = a; + blm(l, m) = b; + } + } + + for (LS_TYPE l = 1; l <= lmax; l++) { + cl(l) = -sqrt(1.0 + 0.5 / (DOUBLE_TYPE(l))); + dl(l) = sqrt(DOUBLE_TYPE(2 * (l - 1) + 3)); + } +} + + +void ACECartesianSphericalHarmonics::compute_barplm(DOUBLE_TYPE rz, LS_TYPE lmaxi) { + + // requires -1 <= rz <= 1 , NO CHECKING IS PERFORMED !!!!!!!!! + // prefactors include 1/sqrt(2) factor compared to reference + DOUBLE_TYPE t; + + // l=0, m=0 + //plm(0, 0) = Y00/sq1o4pi; //= sq1o4pi; + plm(0, 0) = Y00; //= 1; + dplm(0, 0) = 0.0; + + if (lmaxi > 0) { + + // l=1, m=0 + plm(1, 0) = Y00 * sq3 * rz; + dplm(1, 0) = Y00 * sq3; + + // l=1, m=1 + plm(1, 1) = -sq3o2 * Y00; + dplm(1, 1) = 0.0; + + // loop l = 2, lmax + for (LS_TYPE l = 2; l <= lmaxi; l++) { + for (MS_TYPE m = 0; m < l - 1; m++) { + plm(l, m) = alm(l, m) * (rz * plm(l - 1, m) + blm(l, m) * plm(l - 2, m)); + dplm(l, m) = alm(l, m) * (plm(l - 1, m) + rz * dplm(l - 1, m) + blm(l, m) * dplm(l - 2, m)); + } + t = dl(l) * plm(l - 1, l - 1); + plm(l, l - 1) = t * rz; + dplm(l, l - 1) = t; + plm(l, l) = cl(l) * plm(l - 1, l - 1); + dplm(l, l) = 0.0; + } + } +} //end compute_barplm + + +void ACECartesianSphericalHarmonics::compute_ylm(DOUBLE_TYPE rx, DOUBLE_TYPE ry, DOUBLE_TYPE rz, LS_TYPE lmaxi) { + + // requires rx^2 + ry^2 + rz^2 = 1 , NO CHECKING IS PERFORMED !!!!!!!!! + + DOUBLE_TYPE real; + DOUBLE_TYPE img; + MS_TYPE m; + ACEComplex phase; + ACEComplex phasem, mphasem1; + ACEComplex dyx, dyy, dyz; + ACEComplex rdy; + + phase.real = rx; + phase.img = ry; + //compute barplm + compute_barplm(rz, lmaxi); + + //m = 0 + m = 0; + for (LS_TYPE l = 0; l <= lmaxi; l++) { + + ylm(l, m).real = plm(l, m); + ylm(l, m).img = 0.0; + + dyz.real = dplm(l, m); + rdy.real = dyz.real * rz; + + dylm(l, m).a[0].real = -rdy.real * rx; + dylm(l, m).a[0].img = 0.0; + dylm(l, m).a[1].real = -rdy.real * ry; + dylm(l, m).a[1].img = 0.0; + dylm(l, m).a[2].real = dyz.real - rdy.real * rz; + dylm(l, m).a[2].img = 0; + } + //m = 0 + m = 1; + for (LS_TYPE l = 1; l <= lmaxi; l++) { + + ylm(l, m) = phase * plm(l, m); + +// std::cout << "Re ylm(" << l << "," << m <<")= " << ylm(l, m).real << std::endl; +// std::cout << "Im ylm(" << l << "," << m <<")= " << ylm(l, m).img << std::endl; + + dyx.real = plm(l, m); + dyx.img = 0.0; + dyy.real = 0.0; + dyy.img = plm(l, m); + dyz.real = phase.real * dplm(l, m); + dyz.img = phase.img * dplm(l, m); + + rdy.real = rx * dyx.real + +rz * dyz.real; + rdy.img = ry * dyy.img + rz * dyz.img; + + dylm(l, m).a[0].real = dyx.real - rdy.real * rx; + dylm(l, m).a[0].img = -rdy.img * rx; + dylm(l, m).a[1].real = -rdy.real * ry; + dylm(l, m).a[1].img = dyy.img - rdy.img * ry; + dylm(l, m).a[2].real = dyz.real - rdy.real * rz; + dylm(l, m).a[2].img = dyz.img - rdy.img * rz; + } + + // m > 1 + phasem = phase; + for (MS_TYPE m = 2; m <= lmaxi; m++) { + + mphasem1.real = phasem.real * DOUBLE_TYPE(m); + mphasem1.img = phasem.img * DOUBLE_TYPE(m); + phasem = phasem * phase; + + for (LS_TYPE l = m; l <= lmaxi; l++) { + + ylm(l, m).real = phasem.real * plm(l, m); + ylm(l, m).img = phasem.img * plm(l, m); + + dyx = mphasem1 * plm(l, m); + dyy.real = -dyx.img; + dyy.img = dyx.real; + dyz = phasem * dplm(l, m); + + rdy.real = rx * dyx.real + ry * dyy.real + rz * dyz.real; + rdy.img = rx * dyx.img + ry * dyy.img + rz * dyz.img; + + dylm(l, m).a[0].real = dyx.real - rdy.real * rx; + dylm(l, m).a[0].img = dyx.img - rdy.img * rx; + dylm(l, m).a[1].real = dyy.real - rdy.real * ry; + dylm(l, m).a[1].img = dyy.img - rdy.img * ry; + dylm(l, m).a[2].real = dyz.real - rdy.real * rz; + dylm(l, m).a[2].img = dyz.img - rdy.img * rz; + } + } + +} + diff --git a/lib/pace/ace_spherical_cart.h b/lib/pace/ace_spherical_cart.h new file mode 100644 index 0000000000..b2a0cb5913 --- /dev/null +++ b/lib/pace/ace_spherical_cart.h @@ -0,0 +1,134 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Ralf Drautz, Yury Lysogorskiy + +#ifndef ACE_SPHERICAL_CART_H +#define ACE_SPHERICAL_CART_H + +#include + +#include "ace_arraynd.h" +#include "ace_array2dlm.h" +#include "ace_complex.h" +#include "ace_types.h" + + +using namespace std; + +const DOUBLE_TYPE sq1o4pi = 0.28209479177387814347; // sqrt(1/(4*pi)) +const DOUBLE_TYPE sq4pi = 3.54490770181103176384; // sqrt(4*pi) +const DOUBLE_TYPE sq3 = 1.73205080756887719318;//sqrt(3), numpy +const DOUBLE_TYPE sq3o2 = 1.22474487139158894067;//sqrt(3/2), numpy + +//definition of common factor for spherical harmonics = Y00 +//const DOUBLE_TYPE Y00 = sq1o4pi; +const DOUBLE_TYPE Y00 = 1; + +/** +Class to store spherical harmonics and their associated functions. \n +All the associated members such as \f$ P_{lm}, Y_{lm}\f$ etc are one dimensional arrays of length (L+1)*(L+2)/2. \n +The value that corresponds to a particular l, m configuration can be accessed through a \code ylm(l,m) \endcode \n +*/ +class ACECartesianSphericalHarmonics { +public: + + /** + int, the number of spherical harmonics to be found + */ + LS_TYPE lmax; + + /** + * Default constructor + */ + ACECartesianSphericalHarmonics() = default; + + /** + * Parametrized constructor. Dynamically initialises all the arrays. + * @param lmax maximum orbital moment + */ + explicit ACECartesianSphericalHarmonics(LS_TYPE lmax); + + /** + * Initialize internal arrays and precompute necessary coefficients + * @param lm maximum orbital moment + */ + void init(LS_TYPE lm); + + /** + * Destructor + */ + ~ACECartesianSphericalHarmonics(); + + /** + * Precompute necessaary helper arrays Precomputes the value of \f$ a_{lm}, b_{lm}, c_l, d_l \f$ + */ + void pre_compute(); + + /** + Function that computes \f$ \bar{P}_{lm} \f$ for the corresponding lmax value + Input is \f$ \hat{r}_z \f$ which is the $z$-component of the bond direction. + + For each \f$ \hat{r}_z \f$, this computes the whole range of \f$ \bar{P}_{lm} \f$ values + and its derivatives upto the lmax specified, which is a member of the class. + + @param rz, DOUBLE_TYPE + + @returns None + */ + void compute_barplm(DOUBLE_TYPE rz, LS_TYPE lmaxi); + + /** + Function that computes \f$ Y_{lm} \f$ for the corresponding lmax value + Input is the bond-directon vector \f$ \hat{r}_x, \hat{r}_y, \hat{r}_z \f$ + + Each \f$ Y_{lm} \f$ value is a ACEComplex object with real and imaginary parts. This function also + finds the derivatives, which are stored in the Dycomponent class, with each component being a + ACEComplex object. + + @param rx, DOUBLE_TYPE + @param ry, DOUBLE_TYPE + @param rz, DOUBLE_TYPE + @param lmaxi, int + */ + void compute_ylm(DOUBLE_TYPE rx, DOUBLE_TYPE ry, DOUBLE_TYPE rz, LS_TYPE lmaxi); + + Array2DLM alm; + Array2DLM blm; + Array1D cl; + Array1D dl; + + Array2DLM plm; + Array2DLM dplm; + + Array2DLM ylm; ///< Values of all spherical harmonics after \code compute_ylm(rx,ry,rz, lmaxi) \endcode call + Array2DLM dylm;///< Values of gradients of all spherical harmonics after \code compute_ylm(rx,ry,rz, lmaxi) \endcode call + +}; + + +#endif diff --git a/lib/pace/ace_timing.h b/lib/pace/ace_timing.h new file mode 100644 index 0000000000..7f5243eb99 --- /dev/null +++ b/lib/pace/ace_timing.h @@ -0,0 +1,126 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Yury Lysogorskiy on 19.02.20. + +#ifndef ACE_TIMING_H +#define ACE_TIMING_H + +#include + +using namespace std::chrono; +using Clock = std::chrono::high_resolution_clock; +using TimePoint = std::chrono::time_point; +using Duration = Clock::duration; + +////////////////////////////////////////// +#ifdef FINE_TIMING +/** + * Helper class for timing the code. + * The timer should be initialized to reset measured time and + * then call "start" and "stop" before and after measured code. + * The measured time is stored in "duration" variable + */ +struct ACETimer { + Duration duration; ///< measured duration + TimePoint start_moment; ///< start moment of current measurement + + ACETimer() { init(); }; + + /** + * Reset timer + */ + void init() { duration = std::chrono::nanoseconds(0); } + + /** + * Start timer + */ + void start() { start_moment = Clock::now(); } + + /** + * Stop timer, update measured "duration" + */ + void stop() { duration += Clock::now() - start_moment; } + + /** + * Get duration in microseconds + */ + long as_microseconds() { return std::chrono::duration_cast(duration).count(); } + + /** + * Get duration in nanoseconds + */ + long as_nanoseconds() { return std::chrono::duration_cast(duration).count(); } + +}; + +#else // EMPTY Definitions +/** + * Helper class for timing the code. + * The timer should be initialized to reset measured time and + * then call "start" and "stop" before and after measured code. + * The measured time is stored in "duration" variable + */ +struct ACETimer { + Duration duration; ///< measured duration + TimePoint start_moment; ///< start moment of current measurement + + ACETimer() {}; + + /** + * Reset timer + */ + void init() {} + + /** + * Start timer + */ + void start() {} + + /** + * Stop timer, update measured "duration" + */ + void stop() {} + + /** + * Get duration in microseconds + */ + long as_microseconds() {return 0; } + + /** + * Get duration in nanoseconds + */ + long as_nanoseconds() {return 0; } + +}; + +#endif +////////////////////////////////////////// + + +#endif //ACE_TIMING_H diff --git a/lib/pace/ace_types.h b/lib/pace/ace_types.h new file mode 100644 index 0000000000..f9b3cf7267 --- /dev/null +++ b/lib/pace/ace_types.h @@ -0,0 +1,45 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Yury Lysogorskiy on 20.01.20. + +#ifndef ACE_TYPES_H +#define ACE_TYPES_H + +typedef char RANK_TYPE; +typedef int SPECIES_TYPE; +typedef short int NS_TYPE; +typedef short int LS_TYPE; + +typedef short int DENSITY_TYPE; + +typedef short int MS_TYPE; + +typedef short int SHORT_INT_TYPE; +typedef double DOUBLE_TYPE; + +#endif \ No newline at end of file diff --git a/lib/pace/ace_version.h b/lib/pace/ace_version.h new file mode 100644 index 0000000000..9d61e5c505 --- /dev/null +++ b/lib/pace/ace_version.h @@ -0,0 +1,39 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Lysogorskiy Yury on 07.04.2020. + +#ifndef ACE_VERSION_H +#define ACE_VERSION_H + +#define VERSION_YEAR 2021 +#define VERSION_MONTH 2 +#define VERSION_DAY 3 + +#endif //ACE_VERSION_Hls + diff --git a/lib/pace/ships_radial.cpp b/lib/pace/ships_radial.cpp new file mode 100644 index 0000000000..e948f03f21 --- /dev/null +++ b/lib/pace/ships_radial.cpp @@ -0,0 +1,388 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Created by Christoph Ortner on 03.06.2020 + +#include "ships_radial.h" + +#include +#include +#include + + +using namespace std; + +void SHIPsRadPolyBasis::_init(DOUBLE_TYPE r0, int p, DOUBLE_TYPE rcut, + DOUBLE_TYPE xl, DOUBLE_TYPE xr, + int pl, int pr, size_t maxn) { + this->p = p; + this->r0 = r0; + this->rcut = rcut; + this->xl = xl; + this->xr = xr; + this->pl = pl; + this->pr = pr; + this->maxn = maxn; + this->A.resize(maxn); + this->B.resize(maxn); + this->C.resize(maxn); + this->P.resize(maxn); + this->dP_dr.resize(maxn); +} + + +void SHIPsRadPolyBasis::fread(FILE *fptr) +{ + int res; //for fscanf result + int maxn, p, pl, pr, ntests; + double r0, xl, xr, a, b, c, rcut; + + // transform parameters + res = fscanf(fptr, "transform parameters: p=%d r0=%lf\n", &p, &r0); + if (res != 2) + throw invalid_argument("Couldn't read line: transform parameters: p=%d r0=%lf"); + // cutoff parameters + res = fscanf(fptr, "cutoff parameters: rcut=%lf xl=%lf xr=%lf pl=%d pr=%d\n", + &rcut, &xl, &xr, &pl, &pr); + if (res != 5) + throw invalid_argument("Couldn't read cutoff parameters: rcut=%lf xl=%lf xr=%lf pl=%d pr=%d"); + // basis size + res = fscanf(fptr, "recursion coefficients: maxn = %d\n", &maxn); + if (res != 1) + throw invalid_argument("Couldn't read recursion coefficients: maxn = %d"); + // initialize and allocate + this->_init(r0, p, rcut, xl, xr, pl, pr, maxn); + + // read basis coefficients + for (int i = 0; i < maxn; i++) { + res = fscanf(fptr, " %lf %lf %lf\n", &a, &b, &c); + if (res != 3) + throw invalid_argument("Couldn't read line: A_n B_n C_n"); + this->A(i) = DOUBLE_TYPE(a); + this->B(i) = DOUBLE_TYPE(b); + this->C(i) = DOUBLE_TYPE(c); + } + + // // check there are no consistency tests (I don't have time to fix this now) + // res = fscanf(fptr, "tests: ntests = %d\n", &ntests); + // if (res != 1) + // throw invalid_argument("Couldn't read line: tests: ntests = %d"); + // if (ntests != 0) + // throw invalid_argument("must have ntests = 0!"); + + // --------------------------------------------------------------------- + // run the consistency test this could be moved into a separate function + double r, Pn, dPn; + double err = 0.0; + + res = fscanf(fptr, "tests: ntests = %d\n", &ntests); + if (res != 1) + throw invalid_argument("Couldn't read line: tests: ntests = %d"); + for (size_t itest = 0; itest < ntests; itest++) { + // read an r argument + res = fscanf(fptr, " r=%lf\n", &r); + // printf("r = %lf \n", r); + if (res != 1) + throw invalid_argument("Couldn't read line: r=%lf"); + // printf("test %d, r=%f, maxn=%d \n", itest, r, maxn); + // evaluate the basis + this->calcP(r, maxn, SPECIES_TYPE(0), SPECIES_TYPE(0)); + // compare against the stored values + for (size_t n = 0; n < maxn; n++) { + res = fscanf(fptr, " %lf %lf\n", &Pn, &dPn); + if (res != 2) + throw invalid_argument("Couldn't read test value line: %lf %lf"); + err = max(err, abs(Pn - this->P(n)) + abs(dPn - this->dP_dr(n))); + // printf(" %d %e %e \n", int(n), + // abs(Pn - this->P(n)), + // abs(dPn - this->dP_dr(n))); + } + } + if (ntests > 0) + printf("Maximum Test error = %e\n", err); + // --------------------------------------------------------------------- + +} + + + + +size_t SHIPsRadPolyBasis::get_maxn() +{ + return this->maxn; +} + + +// Julia code: ((1+r0)/(1+r))^p +void SHIPsRadPolyBasis::transform(const DOUBLE_TYPE r, DOUBLE_TYPE &x_out, DOUBLE_TYPE &dx_out) const { + x_out = pow((1 + r0) / (1 + r), p); // ==pow( (1 + r) / (1 + r0), -p ); + dx_out = -p * pow((1 + r) / (1 + r0), -p - 1) / (1 + r0); +} + +void SHIPsRadPolyBasis::fcut(const DOUBLE_TYPE x, DOUBLE_TYPE &f_out, DOUBLE_TYPE &df_out) const { + if ( ((x < xl) && (pl > 0)) || ((x > xr) && (pr > 0)) ) { + f_out = 0.0; + df_out = 0.0; + } else { + f_out = pow(x - xl, pl) * pow(x - xr, pr); + df_out = pl * pow(x - xl, pl - 1) * pow(x - xr, pr) + pow(x - xl, pl) * pr * pow(x - xr, pr - 1); + } +} + + /* ------------------------------------------------------------------------ +Julia Code +P[1] = J.A[1] * _fcut_(J.pl, J.tl, J.pr, J.tr, t) +if length(J) == 1; return P; end +P[2] = (J.A[2] * t + J.B[2]) * P[1] +@inbounds for n = 3:length(J) + P[n] = (J.A[n] * t + J.B[n]) * P[n-1] + J.C[n] * P[n-2] +end +return P +------------------------------------------------------------------------ */ + +void SHIPsRadPolyBasis::calcP(DOUBLE_TYPE r, size_t maxn, + SPECIES_TYPE z1, SPECIES_TYPE z2) { + if (maxn > this->maxn) + throw invalid_argument("Given maxn couldn't be larger than global maxn"); + + if (maxn > P.get_size()) + throw invalid_argument("Given maxn couldn't be larger than global length of P"); + + DOUBLE_TYPE x, dx_dr; // dx -> dx/dr + transform(r, x, dx_dr); + // printf("r = %f, x = %f, fcut = %f \n", r, x, fcut(x)); + DOUBLE_TYPE f, df_dx; + fcut(x, f, df_dx); // df -> df/dx + + //fill with zeros + P.fill(0); + dP_dr.fill(0); + + P(0) = A(0) * f; + dP_dr(0) = A(0) * df_dx * dx_dr; // dP/dr; chain rule: df_cut/dr = df_cut/dx * dx/dr + if (maxn > 0) { + P(1) = (A(1) * x + B(1)) * P(0); + dP_dr(1) = A(1) * dx_dr * P(0) + (A(1) * x + B(1)) * dP_dr(0); + } + for (size_t n = 2; n < maxn; n++) { + P(n) = (A(n) * x + B(n)) * P(n - 1) + C(n) * P(n - 2); + dP_dr(n) = A(n) * dx_dr * P(n - 1) + (A(n) * x + B(n)) * dP_dr(n - 1) + C(n) * dP_dr(n - 2); + } +} + + +// ==================================================================== + + +bool SHIPsRadialFunctions::has_pair() { + return this->haspair; +} + +void SHIPsRadialFunctions::load(string fname) { + FILE * fptr = fopen(fname.data(), "r"); + size_t res = fscanf(fptr, "radbasename=ACE.jl.Basic\n"); + if (res != 0) + throw("SHIPsRadialFunctions::load : couldnt read radbasename=ACE.jl.Basic"); + this->fread(fptr); + fclose(fptr); +} + +void SHIPsRadialFunctions::fread(FILE *fptr){ + int res; + size_t maxn; + char hasE0, haspair; + DOUBLE_TYPE c; + + // check whether we have a pair potential + res = fscanf(fptr, "haspair: %c\n", &haspair); + if (res != 1) + throw("SHIPsRadialFunctions::load : couldn't read haspair"); + + // read the radial basis + this->radbasis.fread(fptr); + + // read the pair potential + if (haspair == 't') { + this->haspair=true; + fscanf(fptr, "begin repulsive potential\n"); + fscanf(fptr, "begin polypairpot\n"); + // read the basis parameters + pairbasis.fread(fptr); + maxn = pairbasis.get_maxn(); + // read the coefficients + fscanf(fptr, "coefficients\n"); + paircoeffs.resize(maxn); + for (size_t n = 0; n < maxn; n++) { + fscanf(fptr, "%lf\n", &c); + paircoeffs(n) = c; + } + fscanf(fptr, "end polypairpot\n"); + // read the spline parameters + fscanf(fptr, "spline parameters\n"); + fscanf(fptr, " e_0 + B exp(-A*(r/ri-1)) * (ri/r)\n"); + fscanf(fptr, "ri=%lf\n", &(this->ri)); + fscanf(fptr, "e0=%lf\n", &(this->e0)); + fscanf(fptr, "A=%lf\n", &(this->A)); + fscanf(fptr, "B=%lf\n", &(this->B)); + fscanf(fptr, "end repulsive potential\n"); + } +} + + +size_t SHIPsRadialFunctions::get_maxn() +{ + return this->radbasis.get_maxn(); +} + +DOUBLE_TYPE SHIPsRadialFunctions::get_rcut() +{ + return max(radbasis.rcut, pairbasis.rcut); +} + + +void SHIPsRadialFunctions::fill_gk(DOUBLE_TYPE r, NS_TYPE maxn, SPECIES_TYPE z1, SPECIES_TYPE z2) { + radbasis.calcP(r, maxn, z1, z2); + for (NS_TYPE n = 0; n < maxn; n++) { + gr(n) = radbasis.P(n); + dgr(n) = radbasis.dP_dr(n); + } +} + + +void SHIPsRadialFunctions::fill_Rnl(DOUBLE_TYPE r, NS_TYPE maxn, SPECIES_TYPE z1, SPECIES_TYPE z2) { + radbasis.calcP(r, maxn, z1, z2); + for (NS_TYPE n = 0; n < maxn; n++) { + for (LS_TYPE l = 0; l <= lmax; l++) { + fr(n, l) = radbasis.P(n); + dfr(n, l) = radbasis.dP_dr(n); + } + } +} + + +void SHIPsRadialFunctions::setuplookupRadspline() { +} + + +void SHIPsRadialFunctions::init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, + SPECIES_TYPE nelements, + DOUBLE_TYPE cutoff, string radbasename) { + //mimic ACERadialFunctions::init + this->nradbase = nradb; + this->lmax = lmax; + this->nradial = nradial; + this->deltaSplineBins = deltaSplineBins; + this->nelements = nelements; + this->cutoff = cutoff; + this->radbasename = radbasename; + + gr.init(nradbase, "gr"); + dgr.init(nradbase, "dgr"); + + + fr.init(nradial, lmax + 1, "fr"); + dfr.init(nradial, lmax + 1, "dfr"); + + splines_gk.init(nelements, nelements, "splines_gk"); + splines_rnl.init(nelements, nelements, "splines_rnl"); + splines_hc.init(nelements, nelements, "splines_hc"); + + lambda.init(nelements, nelements, "lambda"); + lambda.fill(1.); + + cut.init(nelements, nelements, "cut"); + cut.fill(1.); + + dcut.init(nelements, nelements, "dcut"); + dcut.fill(1.); + + crad.init(nelements, nelements, (lmax + 1), nradial, nradbase, "crad"); + crad.fill(0.); + + //hard-core repulsion + prehc.init(nelements, nelements, "prehc"); + prehc.fill(0.); + + lambdahc.init(nelements, nelements, "lambdahc"); + lambdahc.fill(1.); +} + + +void SHIPsRadialFunctions::evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, + SPECIES_TYPE mu_j, bool calc_second_derivatives) { + if (calc_second_derivatives) + throw invalid_argument("SHIPsRadialFunctions has not `calc_second_derivatives` option"); + + radbasis.calcP(r, nradbase_c, mu_i, mu_j); + for (NS_TYPE nr = 0; nr < nradbase_c; nr++) { + gr(nr) = radbasis.P(nr); + dgr(nr) = radbasis.dP_dr(nr); + } + for (NS_TYPE nr = 0; nr < nradial_c; nr++) { + for (LS_TYPE l = 0; l <= this->lmax; l++) { + fr(nr, l) = radbasis.P(nr); + dfr(nr, l) = radbasis.dP_dr(nr); + } + } + + if (this->has_pair()) + this->evaluate_pair(r, mu_i, mu_j); + else { + cr = 0; + dcr = 0; + } +} + +void SHIPsRadialFunctions::evaluate_pair(DOUBLE_TYPE r, + SPECIES_TYPE mu_i, + SPECIES_TYPE mu_j, + bool calc_second_derivatives) { + // spline_hc.calcSplines(r); + // cr = spline_hc.values(0); + // dcr = spline_hc.derivatives(0); + + // the outer polynomial potential + if (r > ri) { + pairbasis.calcP(r, pairbasis.get_maxn(), mu_i, mu_j); + cr = 0; + dcr = 0; + for (size_t n = 0; n < pairbasis.get_maxn(); n++) { + cr += paircoeffs(n) * pairbasis.P(n); + dcr += paircoeffs(n) * pairbasis.dP_dr(n); + } + } + else { // the repulsive core part + cr = e0 + B * exp(-A * (r/ri - 1)) * (ri/r); + dcr = B * exp( - A * (r/ri-1) ) * ri * ( - A / ri / r - 1/(r*r) ); + } + // fix double-counting + cr *= 0.5; + dcr *= 0.5; +} + + + diff --git a/lib/pace/ships_radial.h b/lib/pace/ships_radial.h new file mode 100644 index 0000000000..60a82448cd --- /dev/null +++ b/lib/pace/ships_radial.h @@ -0,0 +1,158 @@ +/* + * Performant implementation of atomic cluster expansion and interface to LAMMPS + * + * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + * + * ^1: Ruhr-University Bochum, Bochum, Germany + * ^2: University of Cambridge, Cambridge, United Kingdom + * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + * ^4: University of British Columbia, Vancouver, BC, Canada + * + * + * See the LICENSE file. + * This FILENAME is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +// Created by Christoph Ortner on 03.06.2020 + +#ifndef SHIPs_RADIAL_FUNCTIONS_H +#define SHIPs_RADIAL_FUNCTIONS_H + +#include "ace_arraynd.h" +#include "ace_types.h" +#include "ace_radial.h" + +class SHIPsRadPolyBasis { + +public: + + // transform parameters + int p = 0; + DOUBLE_TYPE r0 = 0.0; + + // cutoff parameters + DOUBLE_TYPE rcut = 0.0; + DOUBLE_TYPE xl = 0.0; + DOUBLE_TYPE xr = 0.0; + int pl = 0; + int pr = 0; + + // basis size + size_t maxn = 0; + + // recursion parameters + Array1D A = Array1D("SHIPs radial basis: A"); + Array1D B = Array1D("SHIPs radial basis: B"); + Array1D C = Array1D("SHIPs radial basis: C"); + + // temporary storage for evaluating the basis + Array1D P = Array1D("SHIPs radial basis: P"); + Array1D dP_dr = Array1D("SHIPs radial basis: dP"); + +////////////////////////////////// + + SHIPsRadPolyBasis() = default; + + ~SHIPsRadPolyBasis() = default; + + // distance transform + void transform(const DOUBLE_TYPE r, DOUBLE_TYPE &x_out, DOUBLE_TYPE &dx_out) const; + + // cutoff function + void fcut(const DOUBLE_TYPE x, DOUBLE_TYPE &f_out, DOUBLE_TYPE &df_out) const; + + void fread(FILE *fptr); + + void _init(DOUBLE_TYPE r0, int p, DOUBLE_TYPE rcut, + DOUBLE_TYPE xl, DOUBLE_TYPE xr, + int pl, int pr, size_t maxn); + + void calcP(DOUBLE_TYPE r, size_t maxn, SPECIES_TYPE z1, SPECIES_TYPE z2); + + size_t get_maxn(); + +}; + + + + +class SHIPsRadialFunctions : public AbstractRadialBasis { +public: + + // radial basis + SHIPsRadPolyBasis radbasis; + + // pair potential basis + bool haspair = false; + SHIPsRadPolyBasis pairbasis; + + // pair potential coefficients + Array1D paircoeffs = Array1D("SHIPs pairpot coeffs: paircoeffs"); + + // spline parameters for repulsive core + DOUBLE_TYPE ri = 0.0; + DOUBLE_TYPE e0 = 0.0; + DOUBLE_TYPE A = 0.0; + DOUBLE_TYPE B = 0.0; + +////////////////////////////////// + + SHIPsRadialFunctions() = default; + + ~SHIPsRadialFunctions() override = default; + + + void fread(FILE *fptr); + + void load(string fname); + + size_t get_maxn(); + DOUBLE_TYPE get_rcut(); + + bool has_pair(); + + void init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, SPECIES_TYPE nelements, + DOUBLE_TYPE cutoff, + string radbasename) override; + + void + evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, + bool calc_second_derivatives = false) override; + + void + evaluate_pair(DOUBLE_TYPE r, SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, + bool calc_second_derivatives = false); + + void setuplookupRadspline() override; + + SHIPsRadialFunctions *clone() const override { + return new SHIPsRadialFunctions(*this); + }; + + /** + * Helper method, that populate `fr` and `dfr` 2D-arrays (n,l) with P(n), dP_dr for given coordinate r + * @param r + * @param maxn + * @param z1 + * @param z2 + */ + void fill_Rnl(DOUBLE_TYPE r, NS_TYPE maxn, SPECIES_TYPE z1, SPECIES_TYPE z2); + + void fill_gk(DOUBLE_TYPE r, NS_TYPE maxn, SPECIES_TYPE z1, SPECIES_TYPE z2); +}; + + +#endif diff --git a/src/Makefile b/src/Makefile index a63c49e344..bec0a2b16b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -63,7 +63,7 @@ PACKLIB = compress gpu kim kokkos latte message mpiio mscg poems \ python voronoi \ user-adios user-atc user-awpmd user-colvars user-h5md user-lb user-molfile \ user-netcdf user-plumed user-qmmm user-quip user-scafacos \ - user-smd user-vtk user-mesont + user-smd user-vtk user-mesont user-pace PACKSYS = compress mpiio python user-lb @@ -71,7 +71,7 @@ PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars user-mesont PACKEXT = kim latte mscg voronoi \ user-adios user-h5md user-molfile user-netcdf user-plumed user-qmmm user-quip \ - user-smd user-vtk + user-smd user-vtk user-pace PACKALL = $(PACKAGE) $(PACKUSER) diff --git a/src/USER-PACE/Install.sh b/src/USER-PACE/Install.sh new file mode 100644 index 0000000000..4d87b0e3ed --- /dev/null +++ b/src/USER-PACE/Install.sh @@ -0,0 +1,68 @@ +# Install.sh file that integrates the settings from the lib folder into the conventional build process (make build?) + +# COPIED FROM src/KIM/Install.sh: + +# # Install/unInstall package files in LAMMPS +# # mode = 0/1/2 for uninstall/install/update + +# mode=$1 + +# # enforce using portable C locale +# LC_ALL=C +# export LC_ALL + +# # arg1 = file, arg2 = file it depends on + +# action () { +# if (test $mode = 0) then +# rm -f ../$1 +# elif (! cmp -s $1 ../$1) then +# if (test -z "$2" || test -e ../$2) then +# cp $1 .. +# if (test $mode = 2) then +# echo " updating src/$1" +# fi +# fi +# elif (test -n "$2") then +# if (test ! -e ../$2) then +# rm -f ../$1 +# fi +# fi +# } + +# # all package files with no dependencies + +# for file in *.cpp *.h; do +# test -f ${file} && action $file +# done + +# # edit 2 Makefile.package files to include/exclude package info + +# if (test $1 = 1) then + +# if (test -e ../Makefile.package) then +# sed -i -e 's/[^ \t]*kim[^ \t]* //' ../Makefile.package +# sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(kim_SYSINC) |' ../Makefile.package +# sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(kim_SYSLIB) |' ../Makefile.package +# sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(kim_SYSPATH) |' ../Makefile.package +# fi + +# if (test -e ../Makefile.package.settings) then +# sed -i -e '/^include.*kim.*$/d' ../Makefile.package.settings +# # multiline form needed for BSD sed on Macs +# sed -i -e '4 i \ +# include ..\/..\/lib\/kim\/Makefile.lammps +# ' ../Makefile.package.settings +# fi + +# elif (test $1 = 0) then + +# if (test -e ../Makefile.package) then +# sed -i -e 's/[^ \t]*kim[^ \t]* //' ../Makefile.package +# fi + +# if (test -e ../Makefile.package.settings) then +# sed -i -e '/^include.*kim.*$/d' ../Makefile.package.settings +# fi + +# fi diff --git a/src/USER-PACE/LICENSE b/src/USER-PACE/LICENSE new file mode 100644 index 0000000000..f288702d2f --- /dev/null +++ b/src/USER-PACE/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp new file mode 100644 index 0000000000..a515b7b4b0 --- /dev/null +++ b/src/USER-PACE/pair_pace.cpp @@ -0,0 +1,458 @@ +/* +Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + +^1: Ruhr-University Bochum, Bochum, Germany +^2: University of Cambridge, Cambridge, United Kingdom +^3: Sandia National Laboratories, Albuquerque, New Mexico, USA +^4: University of British Columbia, Vancouver, BC, Canada + + + This FILENAME is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + +// +// Created by Lysogorskiy Yury on 27.02.20. +// + +#include +#include +#include +#include +#include "pair_pace.h" +#include "atom.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "force.h" +#include "comm.h" +#include "memory.h" +#include "error.h" + + +#include "math_const.h" + +#include "ace_version.h" + +using namespace LAMMPS_NS; +using namespace MathConst; + +#define MAXLINE 1024 +#define DELTA 4 + +//added YL + +//keywords for ACE evaluator style +#define RECURSIVE_KEYWORD "recursive" +#define PRODUCT_KEYWORD "product" + + +int elements_num_pace = 104; +char const *const elements_pace[104] = {"X", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", + "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", + "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", + "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", + "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", + "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", + "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", + "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr" +}; + +int AtomicNumberByName_pace(char *elname) { + for (int i = 1; i < elements_num_pace; i++) + if (strcmp(elname, elements_pace[i]) == 0) + return i; + return -1; +} + + +/* ---------------------------------------------------------------------- */ +PairPACE::PairPACE(LAMMPS *lmp) : Pair(lmp) { + //single_enable = 0; + restartinfo = 0; + one_coeff = 1; + manybody_flag = 1; + + nelements = 0; + + ace = NULL; + potential_file_name = NULL; + elements = NULL; + map = NULL; +} + +/* ---------------------------------------------------------------------- + check if allocated, since class can be destructed when incomplete +------------------------------------------------------------------------- */ + +PairPACE::~PairPACE() { + if (copymode) return; + + if (elements) + for (int i = 0; i < nelements; i++) delete[] elements[i]; + delete[] elements; + + + delete[] potential_file_name; + + delete basis_set; + delete ace; + + if (allocated) { + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(map); + memory->destroy(scale); + } +} + +/* ---------------------------------------------------------------------- */ + +void PairPACE::compute(int eflag, int vflag) { + int i, j, ii, jj, inum, jnum; + double delx, dely, delz, evdwl; + double fij[3]; + int *ilist, *jlist, *numneigh, **firstneigh; + + ev_init(eflag, vflag); + + // downwards modified by YL + + double **x = atom->x; + double **f = atom->f; + tagint *tag = atom->tag; + int *type = atom->type; + + // number of atoms in cell + int nlocal = atom->nlocal; + + int newton_pair = force->newton_pair; + + // number of atoms including ghost atoms + int nall = nlocal + atom->nghost; + + // inum: length of the neighborlists list + inum = list->inum; + + // ilist: list of "i" atoms for which neighbor lists exist + ilist = list->ilist; + + //numneigh: the length of each these neigbor list + numneigh = list->numneigh; + + // the pointer to the list of neighbors of "i" + firstneigh = list->firstneigh; + + if (inum != nlocal) { + char str[128]; + snprintf(str,128,"inum: %d nlocal: %d are different",inum, nlocal); + error->all(FLERR,str); + } + + + // Aidan Thompson told RD (26 July 2019) that practically always holds: + // inum = nlocal + // i = ilist(ii) < inum + // j = jlist(jj) < nall + // neighborlist contains neighbor atoms plus skin atoms, + // skin atoms can be removed by setting skin to zero but here + // they are disregarded anyway + + + //determine the maximum number of neighbours + int max_jnum = -1; + int nei = 0; + for (ii = 0; ii < list->inum; ii++) { + i = ilist[ii]; + jnum = numneigh[i]; + nei = nei + jnum; + if (jnum > max_jnum) + max_jnum = jnum; + } + + ace->resize_neighbours_cache(max_jnum); + + //loop over atoms + for (ii = 0; ii < list->inum; ii++) { + i = list->ilist[ii]; + const int itype = type[i]; + + const double xtmp = x[i][0]; + const double ytmp = x[i][1]; + const double ztmp = x[i][2]; + + jlist = firstneigh[i]; + jnum = numneigh[i]; + + // checking if neighbours are actually within cutoff range is done inside compute_atom + // mapping from LAMMPS atom types ('type' array) to ACE species is done inside compute_atom + // by using 'ace->element_type_mapping' array + // x: [r0 ,r1, r2, ..., r100] + // i = 0 ,1 + // jnum(0) = 50 + // jlist(neigh ind of 0-atom) = [1,2,10,7,99,25, .. 50 element in total] + try { + ace->compute_atom(i, x, type, jnum, jlist); + } catch (exception &e) { + error->all(FLERR, e.what()); + exit(EXIT_FAILURE); + } + // 'compute_atom' will update the `ace->e_atom` and `ace->neighbours_forces(jj, alpha)` arrays + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + const int jtype = type[j]; + j &= NEIGHMASK; + delx = x[j][0] - xtmp; + dely = x[j][1] - ytmp; + delz = x[j][2] - ztmp; + + fij[0] = scale[itype][jtype]*ace->neighbours_forces(jj, 0); + fij[1] = scale[itype][jtype]*ace->neighbours_forces(jj, 1); + fij[2] = scale[itype][jtype]*ace->neighbours_forces(jj, 2); + + + f[i][0] += fij[0]; + f[i][1] += fij[1]; + f[i][2] += fij[2]; + f[j][0] -= fij[0]; + f[j][1] -= fij[1]; + f[j][2] -= fij[2]; + + // tally per-atom virial contribution + if (vflag) + ev_tally_xyz(i, j, nlocal, newton_pair, 0.0, 0.0, + fij[0], fij[1], fij[2], + -delx, -dely, -delz); + } + + // tally energy contribution + if (eflag) { + // evdwl = energy of atom I + evdwl = scale[1][1]*ace->e_atom; + ev_tally_full(i, 2.0 * evdwl, 0.0, 0.0, 0.0, 0.0, 0.0); + } + } + + if (vflag_fdotr) virial_fdotr_compute(); + + + // end modifications YL +} + +/* ---------------------------------------------------------------------- */ + +void PairPACE::allocate() { + allocated = 1; + int n = atom->ntypes; + + memory->create(setflag, n + 1, n + 1, "pair:setflag"); + memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); + memory->create(map, n + 1, "pair:map"); + memory->create(scale, n + 1, n + 1,"pair:scale"); +} + +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +void PairPACE::settings(int narg, char **arg) { + if (narg > 1) { + error->all(FLERR, + "Illegal pair_style command. Correct form:\n\tpair_style pace\nor\n\tpair_style pace "); + error->all(FLERR, RECURSIVE_KEYWORD); + error->all(FLERR, "or\n\tpair_style pace "); + error->all(FLERR, PRODUCT_KEYWORD); + } + recursive = true; // default evaluator style: RECURSIVE + if (narg > 0) { + if (strcmp(arg[0], RECURSIVE_KEYWORD) == 0) + recursive = true; + else if (strcmp(arg[0], PRODUCT_KEYWORD) == 0) { + recursive = false; + } else { + error->all(FLERR, + "Illegal pair_style command: pair_style pace "); + error->all(FLERR, arg[0]); + error->all(FLERR, "\nCorrect form:\n\tpair_style pace\nor\n\tpair_style pace recursive"); + } + } + + if (comm->me == 0) { + if (screen) fprintf(screen, "ACE version: %d.%d.%d\n", VERSION_YEAR, VERSION_MONTH, VERSION_DAY); + if (logfile) fprintf(logfile, "ACE version: %d.%d.%d\n", VERSION_YEAR, VERSION_MONTH, VERSION_DAY); + + if (recursive) { + if (screen) fprintf(screen, "Recursive evaluator is used\n"); + if (logfile) fprintf(logfile, "Recursive evaluator is used\n"); + } else { + if (screen) fprintf(screen, "Product evaluator is used\n"); + if (logfile) fprintf(logfile, "Product evaluator is used\n"); + } + } + + +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ + +void PairPACE::coeff(int narg, char **arg) { + + if (narg < 4) + error->all(FLERR, + "Incorrect args for pair coefficients. Correct form:\npair_coeff * * elem1 elem2 ..."); + + if (!allocated) allocate(); + + //number of provided elements in pair_coeff line + int ntypes_coeff = narg - 3; + + if (ntypes_coeff != atom->ntypes) { + char error_message[1024]; + snprintf(error_message, 1024, + "Incorrect args for pair coefficients. You provided %d elements in pair_coeff, but structure has %d atom types", + ntypes_coeff, atom->ntypes); + error->all(FLERR, error_message); + } + + char *type1 = arg[0]; + char *type2 = arg[1]; + char *potential_file_name = arg[2]; + char **elemtypes = &arg[3]; + + // insure I,J args are * * + + if (strcmp(type1, "*") != 0 || strcmp(type2, "*") != 0) + error->all(FLERR, "Incorrect args for pair coefficients"); + + + //load potential file + basis_set = new ACECTildeBasisSet(); + if (comm->me == 0) { + if (screen) fprintf(screen, "Loading %s\n", potential_file_name); + if (logfile) fprintf(logfile, "Loading %s\n", potential_file_name); + } + basis_set->load(potential_file_name); + + if (comm->me == 0) { + if (screen) fprintf(screen, "Total number of basis functions\n"); + if (logfile) fprintf(logfile, "Total number of basis functions\n"); + + for (SPECIES_TYPE mu = 0; mu < basis_set->nelements; mu++) { + int n_r1 = basis_set->total_basis_size_rank1[mu]; + int n = basis_set->total_basis_size[mu]; + if (screen) fprintf(screen, "\t%s: %d (r=1) %d (r>1)\n", basis_set->elements_name[mu].c_str(), n_r1, n); + if (logfile) fprintf(logfile, "\t%s: %d (r=1) %d (r>1)\n", basis_set->elements_name[mu].c_str(), n_r1, n); + } + } + + // read args that map atom types to pACE elements + // map[i] = which element the Ith atom type is, -1 if not mapped + // map[0] is not used + + ace = new ACERecursiveEvaluator(); + ace->set_recursive(recursive); + ace->element_type_mapping.init(atom->ntypes + 1); + + for (int i = 1; i <= atom->ntypes; i++) { + char *elemname = elemtypes[i - 1]; + int atomic_number = AtomicNumberByName_pace(elemname); + if (atomic_number == -1) { + char error_msg[1024]; + snprintf(error_msg, 1024, "String '%s' is not a valid element\n", elemname); + error->all(FLERR, error_msg); + } + SPECIES_TYPE mu = basis_set->get_species_index_by_name(elemname); + if (mu != -1) { + if (comm->me == 0) { + if (screen) + fprintf(screen, "Mapping LAMMPS atom type #%d(%s) -> ACE species type #%d\n", i, elemname, mu); + if (logfile) + fprintf(logfile, "Mapping LAMMPS atom type #%d(%s) -> ACE species type #%d\n", i, elemname, mu); + } + map[i] = mu; + ace->element_type_mapping(i) = mu; // set up LAMMPS atom type to ACE species mapping for ace evaluator + } else { + char error_msg[1024]; + snprintf(error_msg, 1024, "Element %s is not supported by ACE-potential from file %s", elemname, + potential_file_name); + error->all(FLERR, error_msg); + } + } + + // clear setflag since coeff() called once with I,J = * * + int n = atom->ntypes; + for (int i = 1; i <= n; i++) { + for (int j = i; j <= n; j++) { + setflag[i][j] = 1; + scale[i][j] = 1.0; + } + } + + // set setflag i,j for type pairs where both are mapped to elements + + int count = 1; + for (int i = 1; i <= n; i++) + for (int j = i; j <= n; j++) + if (map[i] >= 0 && map[j] >= 0) { + setflag[i][j] = 1; + count++; + } + + if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients"); + + ace->set_basis(*basis_set, 1); +} + +/* ---------------------------------------------------------------------- + init specific to this pair style +------------------------------------------------------------------------- */ + +void PairPACE::init_style() { + if (atom->tag_enable == 0) + error->all(FLERR, "Pair style pACE requires atom IDs"); + if (force->newton_pair == 0) + error->all(FLERR, "Pair style pACE requires newton pair on"); + + // request a full neighbor list + int irequest = neighbor->request(this, instance_me); + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +double PairPACE::init_one(int i, int j) { + if (setflag[i][j] == 0) error->all(FLERR, "All pair coeffs are not set"); + //cutoff from the basis set's radial functions settings + scale[j][i] = scale[i][j]; + return basis_set->radial_functions->cut(map[i], map[j]); +} + +/* ---------------------------------------------------------------------- + extract method for extracting value of scale variable + ---------------------------------------------------------------------- */ +void *PairPACE::extract(const char *str, int &dim) +{ + dim = 2; + if (strcmp(str,"scale") == 0) return (void *) scale; + return NULL; +} + diff --git a/src/USER-PACE/pair_pace.h b/src/USER-PACE/pair_pace.h new file mode 100644 index 0000000000..3fccbd98f0 --- /dev/null +++ b/src/USER-PACE/pair_pace.h @@ -0,0 +1,97 @@ +/* +Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, + Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, + Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 + +^1: Ruhr-University Bochum, Bochum, Germany +^2: University of Cambridge, Cambridge, United Kingdom +^3: Sandia National Laboratories, Albuquerque, New Mexico, USA +^4: University of British Columbia, Vancouver, BC, Canada + + + This FILENAME is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + + +// +// Created by Lysogorskiy Yury on 27.02.20. +// + + +#ifdef PAIR_CLASS + +PairStyle(pace,PairPACE) + +#else + +#ifndef LMP_PAIR_PACE_H +#define LMP_PAIR_PACE_H + +#include "pair.h" +#include "ace_evaluator.h" +#include "ace_recursive.h" +#include "ace_c_basis.h" + +namespace LAMMPS_NS { + + class PairPACE : public Pair { + public: + PairPACE(class LAMMPS *); + + virtual ~PairPACE(); + + virtual void compute(int, int); + + void settings(int, char **); + + void coeff(int, char **); + + virtual void init_style(); + + double init_one(int, int); + + void *extract(const char *, int &); + + // virtual double memory_usage(); + + protected: + ACECTildeBasisSet *basis_set = nullptr; + + ACERecursiveEvaluator *ace = nullptr; + + char *potential_file_name; + + virtual void allocate(); + + void read_files(char *, char *); + + inline int equal(double *x, double *y); + + + double rcutmax; // max cutoff for all elements + int nelements; // # of unique elements + char **elements; // names of unique elements + + int *map; // mapping from atom types to elements + int *jlist_local; + int *type_local; + double **scale; + + bool recursive = false; // "recursive" option for ACERecursiveEvaluator + }; + +} + +#endif +#endif \ No newline at end of file From 3de33027677ec318fe2d0f2f80a63ac35671ca07 Mon Sep 17 00:00:00 2001 From: Yury Lysogorskiy Date: Wed, 7 Apr 2021 12:20:24 +0200 Subject: [PATCH 02/23] remove source files from lib/pace; add lib/pace/Install.py to automatically download the source files from github/ICAMS/lammps-user-pace; add lib/pace/CMakeLists.txt to build libpace.a add lib/pace/README update src/USER-PACE/Install.sh --- lib/pace/CMakeLists.txt | 19 + lib/pace/Install.py | 112 +- lib/pace/LICENSE | 674 ----------- lib/pace/README | 9 + lib/pace/ace_abstract_basis.cpp | 184 --- lib/pace/ace_abstract_basis.h | 169 --- lib/pace/ace_array2dlm.h | 579 --------- lib/pace/ace_arraynd.h | 1949 ------------------------------- lib/pace/ace_c_basis.cpp | 980 ---------------- lib/pace/ace_c_basis.h | 155 --- lib/pace/ace_c_basisfunction.h | 251 ---- lib/pace/ace_complex.h | 266 ----- lib/pace/ace_contigous_array.h | 249 ---- lib/pace/ace_evaluator.cpp | 660 ----------- lib/pace/ace_evaluator.h | 230 ---- lib/pace/ace_flatten_basis.cpp | 130 --- lib/pace/ace_flatten_basis.h | 135 --- lib/pace/ace_radial.cpp | 566 --------- lib/pace/ace_radial.h | 324 ----- lib/pace/ace_recursive.cpp | 1340 --------------------- lib/pace/ace_recursive.h | 247 ---- lib/pace/ace_spherical_cart.cpp | 221 ---- lib/pace/ace_spherical_cart.h | 134 --- lib/pace/ace_timing.h | 126 -- lib/pace/ace_types.h | 45 - lib/pace/ace_version.h | 39 - lib/pace/ships_radial.cpp | 388 ------ lib/pace/ships_radial.h | 158 --- src/USER-PACE/Install.sh | 104 +- 29 files changed, 189 insertions(+), 10254 deletions(-) create mode 100644 lib/pace/CMakeLists.txt delete mode 100644 lib/pace/LICENSE delete mode 100644 lib/pace/ace_abstract_basis.cpp delete mode 100644 lib/pace/ace_abstract_basis.h delete mode 100644 lib/pace/ace_array2dlm.h delete mode 100644 lib/pace/ace_arraynd.h delete mode 100644 lib/pace/ace_c_basis.cpp delete mode 100644 lib/pace/ace_c_basis.h delete mode 100644 lib/pace/ace_c_basisfunction.h delete mode 100644 lib/pace/ace_complex.h delete mode 100644 lib/pace/ace_contigous_array.h delete mode 100644 lib/pace/ace_evaluator.cpp delete mode 100644 lib/pace/ace_evaluator.h delete mode 100644 lib/pace/ace_flatten_basis.cpp delete mode 100644 lib/pace/ace_flatten_basis.h delete mode 100644 lib/pace/ace_radial.cpp delete mode 100644 lib/pace/ace_radial.h delete mode 100644 lib/pace/ace_recursive.cpp delete mode 100644 lib/pace/ace_recursive.h delete mode 100644 lib/pace/ace_spherical_cart.cpp delete mode 100644 lib/pace/ace_spherical_cart.h delete mode 100644 lib/pace/ace_timing.h delete mode 100644 lib/pace/ace_types.h delete mode 100644 lib/pace/ace_version.h delete mode 100644 lib/pace/ships_radial.cpp delete mode 100644 lib/pace/ships_radial.h diff --git a/lib/pace/CMakeLists.txt b/lib/pace/CMakeLists.txt new file mode 100644 index 0000000000..2884c83cb9 --- /dev/null +++ b/lib/pace/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.7) # CMake version check +project(aceevaluator) +set(CMAKE_CXX_STANDARD 11) # Enable c++11 standard + + +set(PACE_EVALUATOR_PATH ${CMAKE_CURRENT_LIST_DIR}/src/USER-PACE) +# message("CMakeLists.txt DEBUG: PACE_EVALUATOR_PATH=${PACE_EVALUATOR_PATH}") +set(PACE_EVALUATOR_SRC_PATH ${PACE_EVALUATOR_PATH}) + +FILE(GLOB PACE_EVALUATOR_SOURCE_FILES ${PACE_EVALUATOR_SRC_PATH}/*.cpp) +list(FILTER PACE_EVALUATOR_SOURCE_FILES EXCLUDE REGEX ".*pair_pace.*") +set(PACE_EVALUATOR_INCLUDE_DIR ${PACE_EVALUATOR_SRC_PATH}) + + +##### aceevaluator ##### +add_library(aceevaluator ${PACE_EVALUATOR_SOURCE_FILES}) +target_include_directories(aceevaluator PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR}) +target_compile_options(aceevaluator PRIVATE -O3) +set_target_properties(aceevaluator PROPERTIES OUTPUT_NAME pace${LAMMPS_MACHINE}) diff --git a/lib/pace/Install.py b/lib/pace/Install.py index f87f5c14cb..640971e011 100644 --- a/lib/pace/Install.py +++ b/lib/pace/Install.py @@ -1 +1,111 @@ -# TODO \ No newline at end of file +# TODO#!/usr/bin/env python + +""" +Install.py tool to download, compile, and setup the pace library +used to automate the steps described in the README file in this dir +""" + +from __future__ import print_function +import sys, os, subprocess, shutil +from argparse import ArgumentParser + +sys.path.append('..') +from install_helpers import fullpath, geturl, checkmd5sum + +parser = ArgumentParser(prog='Install.py', + description="LAMMPS library build wrapper script") + +# settings + +thisdir = fullpath('.') +version = "v.2021.2.3" + +# known checksums for different PACE versions. used to validate the download. +checksums = { \ + 'v.2021.2.3' : '9ebb087cba7e4ca041fde52f7e9e640c', \ + } + + +# help message + +HELP = """ +Syntax from src dir: make lib-pace args="-b" + or: make lib-pace args="-b -v version" +Syntax from lib dir: python Install.py -b + or: python Install.py -b -v version + +Examples: + +make lib-pace args="-b" # install default version of PACE lib +make lib-pace args="-b -v version" # install specified version of PACE lib + + +""" + +pgroup = parser.add_mutually_exclusive_group() +pgroup.add_argument("-b", "--build", action="store_true", + help="download and build base PACE library") +parser.add_argument("-v", "--version", default=version, choices=checksums.keys(), + help="set version of PACE library to download and build (default: %s)" % version) +parser.add_argument("-vv", "--verbose", action="store_true", + help="be more verbose about is happening while this script runs") + +args = parser.parse_args() + +# print help message and exit, if neither build nor path options are given +if not args.build: + parser.print_help() + sys.exit(HELP) + +buildflag = args.build + +verboseflag = args.verbose +version = args.version + + +archive_extension = "tar.gz" +url = "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/%s.%s" % (version, archive_extension) +unarchived_folder_name = "lammps-user-pace-%s"%(version) + +# download PACE tarball, unpack, build PACE +if buildflag: + + # download entire tarball + + print("Downloading pace tarball ...") + archive_filename = "%s.%s" % (version, archive_extension) + download_filename = "%s/%s" % (thisdir, archive_filename) + print("Downloading from ",url," to ",download_filename, end=" ") + geturl(url, download_filename) + print(" done") + + # verify downloaded archive integrity via md5 checksum, if known. + if version in checksums: + if not checkmd5sum(checksums[version], archive_filename): + sys.exit("Checksum for pace library does not match") + + print("Unpacking pace tarball ...") + src_folder = thisdir+"/src" + cmd = 'cd "%s"; rm -rf "%s"; tar -xvf %s; mv %s %s' % (thisdir, src_folder, archive_filename, unarchived_folder_name, src_folder) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + + # configure + + build_folder = "%s/build"%(thisdir) + print("Configuring libpace ...") + cmd = 'cd %s && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release' % (thisdir) + txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + if verboseflag: print(txt.decode("UTF-8")) + + # build + print("Building libpace ...") + cmd = 'cd "%s" && make -j2 && cp libpace.a %s/' % (build_folder, thisdir) + txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) + if verboseflag: + print(txt.decode("UTF-8")) + +# remove source files + + print("Removing pace build files and archive ...") + cmd = 'rm %s; rm -rf %s' % (download_filename, build_folder) + subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) \ No newline at end of file diff --git a/lib/pace/LICENSE b/lib/pace/LICENSE deleted file mode 100644 index f288702d2f..0000000000 --- a/lib/pace/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/lib/pace/README b/lib/pace/README index e69de29bb2..e9a1ab820a 100644 --- a/lib/pace/README +++ b/lib/pace/README @@ -0,0 +1,9 @@ +This directory contains files required to use the USER-PACE package. + +You can type "make lib-pace" from the src directory to see help on +how to download and build this library via make commands, or you can +do the same thing by typing "python Install.py" from within this +directory. + + + diff --git a/lib/pace/ace_abstract_basis.cpp b/lib/pace/ace_abstract_basis.cpp deleted file mode 100644 index 3d8afafdaf..0000000000 --- a/lib/pace/ace_abstract_basis.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Lysogorskiy Yury on 28.04.2020. - -#include "ace_abstract_basis.h" - -////embedding function -////case nemb = 1 only implementation -////F = sign(x)*( ( 1 - exp(-(w*x)^3) )*abs(x)^m + ((1/w)^(m-1))*exp(-(w*x)^3)*abs(x) ) -//// !! no prefactor wpre -void Fexp(DOUBLE_TYPE x, DOUBLE_TYPE m, DOUBLE_TYPE &F, DOUBLE_TYPE &DF) { - DOUBLE_TYPE w = 1.e6; - DOUBLE_TYPE eps = 1e-10; - - DOUBLE_TYPE lambda = pow(1.0 / w, m - 1.0); - if (abs(x) > eps) { - DOUBLE_TYPE g; - DOUBLE_TYPE a = abs(x); - DOUBLE_TYPE am = pow(a, m); - DOUBLE_TYPE w3x3 = pow(w * a, 3); - DOUBLE_TYPE sign_factor = (signbit(x) ? -1 : 1); - if (w3x3 > 30.0) - g = 0.0; - else - g = exp(-w3x3); - - DOUBLE_TYPE omg = 1.0 - g; - F = sign_factor * (omg * am + lambda * g * a); - DOUBLE_TYPE dg = -3.0 * w * w * w * a * a * g; - DF = m * pow(a, m - 1.0) * omg - am * dg + lambda * dg * a + lambda * g; - } else { - F = lambda * x; - DF = lambda; - } -} - - -//Scaled-shifted embedding function -//F = sign(x)*( ( 1 - exp(-(w*x)^3) )*abs(x)^m + ((1/w)^(m-1))*exp(-(w*x)^3)*abs(x) ) -// !! no prefactor wpre -void FexpShiftedScaled(DOUBLE_TYPE rho, DOUBLE_TYPE mexp, DOUBLE_TYPE &F, DOUBLE_TYPE &DF) { - DOUBLE_TYPE eps = 1e-10; - DOUBLE_TYPE a, xoff, yoff, nx, exprho; - - if (abs(mexp - 1.0) < eps) { - F = rho; - DF = 1; - } else { - a = abs(rho); - exprho = exp(-a); - nx = 1. / mexp; - xoff = pow(nx, (nx / (1.0 - nx))) * exprho; - yoff = pow(nx, (1 / (1.0 - nx))) * exprho; - DOUBLE_TYPE sign_factor = (signbit(rho) ? -1 : 1); - F = sign_factor * (pow(xoff + a, mexp) - yoff); - DF = yoff + mexp * (-xoff + 1.0) * pow(xoff + a, mexp - 1.); - } -} - -void ACEAbstractBasisSet::inner_cutoff(DOUBLE_TYPE rho_core, DOUBLE_TYPE rho_cut, DOUBLE_TYPE drho_cut, - DOUBLE_TYPE &fcut, DOUBLE_TYPE &dfcut) { - - DOUBLE_TYPE rho_low = rho_cut - drho_cut; - if (rho_core >= rho_cut) { - fcut = 0; - dfcut = 0; - } else if (rho_core <= rho_low) { - fcut = 1; - dfcut = 0; - } else { - fcut = 0.5 * (1 + cos(M_PI * (rho_core - rho_low) / drho_cut)); - dfcut = -0.5 * sin(M_PI * (rho_core - rho_low) / drho_cut) * M_PI / drho_cut; - } -} - -void ACEAbstractBasisSet::FS_values_and_derivatives(Array1D &rhos, DOUBLE_TYPE &value, - Array1D &derivatives, DENSITY_TYPE ndensity) { - DOUBLE_TYPE F, DF = 0, wpre, mexp; - for (int p = 0; p < ndensity; p++) { - wpre = FS_parameters.at(p * ndensity + 0); - mexp = FS_parameters.at(p * ndensity + 1); - if (this->npoti == "FinnisSinclair") - Fexp(rhos(p), mexp, F, DF); - else if (this->npoti == "FinnisSinclairShiftedScaled") - FexpShiftedScaled(rhos(p), mexp, F, DF); - value += F * wpre; // * weight (wpre) - derivatives(p) = DF * wpre;// * weight (wpre) - } -} - -void ACEAbstractBasisSet::_clean() { - - delete[] elements_name; - elements_name = nullptr; - delete radial_functions; - radial_functions = nullptr; -} - -ACEAbstractBasisSet::ACEAbstractBasisSet(const ACEAbstractBasisSet &other) { - ACEAbstractBasisSet::_copy_scalar_memory(other); - ACEAbstractBasisSet::_copy_dynamic_memory(other); -} - -ACEAbstractBasisSet &ACEAbstractBasisSet::operator=(const ACEAbstractBasisSet &other) { - if (this != &other) { - // deallocate old memory - ACEAbstractBasisSet::_clean(); - //copy scalar values - ACEAbstractBasisSet::_copy_scalar_memory(other); - //copy dynamic memory - ACEAbstractBasisSet::_copy_dynamic_memory(other); - } - return *this; -} - -ACEAbstractBasisSet::~ACEAbstractBasisSet() { - ACEAbstractBasisSet::_clean(); -} - -void ACEAbstractBasisSet::_copy_scalar_memory(const ACEAbstractBasisSet &src) { - deltaSplineBins = src.deltaSplineBins; - FS_parameters = src.FS_parameters; - npoti = src.npoti; - - nelements = src.nelements; - rankmax = src.rankmax; - ndensitymax = src.ndensitymax; - nradbase = src.nradbase; - lmax = src.lmax; - nradmax = src.nradmax; - cutoffmax = src.cutoffmax; - - spherical_harmonics = src.spherical_harmonics; - - rho_core_cutoffs = src.rho_core_cutoffs; - drho_core_cutoffs = src.drho_core_cutoffs; - - - E0vals = src.E0vals; -} - -void ACEAbstractBasisSet::_copy_dynamic_memory(const ACEAbstractBasisSet &src) {//allocate new memory - if (src.elements_name == nullptr) - throw runtime_error("Could not copy ACEAbstractBasisSet::elements_name - array not initialized"); - elements_name = new string[nelements]; - //copy - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - elements_name[mu] = src.elements_name[mu]; - } - radial_functions = src.radial_functions->clone(); -} - -SPECIES_TYPE ACEAbstractBasisSet::get_species_index_by_name(const string &elemname) { - for (SPECIES_TYPE t = 0; t < nelements; t++) { - if (this->elements_name[t] == elemname) - return t; - } - return -1; -} \ No newline at end of file diff --git a/lib/pace/ace_abstract_basis.h b/lib/pace/ace_abstract_basis.h deleted file mode 100644 index 165ea9496f..0000000000 --- a/lib/pace/ace_abstract_basis.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Lysogorskiy Yury on 28.04.2020. - -#ifndef ACE_EVALUATOR_ACE_ABSTRACT_BASIS_H -#define ACE_EVALUATOR_ACE_ABSTRACT_BASIS_H - -#include -#include - -#include "ace_c_basisfunction.h" -#include "ace_contigous_array.h" -#include "ace_radial.h" -#include "ace_spherical_cart.h" -#include "ace_types.h" - -using namespace std; - -/** - * Abstract basis set class - */ -class ACEAbstractBasisSet { -public: - SPECIES_TYPE nelements = 0; ///< number of elements in basis set - RANK_TYPE rankmax = 0; ///< maximum value of rank - DENSITY_TYPE ndensitymax = 0; ///< maximum number of densities \f$ \rho^{(p)} \f$ - NS_TYPE nradbase = 0; ///< maximum number of radial \f$\textbf{basis}\f$ function \f$ g_{k}(r) \f$ - LS_TYPE lmax = 0; ///< \f$ l_\textrm{max} \f$ - maximum value of orbital moment \f$ l \f$ - NS_TYPE nradmax = 0; ///< maximum number \f$ n \f$ of radial function \f$ R_{nl}(r) \f$ - DOUBLE_TYPE cutoffmax = 0; ///< maximum value of cutoff distance among all species in basis set - DOUBLE_TYPE deltaSplineBins = 0; ///< Spline interpolation density - - string npoti = "FinnisSinclair"; ///< FS and embedding function combination - - string *elements_name = nullptr; ///< Array of elements name for mapping from index (0..nelements-1) to element symbol (string) - - AbstractRadialBasis *radial_functions = nullptr; ///< object to work with radial functions - ACECartesianSphericalHarmonics spherical_harmonics; ///< object to work with spherical harmonics in Cartesian representation - - - Array1D rho_core_cutoffs; ///< energy-based inner cut-off - Array1D drho_core_cutoffs; ///< decay of energy-based inner cut-off - - vector FS_parameters; ///< parameters for cluster functional, see Eq.(3) in implementation notes or Eq.(53) in PRB 99, 014104 (2019) - - // E0 values - Array1D E0vals; - - /** - * Default empty constructor - */ - ACEAbstractBasisSet() = default; - - // copy constructor, operator= and destructor (see. Rule of Three) - - /** - * Copy constructor (see. Rule of Three) - * @param other - */ - ACEAbstractBasisSet(const ACEAbstractBasisSet &other); - - /** - * operator= (see. Rule of Three) - * @param other - * @return - */ - ACEAbstractBasisSet &operator=(const ACEAbstractBasisSet &other); - - /** - * virtual destructor (see. Rule of Three) - */ - virtual ~ACEAbstractBasisSet(); - - /** - * Computing cluster functional \f$ F(\rho_i^{(1)}, \dots, \rho_i^{(P)}) \f$ - * and its derivatives \f$ (\partial F/\partial\rho_i^{(1)}, \dots, \partial F/\partial \rho_i^{(P)} ) \f$ - * @param rhos array with densities \f$ \rho^{(p)} \f$ - * @param value (out) return value of cluster functional - * @param derivatives (out) array of derivatives \f$ (\partial F/\partial\rho_i^{(1)}, \dots, \partial F/\partial \rho_i^{(P)} ) \f$ - * @param ndensity number \f$ P \f$ of densities to use - */ - void FS_values_and_derivatives(Array1D &rhos, DOUBLE_TYPE &value, Array1D &derivatives, - DENSITY_TYPE ndensity); - - /** - * Computing hard core pairwise repulsive potential \f$ f_{cut}(\rho_i^{(\textrm{core})})\f$ and its derivative, - * see Eq.(29) of implementation notes - * @param rho_core value of \f$ \rho_i^{(\textrm{core})} \f$ - * @param rho_cut \f$ \rho_{cut}^{\mu_i} \f$ value - * @param drho_cut \f$ \Delta_{cut}^{\mu_i} \f$ value - * @param fcut (out) return inner cutoff function - * @param dfcut (out) return derivative of inner cutoff function - */ - static void inner_cutoff(DOUBLE_TYPE rho_core, DOUBLE_TYPE rho_cut, DOUBLE_TYPE drho_cut, DOUBLE_TYPE &fcut, - DOUBLE_TYPE &dfcut); - - - /** - * Virtual method to save potential to file - * @param filename file name - */ - virtual void save(const string &filename) = 0; - - /** - * Virtual method to load potential from file - * @param filename file name - */ - virtual void load(const string filename) = 0; - - /** - * Get the species index by its element name - * @param elemname element name - * @return species index - */ - SPECIES_TYPE get_species_index_by_name(const string &elemname); - - - // routines for copying and cleaning dynamic memory of the class (see. Rule of Three) - - /** - * Routine for clean the dynamically allocated memory\n - * IMPORTANT! It must be idempotent for safety. - */ - virtual void _clean(); - - /** - * Copy dynamic memory from src. Must be override and extended in derived classes! - * @param src source object to copy from - */ - virtual void _copy_dynamic_memory(const ACEAbstractBasisSet &src); - - /** - * Copy scalar values from src. Must be override and extended in derived classes! - * @param src source object to copy from - */ - virtual void _copy_scalar_memory(const ACEAbstractBasisSet &src); -}; - -void Fexp(DOUBLE_TYPE rho, DOUBLE_TYPE mexp, DOUBLE_TYPE &F, DOUBLE_TYPE &DF); - -void FexpShiftedScaled(DOUBLE_TYPE rho, DOUBLE_TYPE mexp, DOUBLE_TYPE &F, DOUBLE_TYPE &DF); - -#endif //ACE_EVALUATOR_ACE_ABSTRACT_BASIS_H diff --git a/lib/pace/ace_array2dlm.h b/lib/pace/ace_array2dlm.h deleted file mode 100644 index 2b38602bc7..0000000000 --- a/lib/pace/ace_array2dlm.h +++ /dev/null @@ -1,579 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Yury Lysogorskiy on 11.01.20. - - -#ifndef ACE_ARRAY2DLM_H -#define ACE_ARRAY2DLM_H - -#include -#include - -#include "ace_arraynd.h" -#include "ace_contigous_array.h" -#include "ace_types.h" - -using namespace std; - -/** - * Contiguous array to organize values by \f$ (l,m) \f$ indiced (orbital moment and its projection). - * Only \f$ l_\textrm{max}\f$ should be provided, \f$ m = -l, \dots,l \f$ - * for \f$ l = 0, \dots, l_\textrm{max}\f$ - * @tparam T type of values to store - */ -template -class Array2DLM : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - - LS_TYPE lmax = 0; ///< orbital dimension \f$ l_{max} \f$ - - bool is_proxy = false; ///< flag to show, if object is owning the memory or just represent it (proxying)dimensions - -public: - /** - * Default empty constructor - */ - Array2DLM() = default; - - /** - * Parametrized constructor - * @param lmax maximum value of \f$ l \f$ - * @param array_name name of the array - */ - explicit Array2DLM(LS_TYPE lmax, string array_name = "Array2DLM") { - init(lmax, array_name); - } - - - /** - * Constructor to create slices-proxy array, i.e. to provide access to the memory, but not to own it. - * @param lmax maximum value of \f$ l \f$ - * @param data_ptr pointer to original data - * @param array_name name of the array - */ - Array2DLM(LS_TYPE lmax, T *data_ptr, string array_name = "Array2DLM") { - this->lmax = lmax; - this->size = (lmax + 1) * (lmax + 1); - this->data = data_ptr; - this->array_name = array_name; - is_proxy = true; - }; - - /** - * Destructor - */ - ~Array2DLM() { - if (!is_proxy) { - if (data != nullptr) delete[] data; - } - data = nullptr; - } - - /** - * Initialize array, allocate memory - * @param lmax maximum value of l - * @param array_name name of the array - */ - void init(LS_TYPE lmax, string array_name = "Array2DLM") { - if (is_proxy) { - char s[1024]; - sprintf(s, "Could not re-initialize proxy-array %s\n", this->array_name.c_str()); - throw logic_error(s); - } - this->lmax = lmax; - this->array_name = array_name; - //for m = -l .. l - if (size != (lmax + 1) * (lmax + 1)) { - size = (lmax + 1) * (lmax + 1); - if (data) delete[] data; - data = new T[size]{}; - memset(data, 0.0, size * sizeof(T)); - } else { - memset(data, 0, size * sizeof(T)); - } - } - -#ifdef MULTIARRAY_INDICES_CHECK -/** - * Check if indices (l,m) are within array - */ - void check_indices(LS_TYPE l, MS_TYPE m) const { - - if ((l < 0) | (l > lmax)) { - fprintf(stderr, "%s: Index l = %d out of range (0, %d)\n", array_name.c_str(), l, lmax); - exit(EXIT_FAILURE); - } - - if ((m < -l) | (m > l)) { - fprintf(stderr, "%s: Index m = %d out of range (%d, %d)\n", array_name.c_str(), m, -l, l); - exit(EXIT_FAILURE); - } - size_t ii = l * (l + 1) + m; - if (ii >= size) { - fprintf(stderr, "%s: index = %ld out of range %ld\n", array_name.c_str(), ii, size); - exit(EXIT_FAILURE); - } - } -#endif - - /** - * Accessing the array value by index (l,m) for reading - * @param l - * @param m - * @return array value - */ - inline const T &operator()(LS_TYPE l, MS_TYPE m) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(l, m); -#endif - //l^2 + l + m - return data[l * (l + 1) + m]; - } - - /** - * Accessing the array value by index (l,m) for writing - * @param l - * @param m - * @return array value - */ - inline T &operator()(LS_TYPE l, MS_TYPE m) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(l, m); -#endif - //l^2 + l + m - return data[l * (l + 1) + m]; - } - - /** - * Convert array to STL vector> container - * @return vector> container - */ - vector> to_vector() const { - vector> res; - res.resize(lmax + 1); - - for (int i = 0; i < lmax + 1; i++) { - res[i].resize(i + 1); - for (int j = 0; j < i + 1; j++) { - res[i][j] = operator()(i, j); - } - } - return res; - } -}; - -/** - * Contiguous array to organize values by \f$ (i_0, l , m) \f$ indices. - * Only \f$ d_{0}, l_\textrm{max}\f$ should be provided: \f$ m = -l, \dots,l \f$ - * for \f$ l = 0, \dots, l_\textrm{max}\f$ - * @tparam T type of values to store - */ -template -class Array3DLM : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - - LS_TYPE lmax = 0; ///< orbital dimension \f$ l_{max} \f$ - - - size_t dim[1] = {0}; ///< linear dimension \f$ d_{0} \f$ - - size_t s[1] = {0}; ///< strides for linear dimensions - - Array1D *> _proxy_slices; ///< slices representation -public: - /** - * Default empty constructor - */ - Array3DLM() = default; - - /** - * Parametrized constructor - * @param array_name name of the array - */ - Array3DLM(string array_name) { - this->array_name = array_name; - }; - - /** - * Parametrized constructor - * @param d0 maximum value of \f$ i_0 \f$ - * @param lmax maximum value of \f$ l \f$ - * @param array_name name of the array - */ - explicit Array3DLM(size_t d0, LS_TYPE lmax, string array_name = "Array3DLM") { - init(d0, lmax, array_name); - } - - /** - * Initialize array and its slices - * @param d0 maximum value of \f$ i_0 \f$ - * @param lmax maximum value of \f$ l \f$ - * @param array_name name of the array - */ - void init(size_t d0, LS_TYPE lmax, string array_name = "Array3DLM") { - this->array_name = array_name; - this->lmax = lmax; - dim[0] = d0; - s[0] = lmax * lmax; - if (size != s[0] * dim[0]) { - size = s[0] * dim[0]; - if (data) delete[] data; - data = new T[size]{}; - memset(data, 0, size * sizeof(T)); - } else { - memset(data, 0, size * sizeof(T)); - } - - _proxy_slices.set_array_name(array_name + "_proxy"); - //arrange proxy-slices - _clear_proxies(); - _proxy_slices.resize(dim[0]); - for (size_t i0 = 0; i0 < dim[0]; ++i0) { - _proxy_slices(i0) = new Array2DLM(this->lmax, &this->data[i0 * s[0]], - array_name + "_slice"); - } - } - - /** - * Release pointers to slices - */ - void _clear_proxies() { - for (size_t i0 = 0; i0 < _proxy_slices.get_dim(0); ++i0) { - delete _proxy_slices(i0); - _proxy_slices(i0) = nullptr; - } - } - - /** - * Destructor, clear proxies - */ - ~Array3DLM() { - _clear_proxies(); - } - - /** - * Resize array to new dimensions - * @param d0 - * @param lmax - */ - void resize(size_t d0, LS_TYPE lmax) { - _clear_proxies(); - init(d0, lmax, this->array_name); - } - - /** - * Get array dimensions - * @param d dimension index - * @return dimension along axis 'd' - */ - size_t get_dim(int d) const { - return dim[d]; - } - -#ifdef MULTIARRAY_INDICES_CHECK - /** - * Check if indices (i0, l,m) are within array - */ - void check_indices(size_t i0, LS_TYPE l, MS_TYPE m) const { - if ((l < 0) | (l > lmax)) { - fprintf(stderr, "%s: Index l = %d out of range (0, %d)\n", array_name.c_str(), l, lmax); - exit(EXIT_FAILURE); - } - - if ((m < -l) | (m > l)) { - fprintf(stderr, "%s: Index m = %d out of range (%d, %d)\n", array_name.c_str(), m, -l, l); - exit(EXIT_FAILURE); - } - - if ((i0 < 0) | (i0 >= dim[0])) { - fprintf(stderr, "%s: index i0 = %ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); - exit(EXIT_FAILURE); - } - - size_t ii = i0 * s[0] + l * (l + 1) + m; - if (ii >= size) { - fprintf(stderr, "%s: index = %ld out of range %ld\n", array_name.c_str(), ii, size); - exit(EXIT_FAILURE); - } - } -#endif - - /** - * Accessing the array value by index (i0,l,m) for reading - * @param i0 - * @param l - * @param m - * @return array value - */ - inline const T &operator()(size_t i0, LS_TYPE l, MS_TYPE m) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, l, m); -#endif - return data[i0 * s[0] + l * (l + 1) + m]; - } - - /** - * Accessing the array value by index (i0,l,m) for writing - * @param i0 - * @param l - * @param m - * @return array value - */ - inline T &operator()(size_t i0, LS_TYPE l, MS_TYPE m) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, l, m); -#endif - return data[i0 * s[0] + l * (l + 1) + m]; - } - - /** - * Return proxy Array2DLM pointing to i0, l=0, m=0 to read - * @param i0 - * @return proxy Array2DLM pointing to i0, l=0, m=0 - */ - inline const Array2DLM &operator()(size_t i0) const { - return *_proxy_slices(i0); - } - - /** - * Return proxy Array2DLM pointing to i0, l=0, m=0 to write - * @param i0 - * @return proxy Array2DLM pointing to i0, l=0, m=0 - */ - inline Array2DLM &operator()(size_t i0) { - return *_proxy_slices(i0); - } -}; - - -/** - * Contiguous array to organize values by \f$ (i_0, i_1, l , m) \f$ indices. - * Only \f$ d_{0}, d_{1}, l_\textrm{max}\f$ should be provided: \f$ m = -l, \dots,l \f$ - * for \f$ l = 0, \dots, l_\textrm{max}\f$ - * @tparam T type of values to store - */ -template -class Array4DLM : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - - LS_TYPE lmax = 0; ///< orbital dimension \f$ l_{max} \f$ - size_t dim[2] = {0, 0}; ///< linear dimension \f$ d_{0}, d_{1} \f$ - size_t s[2] = {0, 0}; ///< strides for linear dimensions - - Array2D *> _proxy_slices; ///< slices representation -public: - /** - * Default empty constructor - */ - Array4DLM() = default; - - /** - * Parametrized constructor - * @param array_name name of the array - */ - Array4DLM(string array_name) { - this->array_name = array_name; - }; - - /** - * Parametrized constructor - * @param d0 maximum value of \f$ i_0 \f$ - * @param d1 maximum value of \f$ i_1 \f$ - * @param lmax maximum value of \f$ l \f$ - * @param array_name name of the array - */ - explicit Array4DLM(size_t d0, size_t d1, LS_TYPE lmax, string array_name = "Array4DLM") { - init(d0, d1, lmax, array_name); - } - - /** - * Initialize array, reallocate memory and its slices - * @param d0 maximum value of \f$ i_0 \f$ - * @param d1 maximum value of \f$ i_1 \f$ - * @param lmax maximum value of \f$ l \f$ - * @param array_name name of the array - */ - void init(size_t d0, size_t d1, LS_TYPE lmax, string array_name = "Array4DLM") { - this->array_name = array_name; - this->lmax = lmax; - dim[1] = d1; - dim[0] = d0; - s[1] = lmax * lmax; - s[0] = s[1] * dim[1]; - if (size != s[0] * dim[0]) { - size = s[0] * dim[0]; - if (data) delete[] data; - data = new T[size]{}; - memset(data, 0, size * sizeof(T)); - } else { - memset(data, 0, size * sizeof(T)); - } - - _proxy_slices.set_array_name(array_name + "_proxy"); - //release old memory if there is any - _clear_proxies(); - //arrange proxy-slices - _proxy_slices.resize(dim[0], dim[1]); - for (size_t i0 = 0; i0 < dim[0]; ++i0) - for (size_t i1 = 0; i1 < dim[1]; ++i1) { - _proxy_slices(i0, i1) = new Array2DLM(this->lmax, &this->data[i0 * s[0] + i1 * s[1]], - array_name + "_slice"); - } - } - - /** - * Release pointers to slices - */ - void _clear_proxies() { - - for (size_t i0 = 0; i0 < _proxy_slices.get_dim(0); ++i0) - for (size_t i1 = 0; i1 < _proxy_slices.get_dim(1); ++i1) { - delete _proxy_slices(i0, i1); - _proxy_slices(i0, i1) = nullptr; - } - } - - /** - * Destructor, clear proxies - */ - ~Array4DLM() { - _clear_proxies(); - } - - /** - * Deallocate memory, reallocate with the new dimensions - * @param d0 - * @param lmax - */ - void resize(size_t d0, size_t d1, LS_TYPE lmax) { - _clear_proxies(); - init(d0, d1, lmax, this->array_name); - } - - /** - * Get array dimensions - * @param d dimension index - * @return dimension along axis 'd' - */ - size_t get_dim(int d) const { - return dim[d]; - } - -#ifdef MULTIARRAY_INDICES_CHECK - /** - * Check if indices (i0, l,m) are within array - */ - void check_indices(size_t i0, size_t i1, LS_TYPE l, MS_TYPE m) const { - if ((l < 0) | (l > lmax)) { - fprintf(stderr, "%s: Index l = %d out of range (0, %d)\n", array_name.c_str(), l, lmax); - exit(EXIT_FAILURE); - } - - if ((m < -l) | (m > l)) { - fprintf(stderr, "%s: Index m = %d out of range (%d, %d)\n", array_name.c_str(), m, -l, l); - exit(EXIT_FAILURE); - } - - if ((i0 < 0) | (i0 >= dim[0])) { - fprintf(stderr, "%s: index i0 = %ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); - exit(EXIT_FAILURE); - } - - - if ((i1 < 0) | (i1 >= dim[1])) { - fprintf(stderr, "%s: index i1 = %ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); - exit(EXIT_FAILURE); - } - - size_t ii = i0 * s[0] + i1 * s[1] + l * (l + 1) + m; - if (ii >= size) { - fprintf(stderr, "%s: index = %ld out of range %ld\n", array_name.c_str(), ii, size); - exit(EXIT_FAILURE); - } - } -#endif - - /** - * Accessing the array value by index (i0,l,m) for reading - * @param i0 - * @param i1 - * @param l - * @param m - * @return array value - */ - inline const T &operator()(size_t i0, size_t i1, LS_TYPE l, MS_TYPE m) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, l, m); -#endif - return data[i0 * s[0] + i1 * s[1] + l * (l + 1) + m]; - } - - /** - * Accessing the array value by index (i0,l,m) for writing - * @param i0 - * @param i1 - * @param l - * @param m - * @return array value - */ - inline T &operator()(size_t i0, size_t i1, LS_TYPE l, MS_TYPE m) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, l, m); -#endif - return data[i0 * s[0] + i1 * s[1] + l * (l + 1) + m]; - } - - /** - * Return proxy Array2DLM pointing to i0, i1, l=0, m=0 to read - * @param i0 - * @param i1 - * @return proxy Array2DLM pointing to i0, l=0, m=0 - */ - inline const Array2DLM &operator()(size_t i0, size_t i1) const { - return *_proxy_slices(i0, i1); - } - - /** - * Return proxy Array2DLM pointing to i0, i1, l=0, m=0 to write - * @param i0 - * @param i1 - * @return proxy Array2DLM pointing to i0, l=0, m=0 - */ - inline Array2DLM &operator()(size_t i0, size_t i1) { - return *_proxy_slices(i0, i1); - } -}; - -#endif //ACE_ARRAY2DLM_H \ No newline at end of file diff --git a/lib/pace/ace_arraynd.h b/lib/pace/ace_arraynd.h deleted file mode 100644 index 1044b5654e..0000000000 --- a/lib/pace/ace_arraynd.h +++ /dev/null @@ -1,1949 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -//automatically generate source code - -#ifndef ACE_MULTIARRAY_H -#define ACE_MULTIARRAY_H - -#include -#include -#include - -#include "ace_contigous_array.h" - -using namespace std; - - -/** - * Multidimensional (1 - dimensional) array of type T with contiguous memory layout. - * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @tparam T data type - */ -template -class Array1D : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - using ContiguousArrayND::is_proxy_; - - size_t dim[1] = {0}; ///< dimensions - size_t s[1] = {0}; ///< strides - int ndim = 1; ///< number of dimensions -public: - - /** - * Default empty constructor - */ - Array1D() = default; - - /** - * Parametrized constructor with array name - * @param array_name name of array (for error logging) - */ - Array1D(const string &array_name) { this->array_name = array_name; } - - /** - * Parametrized constructor - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - Array1D(size_t d0, const string &array_name = "Array1D", T *new_data = nullptr) { - init(d0, array_name, new_data); - } - - /** - * Setup the dimensions and strides of array - * @param d0,... array sizes for different dimensions - */ - void set_dimensions(size_t d0) { - - dim[0] = d0; - - s[0] = 1; - - size = s[0] * dim[0]; - }; - - /** - * Initialize array storage, dimensions and strides - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - void init(size_t d0, const string &array_name = "Array1D", T *new_data = nullptr) { - this->array_name = array_name; - - size_t old_size = size; - set_dimensions(d0); - - bool new_is_proxy = (new_data != nullptr); - - if (new_is_proxy) { - if (!is_proxy_) delete[] data; - data = new_data; - } else { - if (size != old_size) { - T *old_data = data; //preserve the pointer to the old data - data = new T[size]; // allocate new data - if (old_data != nullptr) { // - size_t min_size = old_size < size ? old_size : size; - memcpy(data, old_data, min_size * sizeof(T)); - if (!is_proxy_) delete[] old_data; - } - //memset(data, 0, size * sizeof(T)); - } else { - //memset(data, 0, size * sizeof(T)); - } - } - - is_proxy_ = new_is_proxy; - } - - /** - * Resize array - * @param d0,... array sizes for different dimensions - */ - void resize(size_t d0) { - init(d0, this->array_name); - } - - /** - * Reshape array without reset the data - * @param d0,... array sizes for different dimensions - */ - void reshape(size_t d0) { - //check data size consistency - size_t new_size = d0; - if (new_size != size) - throw invalid_argument("Couldn't reshape array when the size is not conserved"); - set_dimensions(d0); - } - - /** - * Get array size in dimension "d" - * @param d dimension index - */ - size_t get_dim(int d) const { - return dim[d]; - } - -#ifdef MULTIARRAY_INDICES_CHECK - - /** - * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - void check_indices(size_t i0) const { - - if ((i0 < 0) | (i0 >= dim[0])) { - char buf[1024]; - sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); - throw std::out_of_range(buf); - } - - } - -#endif - - /** - * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline const T &operator()(size_t i0) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0); -#endif - - return data[i0]; - - } - - /** - * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline T &operator()(size_t i0) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0); -#endif - - return data[i0]; - - } - - /** - * Array comparison operator - * @param other - */ - bool operator==(const Array1D &other) const { - //compare dimensions - for (int d = 0; d < ndim; d++) { - if (this->dim[d] != other.dim[d]) - return false; - } - return ContiguousArrayND::operator==(other); - } - - /** - * Convert to nested vector> container - * @return vector container - */ - vector to_vector() const { - vector res; - - res.resize(dim[0]); - - for (int i0 = 0; i0 < dim[0]; i0++) { - res[i0] = operator()(i0); - - } - - - return res; - } // end to_vector() - - - /** - * Set values to vector> container - * @param vec container - */ - void set_vector(const vector &vec) { - size_t d0 = 0; - d0 = vec.size(); - - - init(d0, array_name); - for (int i0 = 0; i0 < dim[0]; i0++) { - operator()(i0) = vec.at(i0); - - } - - } - - /** - * Parametrized constructor from vector> container - * @param vec container - * @param array_name array name - */ - Array1D(const vector &vec, const string &array_name = "Array1D") { - this->set_vector(vec); - this->array_name = array_name; - } - - /** - * operator= to vector> container - * @param vec container - */ - Array1D &operator=(const vector &vec) { - this->set_vector(vec); - return *this; - } - - - vector get_shape() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = dim[d]; - return sh; - } - - vector get_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d]; - return sh; - } - - vector get_memory_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d] * sizeof(T); - return sh; - } -}; - - -/** - * Multidimensional (2 - dimensional) array of type T with contiguous memory layout. - * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @tparam T data type - */ -template -class Array2D : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - using ContiguousArrayND::is_proxy_; - - size_t dim[2] = {0}; ///< dimensions - size_t s[2] = {0}; ///< strides - int ndim = 2; ///< number of dimensions -public: - - /** - * Default empty constructor - */ - Array2D() = default; - - /** - * Parametrized constructor with array name - * @param array_name name of array (for error logging) - */ - Array2D(const string &array_name) { this->array_name = array_name; } - - /** - * Parametrized constructor - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - Array2D(size_t d0, size_t d1, const string &array_name = "Array2D", T *new_data = nullptr) { - init(d0, d1, array_name, new_data); - } - - /** - * Setup the dimensions and strides of array - * @param d0,... array sizes for different dimensions - */ - void set_dimensions(size_t d0, size_t d1) { - - dim[0] = d0; - dim[1] = d1; - - s[1] = 1; - s[0] = s[1] * dim[1]; - - size = s[0] * dim[0]; - }; - - /** - * Initialize array storage, dimensions and strides - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - void init(size_t d0, size_t d1, const string &array_name = "Array2D", T *new_data = nullptr) { - this->array_name = array_name; - - size_t old_size = size; - set_dimensions(d0, d1); - - bool new_is_proxy = (new_data != nullptr); - - if (new_is_proxy) { - if (!is_proxy_) delete[] data; - data = new_data; - } else { - if (size != old_size) { - T *old_data = data; //preserve the pointer to the old data - data = new T[size]; // allocate new data - if (old_data != nullptr) { // - size_t min_size = old_size < size ? old_size : size; - memcpy(data, old_data, min_size * sizeof(T)); - if (!is_proxy_) delete[] old_data; - } - //memset(data, 0, size * sizeof(T)); - } else { - //memset(data, 0, size * sizeof(T)); - } - } - - is_proxy_ = new_is_proxy; - } - - /** - * Resize array - * @param d0,... array sizes for different dimensions - */ - void resize(size_t d0, size_t d1) { - init(d0, d1, this->array_name); - } - - /** - * Reshape array without reset the data - * @param d0,... array sizes for different dimensions - */ - void reshape(size_t d0, size_t d1) { - //check data size consistency - size_t new_size = d0 * d1; - if (new_size != size) - throw invalid_argument("Couldn't reshape array when the size is not conserved"); - set_dimensions(d0, d1); - } - - /** - * Get array size in dimension "d" - * @param d dimension index - */ - size_t get_dim(int d) const { - return dim[d]; - } - -#ifdef MULTIARRAY_INDICES_CHECK - - /** - * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - void check_indices(size_t i0, size_t i1) const { - - if ((i0 < 0) | (i0 >= dim[0])) { - char buf[1024]; - sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); - throw std::out_of_range(buf); - } - - if ((i1 < 0) | (i1 >= dim[1])) { - char buf[1024]; - sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); - throw std::out_of_range(buf); - } - - } - -#endif - - /** - * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline const T &operator()(size_t i0, size_t i1) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1); -#endif - - return data[i0 * s[0] + i1]; - - } - - /** - * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline T &operator()(size_t i0, size_t i1) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1); -#endif - - return data[i0 * s[0] + i1]; - - } - - /** - * Array comparison operator - * @param other - */ - bool operator==(const Array2D &other) const { - //compare dimensions - for (int d = 0; d < ndim; d++) { - if (this->dim[d] != other.dim[d]) - return false; - } - return ContiguousArrayND::operator==(other); - } - - /** - * Convert to nested vector> container - * @return vector container - */ - vector> to_vector() const { - vector> res; - - res.resize(dim[0]); - - for (int i0 = 0; i0 < dim[0]; i0++) { - res[i0].resize(dim[1]); - - - for (int i1 = 0; i1 < dim[1]; i1++) { - res[i0][i1] = operator()(i0, i1); - - } - } - - - return res; - } // end to_vector() - - - /** - * Set values to vector> container - * @param vec container - */ - void set_vector(const vector> &vec) { - size_t d0 = 0; - size_t d1 = 0; - d0 = vec.size(); - - if (d0 > 0) { - d1 = vec.at(0).size(); - - - } - - init(d0, d1, array_name); - for (int i0 = 0; i0 < dim[0]; i0++) { - if (vec.at(i0).size() != d1) - throw std::invalid_argument("Vector size is not constant at dimension 1"); - - for (int i1 = 0; i1 < dim[1]; i1++) { - operator()(i0, i1) = vec.at(i0).at(i1); - - } - } - - } - - /** - * Parametrized constructor from vector> container - * @param vec container - * @param array_name array name - */ - Array2D(const vector> &vec, const string &array_name = "Array2D") { - this->set_vector(vec); - this->array_name = array_name; - } - - /** - * operator= to vector> container - * @param vec container - */ - Array2D &operator=(const vector> &vec) { - this->set_vector(vec); - return *this; - } - - - /** - * operator= to flatten vector container - * @param vec container - */ - Array2D &operator=(const vector &vec) { - this->set_flatten_vector(vec); - return *this; - } - - - vector get_shape() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = dim[d]; - return sh; - } - - vector get_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d]; - return sh; - } - - vector get_memory_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d] * sizeof(T); - return sh; - } -}; - - -/** - * Multidimensional (3 - dimensional) array of type T with contiguous memory layout. - * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @tparam T data type - */ -template -class Array3D : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - using ContiguousArrayND::is_proxy_; - - size_t dim[3] = {0}; ///< dimensions - size_t s[3] = {0}; ///< strides - int ndim = 3; ///< number of dimensions -public: - - /** - * Default empty constructor - */ - Array3D() = default; - - /** - * Parametrized constructor with array name - * @param array_name name of array (for error logging) - */ - Array3D(const string &array_name) { this->array_name = array_name; } - - /** - * Parametrized constructor - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - Array3D(size_t d0, size_t d1, size_t d2, const string &array_name = "Array3D", T *new_data = nullptr) { - init(d0, d1, d2, array_name, new_data); - } - - /** - * Setup the dimensions and strides of array - * @param d0,... array sizes for different dimensions - */ - void set_dimensions(size_t d0, size_t d1, size_t d2) { - - dim[0] = d0; - dim[1] = d1; - dim[2] = d2; - - s[2] = 1; - s[1] = s[2] * dim[2]; - s[0] = s[1] * dim[1]; - - size = s[0] * dim[0]; - }; - - /** - * Initialize array storage, dimensions and strides - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - void init(size_t d0, size_t d1, size_t d2, const string &array_name = "Array3D", T *new_data = nullptr) { - this->array_name = array_name; - - size_t old_size = size; - set_dimensions(d0, d1, d2); - - bool new_is_proxy = (new_data != nullptr); - - if (new_is_proxy) { - if (!is_proxy_) delete[] data; - data = new_data; - } else { - if (size != old_size) { - T *old_data = data; //preserve the pointer to the old data - data = new T[size]; // allocate new data - if (old_data != nullptr) { // - size_t min_size = old_size < size ? old_size : size; - memcpy(data, old_data, min_size * sizeof(T)); - if (!is_proxy_) delete[] old_data; - } - //memset(data, 0, size * sizeof(T)); - } else { - //memset(data, 0, size * sizeof(T)); - } - } - - is_proxy_ = new_is_proxy; - } - - /** - * Resize array - * @param d0,... array sizes for different dimensions - */ - void resize(size_t d0, size_t d1, size_t d2) { - init(d0, d1, d2, this->array_name); - } - - /** - * Reshape array without reset the data - * @param d0,... array sizes for different dimensions - */ - void reshape(size_t d0, size_t d1, size_t d2) { - //check data size consistency - size_t new_size = d0 * d1 * d2; - if (new_size != size) - throw invalid_argument("Couldn't reshape array when the size is not conserved"); - set_dimensions(d0, d1, d2); - } - - /** - * Get array size in dimension "d" - * @param d dimension index - */ - size_t get_dim(int d) const { - return dim[d]; - } - -#ifdef MULTIARRAY_INDICES_CHECK - - /** - * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - void check_indices(size_t i0, size_t i1, size_t i2) const { - - if ((i0 < 0) | (i0 >= dim[0])) { - char buf[1024]; - sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); - throw std::out_of_range(buf); - } - - if ((i1 < 0) | (i1 >= dim[1])) { - char buf[1024]; - sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); - throw std::out_of_range(buf); - } - - if ((i2 < 0) | (i2 >= dim[2])) { - char buf[1024]; - sprintf(buf, "%s: index i2=%ld out of range (0, %ld)\n", array_name.c_str(), i2, dim[2] - 1); - throw std::out_of_range(buf); - } - - } - -#endif - - /** - * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline const T &operator()(size_t i0, size_t i1, size_t i2) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, i2); -#endif - - return data[i0 * s[0] + i1 * s[1] + i2]; - - } - - /** - * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline T &operator()(size_t i0, size_t i1, size_t i2) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, i2); -#endif - - return data[i0 * s[0] + i1 * s[1] + i2]; - - } - - /** - * Array comparison operator - * @param other - */ - bool operator==(const Array3D &other) const { - //compare dimensions - for (int d = 0; d < ndim; d++) { - if (this->dim[d] != other.dim[d]) - return false; - } - return ContiguousArrayND::operator==(other); - } - - /** - * Convert to nested vector> container - * @return vector container - */ - vector>> to_vector() const { - vector>> res; - - res.resize(dim[0]); - - for (int i0 = 0; i0 < dim[0]; i0++) { - res[i0].resize(dim[1]); - - - for (int i1 = 0; i1 < dim[1]; i1++) { - res[i0][i1].resize(dim[2]); - - - for (int i2 = 0; i2 < dim[2]; i2++) { - res[i0][i1][i2] = operator()(i0, i1, i2); - - } - } - } - - - return res; - } // end to_vector() - - - /** - * Set values to vector> container - * @param vec container - */ - void set_vector(const vector>> &vec) { - size_t d0 = 0; - size_t d1 = 0; - size_t d2 = 0; - d0 = vec.size(); - - if (d0 > 0) { - d1 = vec.at(0).size(); - if (d1 > 0) { - d2 = vec.at(0).at(0).size(); - - - } - } - - init(d0, d1, d2, array_name); - for (int i0 = 0; i0 < dim[0]; i0++) { - if (vec.at(i0).size() != d1) - throw std::invalid_argument("Vector size is not constant at dimension 1"); - - for (int i1 = 0; i1 < dim[1]; i1++) { - if (vec.at(i0).at(i1).size() != d2) - throw std::invalid_argument("Vector size is not constant at dimension 2"); - - for (int i2 = 0; i2 < dim[2]; i2++) { - operator()(i0, i1, i2) = vec.at(i0).at(i1).at(i2); - - } - } - } - - } - - /** - * Parametrized constructor from vector> container - * @param vec container - * @param array_name array name - */ - Array3D(const vector>> &vec, const string &array_name = "Array3D") { - this->set_vector(vec); - this->array_name = array_name; - } - - /** - * operator= to vector> container - * @param vec container - */ - Array3D &operator=(const vector>> &vec) { - this->set_vector(vec); - return *this; - } - - - /** - * operator= to flatten vector container - * @param vec container - */ - Array3D &operator=(const vector &vec) { - this->set_flatten_vector(vec); - return *this; - } - - - vector get_shape() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = dim[d]; - return sh; - } - - vector get_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d]; - return sh; - } - - vector get_memory_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d] * sizeof(T); - return sh; - } -}; - - -/** - * Multidimensional (4 - dimensional) array of type T with contiguous memory layout. - * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @tparam T data type - */ -template -class Array4D : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - using ContiguousArrayND::is_proxy_; - - size_t dim[4] = {0}; ///< dimensions - size_t s[4] = {0}; ///< strides - int ndim = 4; ///< number of dimensions -public: - - /** - * Default empty constructor - */ - Array4D() = default; - - /** - * Parametrized constructor with array name - * @param array_name name of array (for error logging) - */ - Array4D(const string &array_name) { this->array_name = array_name; } - - /** - * Parametrized constructor - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - Array4D(size_t d0, size_t d1, size_t d2, size_t d3, const string &array_name = "Array4D", T *new_data = nullptr) { - init(d0, d1, d2, d3, array_name, new_data); - } - - /** - * Setup the dimensions and strides of array - * @param d0,... array sizes for different dimensions - */ - void set_dimensions(size_t d0, size_t d1, size_t d2, size_t d3) { - - dim[0] = d0; - dim[1] = d1; - dim[2] = d2; - dim[3] = d3; - - s[3] = 1; - s[2] = s[3] * dim[3]; - s[1] = s[2] * dim[2]; - s[0] = s[1] * dim[1]; - - size = s[0] * dim[0]; - }; - - /** - * Initialize array storage, dimensions and strides - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - void init(size_t d0, size_t d1, size_t d2, size_t d3, const string &array_name = "Array4D", T *new_data = nullptr) { - this->array_name = array_name; - - size_t old_size = size; - set_dimensions(d0, d1, d2, d3); - - bool new_is_proxy = (new_data != nullptr); - - if (new_is_proxy) { - if (!is_proxy_) delete[] data; - data = new_data; - } else { - if (size != old_size) { - T *old_data = data; //preserve the pointer to the old data - data = new T[size]; // allocate new data - if (old_data != nullptr) { // - size_t min_size = old_size < size ? old_size : size; - memcpy(data, old_data, min_size * sizeof(T)); - if (!is_proxy_) delete[] old_data; - } - //memset(data, 0, size * sizeof(T)); - } else { - //memset(data, 0, size * sizeof(T)); - } - } - - is_proxy_ = new_is_proxy; - } - - /** - * Resize array - * @param d0,... array sizes for different dimensions - */ - void resize(size_t d0, size_t d1, size_t d2, size_t d3) { - init(d0, d1, d2, d3, this->array_name); - } - - /** - * Reshape array without reset the data - * @param d0,... array sizes for different dimensions - */ - void reshape(size_t d0, size_t d1, size_t d2, size_t d3) { - //check data size consistency - size_t new_size = d0 * d1 * d2 * d3; - if (new_size != size) - throw invalid_argument("Couldn't reshape array when the size is not conserved"); - set_dimensions(d0, d1, d2, d3); - } - - /** - * Get array size in dimension "d" - * @param d dimension index - */ - size_t get_dim(int d) const { - return dim[d]; - } - -#ifdef MULTIARRAY_INDICES_CHECK - - /** - * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - void check_indices(size_t i0, size_t i1, size_t i2, size_t i3) const { - - if ((i0 < 0) | (i0 >= dim[0])) { - char buf[1024]; - sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); - throw std::out_of_range(buf); - } - - if ((i1 < 0) | (i1 >= dim[1])) { - char buf[1024]; - sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); - throw std::out_of_range(buf); - } - - if ((i2 < 0) | (i2 >= dim[2])) { - char buf[1024]; - sprintf(buf, "%s: index i2=%ld out of range (0, %ld)\n", array_name.c_str(), i2, dim[2] - 1); - throw std::out_of_range(buf); - } - - if ((i3 < 0) | (i3 >= dim[3])) { - char buf[1024]; - sprintf(buf, "%s: index i3=%ld out of range (0, %ld)\n", array_name.c_str(), i3, dim[3] - 1); - throw std::out_of_range(buf); - } - - } - -#endif - - /** - * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline const T &operator()(size_t i0, size_t i1, size_t i2, size_t i3) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, i2, i3); -#endif - - return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3]; - - } - - /** - * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline T &operator()(size_t i0, size_t i1, size_t i2, size_t i3) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, i2, i3); -#endif - - return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3]; - - } - - /** - * Array comparison operator - * @param other - */ - bool operator==(const Array4D &other) const { - //compare dimensions - for (int d = 0; d < ndim; d++) { - if (this->dim[d] != other.dim[d]) - return false; - } - return ContiguousArrayND::operator==(other); - } - - /** - * Convert to nested vector> container - * @return vector container - */ - vector>>> to_vector() const { - vector>>> res; - - res.resize(dim[0]); - - for (int i0 = 0; i0 < dim[0]; i0++) { - res[i0].resize(dim[1]); - - - for (int i1 = 0; i1 < dim[1]; i1++) { - res[i0][i1].resize(dim[2]); - - - for (int i2 = 0; i2 < dim[2]; i2++) { - res[i0][i1][i2].resize(dim[3]); - - - for (int i3 = 0; i3 < dim[3]; i3++) { - res[i0][i1][i2][i3] = operator()(i0, i1, i2, i3); - - } - } - } - } - - - return res; - } // end to_vector() - - - /** - * Set values to vector> container - * @param vec container - */ - void set_vector(const vector>>> &vec) { - size_t d0 = 0; - size_t d1 = 0; - size_t d2 = 0; - size_t d3 = 0; - d0 = vec.size(); - - if (d0 > 0) { - d1 = vec.at(0).size(); - if (d1 > 0) { - d2 = vec.at(0).at(0).size(); - if (d2 > 0) { - d3 = vec.at(0).at(0).at(0).size(); - - - } - } - } - - init(d0, d1, d2, d3, array_name); - for (int i0 = 0; i0 < dim[0]; i0++) { - if (vec.at(i0).size() != d1) - throw std::invalid_argument("Vector size is not constant at dimension 1"); - - for (int i1 = 0; i1 < dim[1]; i1++) { - if (vec.at(i0).at(i1).size() != d2) - throw std::invalid_argument("Vector size is not constant at dimension 2"); - - for (int i2 = 0; i2 < dim[2]; i2++) { - if (vec.at(i0).at(i1).at(i2).size() != d3) - throw std::invalid_argument("Vector size is not constant at dimension 3"); - - for (int i3 = 0; i3 < dim[3]; i3++) { - operator()(i0, i1, i2, i3) = vec.at(i0).at(i1).at(i2).at(i3); - - } - } - } - } - - } - - /** - * Parametrized constructor from vector> container - * @param vec container - * @param array_name array name - */ - Array4D(const vector>>> &vec, const string &array_name = "Array4D") { - this->set_vector(vec); - this->array_name = array_name; - } - - /** - * operator= to vector> container - * @param vec container - */ - Array4D &operator=(const vector>>> &vec) { - this->set_vector(vec); - return *this; - } - - - /** - * operator= to flatten vector container - * @param vec container - */ - Array4D &operator=(const vector &vec) { - this->set_flatten_vector(vec); - return *this; - } - - - vector get_shape() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = dim[d]; - return sh; - } - - vector get_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d]; - return sh; - } - - vector get_memory_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d] * sizeof(T); - return sh; - } -}; - - -/** - * Multidimensional (5 - dimensional) array of type T with contiguous memory layout. - * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @tparam T data type - */ -template -class Array5D : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - using ContiguousArrayND::is_proxy_; - - size_t dim[5] = {0}; ///< dimensions - size_t s[5] = {0}; ///< strides - int ndim = 5; ///< number of dimensions -public: - - /** - * Default empty constructor - */ - Array5D() = default; - - /** - * Parametrized constructor with array name - * @param array_name name of array (for error logging) - */ - Array5D(const string &array_name) { this->array_name = array_name; } - - /** - * Parametrized constructor - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - Array5D(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, const string &array_name = "Array5D", - T *new_data = nullptr) { - init(d0, d1, d2, d3, d4, array_name, new_data); - } - - /** - * Setup the dimensions and strides of array - * @param d0,... array sizes for different dimensions - */ - void set_dimensions(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4) { - - dim[0] = d0; - dim[1] = d1; - dim[2] = d2; - dim[3] = d3; - dim[4] = d4; - - s[4] = 1; - s[3] = s[4] * dim[4]; - s[2] = s[3] * dim[3]; - s[1] = s[2] * dim[2]; - s[0] = s[1] * dim[1]; - - size = s[0] * dim[0]; - }; - - /** - * Initialize array storage, dimensions and strides - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - void init(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, const string &array_name = "Array5D", - T *new_data = nullptr) { - this->array_name = array_name; - - size_t old_size = size; - set_dimensions(d0, d1, d2, d3, d4); - - bool new_is_proxy = (new_data != nullptr); - - if (new_is_proxy) { - if (!is_proxy_) delete[] data; - data = new_data; - } else { - if (size != old_size) { - T *old_data = data; //preserve the pointer to the old data - data = new T[size]; // allocate new data - if (old_data != nullptr) { // - size_t min_size = old_size < size ? old_size : size; - memcpy(data, old_data, min_size * sizeof(T)); - if (!is_proxy_) delete[] old_data; - } - //memset(data, 0, size * sizeof(T)); - } else { - //memset(data, 0, size * sizeof(T)); - } - } - - is_proxy_ = new_is_proxy; - } - - /** - * Resize array - * @param d0,... array sizes for different dimensions - */ - void resize(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4) { - init(d0, d1, d2, d3, d4, this->array_name); - } - - /** - * Reshape array without reset the data - * @param d0,... array sizes for different dimensions - */ - void reshape(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4) { - //check data size consistency - size_t new_size = d0 * d1 * d2 * d3 * d4; - if (new_size != size) - throw invalid_argument("Couldn't reshape array when the size is not conserved"); - set_dimensions(d0, d1, d2, d3, d4); - } - - /** - * Get array size in dimension "d" - * @param d dimension index - */ - size_t get_dim(int d) const { - return dim[d]; - } - -#ifdef MULTIARRAY_INDICES_CHECK - - /** - * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - void check_indices(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4) const { - - if ((i0 < 0) | (i0 >= dim[0])) { - char buf[1024]; - sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); - throw std::out_of_range(buf); - } - - if ((i1 < 0) | (i1 >= dim[1])) { - char buf[1024]; - sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); - throw std::out_of_range(buf); - } - - if ((i2 < 0) | (i2 >= dim[2])) { - char buf[1024]; - sprintf(buf, "%s: index i2=%ld out of range (0, %ld)\n", array_name.c_str(), i2, dim[2] - 1); - throw std::out_of_range(buf); - } - - if ((i3 < 0) | (i3 >= dim[3])) { - char buf[1024]; - sprintf(buf, "%s: index i3=%ld out of range (0, %ld)\n", array_name.c_str(), i3, dim[3] - 1); - throw std::out_of_range(buf); - } - - if ((i4 < 0) | (i4 >= dim[4])) { - char buf[1024]; - sprintf(buf, "%s: index i4=%ld out of range (0, %ld)\n", array_name.c_str(), i4, dim[4] - 1); - throw std::out_of_range(buf); - } - - } - -#endif - - /** - * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline const T &operator()(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, i2, i3, i4); -#endif - - return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3 * s[3] + i4]; - - } - - /** - * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline T &operator()(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, i2, i3, i4); -#endif - - return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3 * s[3] + i4]; - - } - - /** - * Array comparison operator - * @param other - */ - bool operator==(const Array5D &other) const { - //compare dimensions - for (int d = 0; d < ndim; d++) { - if (this->dim[d] != other.dim[d]) - return false; - } - return ContiguousArrayND::operator==(other); - } - - /** - * Convert to nested vector> container - * @return vector container - */ - vector>>>> to_vector() const { - vector>>>> res; - - res.resize(dim[0]); - - for (int i0 = 0; i0 < dim[0]; i0++) { - res[i0].resize(dim[1]); - - - for (int i1 = 0; i1 < dim[1]; i1++) { - res[i0][i1].resize(dim[2]); - - - for (int i2 = 0; i2 < dim[2]; i2++) { - res[i0][i1][i2].resize(dim[3]); - - - for (int i3 = 0; i3 < dim[3]; i3++) { - res[i0][i1][i2][i3].resize(dim[4]); - - - for (int i4 = 0; i4 < dim[4]; i4++) { - res[i0][i1][i2][i3][i4] = operator()(i0, i1, i2, i3, i4); - - } - } - } - } - } - - - return res; - } // end to_vector() - - - /** - * Set values to vector> container - * @param vec container - */ - void set_vector(const vector>>>> &vec) { - size_t d0 = 0; - size_t d1 = 0; - size_t d2 = 0; - size_t d3 = 0; - size_t d4 = 0; - d0 = vec.size(); - - if (d0 > 0) { - d1 = vec.at(0).size(); - if (d1 > 0) { - d2 = vec.at(0).at(0).size(); - if (d2 > 0) { - d3 = vec.at(0).at(0).at(0).size(); - if (d3 > 0) { - d4 = vec.at(0).at(0).at(0).at(0).size(); - - - } - } - } - } - - init(d0, d1, d2, d3, d4, array_name); - for (int i0 = 0; i0 < dim[0]; i0++) { - if (vec.at(i0).size() != d1) - throw std::invalid_argument("Vector size is not constant at dimension 1"); - - for (int i1 = 0; i1 < dim[1]; i1++) { - if (vec.at(i0).at(i1).size() != d2) - throw std::invalid_argument("Vector size is not constant at dimension 2"); - - for (int i2 = 0; i2 < dim[2]; i2++) { - if (vec.at(i0).at(i1).at(i2).size() != d3) - throw std::invalid_argument("Vector size is not constant at dimension 3"); - - for (int i3 = 0; i3 < dim[3]; i3++) { - if (vec.at(i0).at(i1).at(i2).at(i3).size() != d4) - throw std::invalid_argument("Vector size is not constant at dimension 4"); - - for (int i4 = 0; i4 < dim[4]; i4++) { - operator()(i0, i1, i2, i3, i4) = vec.at(i0).at(i1).at(i2).at(i3).at(i4); - - } - } - } - } - } - - } - - /** - * Parametrized constructor from vector> container - * @param vec container - * @param array_name array name - */ - Array5D(const vector>>>> &vec, const string &array_name = "Array5D") { - this->set_vector(vec); - this->array_name = array_name; - } - - /** - * operator= to vector> container - * @param vec container - */ - Array5D &operator=(const vector>>>> &vec) { - this->set_vector(vec); - return *this; - } - - - /** - * operator= to flatten vector container - * @param vec container - */ - Array5D &operator=(const vector &vec) { - this->set_flatten_vector(vec); - return *this; - } - - - vector get_shape() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = dim[d]; - return sh; - } - - vector get_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d]; - return sh; - } - - vector get_memory_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d] * sizeof(T); - return sh; - } -}; - - -/** - * Multidimensional (6 - dimensional) array of type T with contiguous memory layout. - * If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @tparam T data type - */ -template -class Array6D : public ContiguousArrayND { - using ContiguousArrayND::array_name; - using ContiguousArrayND::data; - using ContiguousArrayND::size; - using ContiguousArrayND::is_proxy_; - - size_t dim[6] = {0}; ///< dimensions - size_t s[6] = {0}; ///< strides - int ndim = 6; ///< number of dimensions -public: - - /** - * Default empty constructor - */ - Array6D() = default; - - /** - * Parametrized constructor with array name - * @param array_name name of array (for error logging) - */ - Array6D(const string &array_name) { this->array_name = array_name; } - - /** - * Parametrized constructor - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - Array6D(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5, const string &array_name = "Array6D", - T *new_data = nullptr) { - init(d0, d1, d2, d3, d4, d5, array_name, new_data); - } - - /** - * Setup the dimensions and strides of array - * @param d0,... array sizes for different dimensions - */ - void set_dimensions(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5) { - - dim[0] = d0; - dim[1] = d1; - dim[2] = d2; - dim[3] = d3; - dim[4] = d4; - dim[5] = d5; - - s[5] = 1; - s[4] = s[5] * dim[5]; - s[3] = s[4] * dim[4]; - s[2] = s[3] * dim[3]; - s[1] = s[2] * dim[2]; - s[0] = s[1] * dim[1]; - - size = s[0] * dim[0]; - }; - - /** - * Initialize array storage, dimensions and strides - * @param d0,... array sizes for different dimensions - * @param array_name string name of the array - */ - void init(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5, const string &array_name = "Array6D", - T *new_data = nullptr) { - this->array_name = array_name; - - size_t old_size = size; - set_dimensions(d0, d1, d2, d3, d4, d5); - - bool new_is_proxy = (new_data != nullptr); - - if (new_is_proxy) { - if (!is_proxy_) delete[] data; - data = new_data; - } else { - if (size != old_size) { - T *old_data = data; //preserve the pointer to the old data - data = new T[size]; // allocate new data - if (old_data != nullptr) { // - size_t min_size = old_size < size ? old_size : size; - memcpy(data, old_data, min_size * sizeof(T)); - if (!is_proxy_) delete[] old_data; - } - //memset(data, 0, size * sizeof(T)); - } else { - //memset(data, 0, size * sizeof(T)); - } - } - - is_proxy_ = new_is_proxy; - } - - /** - * Resize array - * @param d0,... array sizes for different dimensions - */ - void resize(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5) { - init(d0, d1, d2, d3, d4, d5, this->array_name); - } - - /** - * Reshape array without reset the data - * @param d0,... array sizes for different dimensions - */ - void reshape(size_t d0, size_t d1, size_t d2, size_t d3, size_t d4, size_t d5) { - //check data size consistency - size_t new_size = d0 * d1 * d2 * d3 * d4 * d5; - if (new_size != size) - throw invalid_argument("Couldn't reshape array when the size is not conserved"); - set_dimensions(d0, d1, d2, d3, d4, d5); - } - - /** - * Get array size in dimension "d" - * @param d dimension index - */ - size_t get_dim(int d) const { - return dim[d]; - } - -#ifdef MULTIARRAY_INDICES_CHECK - - /** - * Check indices validity. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - void check_indices(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) const { - - if ((i0 < 0) | (i0 >= dim[0])) { - char buf[1024]; - sprintf(buf, "%s: index i0=%ld out of range (0, %ld)\n", array_name.c_str(), i0, dim[0] - 1); - throw std::out_of_range(buf); - } - - if ((i1 < 0) | (i1 >= dim[1])) { - char buf[1024]; - sprintf(buf, "%s: index i1=%ld out of range (0, %ld)\n", array_name.c_str(), i1, dim[1] - 1); - throw std::out_of_range(buf); - } - - if ((i2 < 0) | (i2 >= dim[2])) { - char buf[1024]; - sprintf(buf, "%s: index i2=%ld out of range (0, %ld)\n", array_name.c_str(), i2, dim[2] - 1); - throw std::out_of_range(buf); - } - - if ((i3 < 0) | (i3 >= dim[3])) { - char buf[1024]; - sprintf(buf, "%s: index i3=%ld out of range (0, %ld)\n", array_name.c_str(), i3, dim[3] - 1); - throw std::out_of_range(buf); - } - - if ((i4 < 0) | (i4 >= dim[4])) { - char buf[1024]; - sprintf(buf, "%s: index i4=%ld out of range (0, %ld)\n", array_name.c_str(), i4, dim[4] - 1); - throw std::out_of_range(buf); - } - - if ((i5 < 0) | (i5 >= dim[5])) { - char buf[1024]; - sprintf(buf, "%s: index i5=%ld out of range (0, %ld)\n", array_name.c_str(), i5, dim[5] - 1); - throw std::out_of_range(buf); - } - - } - -#endif - - /** - * Array access operator() for reading. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline const T &operator()(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) const { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, i2, i3, i4, i5); -#endif - - return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3 * s[3] + i4 * s[4] + i5]; - - } - - /** - * Array access operator() for writing. If preprocessor macro MULTIARRAY_INDICES_CHECK is defined, then the check of index will - * be performed before accessing memory. By default this is turned off. - * @param i0,... indices - */ - inline T &operator()(size_t i0, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) { -#ifdef MULTIARRAY_INDICES_CHECK - check_indices(i0, i1, i2, i3, i4, i5); -#endif - - return data[i0 * s[0] + i1 * s[1] + i2 * s[2] + i3 * s[3] + i4 * s[4] + i5]; - - } - - /** - * Array comparison operator - * @param other - */ - bool operator==(const Array6D &other) const { - //compare dimensions - for (int d = 0; d < ndim; d++) { - if (this->dim[d] != other.dim[d]) - return false; - } - return ContiguousArrayND::operator==(other); - } - - /** - * Convert to nested vector> container - * @return vector container - */ - vector>>>>> to_vector() const { - vector>>>>> res; - - res.resize(dim[0]); - - for (int i0 = 0; i0 < dim[0]; i0++) { - res[i0].resize(dim[1]); - - - for (int i1 = 0; i1 < dim[1]; i1++) { - res[i0][i1].resize(dim[2]); - - - for (int i2 = 0; i2 < dim[2]; i2++) { - res[i0][i1][i2].resize(dim[3]); - - - for (int i3 = 0; i3 < dim[3]; i3++) { - res[i0][i1][i2][i3].resize(dim[4]); - - - for (int i4 = 0; i4 < dim[4]; i4++) { - res[i0][i1][i2][i3][i4].resize(dim[5]); - - - for (int i5 = 0; i5 < dim[5]; i5++) { - res[i0][i1][i2][i3][i4][i5] = operator()(i0, i1, i2, i3, i4, i5); - - } - } - } - } - } - } - - - return res; - } // end to_vector() - - - /** - * Set values to vector> container - * @param vec container - */ - void set_vector(const vector>>>>> &vec) { - size_t d0 = 0; - size_t d1 = 0; - size_t d2 = 0; - size_t d3 = 0; - size_t d4 = 0; - size_t d5 = 0; - d0 = vec.size(); - - if (d0 > 0) { - d1 = vec.at(0).size(); - if (d1 > 0) { - d2 = vec.at(0).at(0).size(); - if (d2 > 0) { - d3 = vec.at(0).at(0).at(0).size(); - if (d3 > 0) { - d4 = vec.at(0).at(0).at(0).at(0).size(); - if (d4 > 0) { - d5 = vec.at(0).at(0).at(0).at(0).at(0).size(); - - - } - } - } - } - } - - init(d0, d1, d2, d3, d4, d5, array_name); - for (int i0 = 0; i0 < dim[0]; i0++) { - if (vec.at(i0).size() != d1) - throw std::invalid_argument("Vector size is not constant at dimension 1"); - - for (int i1 = 0; i1 < dim[1]; i1++) { - if (vec.at(i0).at(i1).size() != d2) - throw std::invalid_argument("Vector size is not constant at dimension 2"); - - for (int i2 = 0; i2 < dim[2]; i2++) { - if (vec.at(i0).at(i1).at(i2).size() != d3) - throw std::invalid_argument("Vector size is not constant at dimension 3"); - - for (int i3 = 0; i3 < dim[3]; i3++) { - if (vec.at(i0).at(i1).at(i2).at(i3).size() != d4) - throw std::invalid_argument("Vector size is not constant at dimension 4"); - - for (int i4 = 0; i4 < dim[4]; i4++) { - if (vec.at(i0).at(i1).at(i2).at(i3).at(i4).size() != d5) - throw std::invalid_argument("Vector size is not constant at dimension 5"); - - for (int i5 = 0; i5 < dim[5]; i5++) { - operator()(i0, i1, i2, i3, i4, i5) = vec.at(i0).at(i1).at(i2).at(i3).at(i4).at(i5); - - } - } - } - } - } - } - - } - - /** - * Parametrized constructor from vector> container - * @param vec container - * @param array_name array name - */ - Array6D(const vector>>>>> &vec, const string &array_name = "Array6D") { - this->set_vector(vec); - this->array_name = array_name; - } - - /** - * operator= to vector> container - * @param vec container - */ - Array6D &operator=(const vector>>>>> &vec) { - this->set_vector(vec); - return *this; - } - - - /** - * operator= to flatten vector container - * @param vec container - */ - Array6D &operator=(const vector &vec) { - this->set_flatten_vector(vec); - return *this; - } - - - vector get_shape() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = dim[d]; - return sh; - } - - vector get_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d]; - return sh; - } - - vector get_memory_strides() const { - vector sh(ndim); - for (int d = 0; d < ndim; d++) - sh[d] = s[d] * sizeof(T); - return sh; - } -}; - - -#endif //ACE_MULTIARRAY_H diff --git a/lib/pace/ace_c_basis.cpp b/lib/pace/ace_c_basis.cpp deleted file mode 100644 index d1c55700b7..0000000000 --- a/lib/pace/ace_c_basis.cpp +++ /dev/null @@ -1,980 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Yury Lysogorskiy on 1.04.20. - -#include "ace_c_basis.h" -#include "ships_radial.h" - -using namespace std; - -ACECTildeBasisSet::ACECTildeBasisSet(string filename) { - load(filename); -} - -ACECTildeBasisSet::ACECTildeBasisSet(const ACECTildeBasisSet &other) { - ACECTildeBasisSet::_copy_scalar_memory(other); - ACECTildeBasisSet::_copy_dynamic_memory(other); - pack_flatten_basis(); -} - - -ACECTildeBasisSet &ACECTildeBasisSet::operator=(const ACECTildeBasisSet &other) { - if (this != &other) { - _clean(); - _copy_scalar_memory(other); - _copy_dynamic_memory(other); - pack_flatten_basis(); - } - return *this; -} - - -ACECTildeBasisSet::~ACECTildeBasisSet() { - ACECTildeBasisSet::_clean(); -} - -void ACECTildeBasisSet::_clean() { - // call parent method - ACEFlattenBasisSet::_clean(); - _clean_contiguous_arrays(); - _clean_basis_arrays(); -} - -void ACECTildeBasisSet::_copy_scalar_memory(const ACECTildeBasisSet &src) { - ACEFlattenBasisSet::_copy_scalar_memory(src); - num_ctilde_max = src.num_ctilde_max; -} - -void ACECTildeBasisSet::_copy_dynamic_memory(const ACECTildeBasisSet &src) {//allocate new memory - ACEFlattenBasisSet::_copy_dynamic_memory(src); - - if (src.basis_rank1 == nullptr) - throw runtime_error("Could not copy ACECTildeBasisSet::basis_rank1 - array not initialized"); - if (src.basis == nullptr) throw runtime_error("Could not copy ACECTildeBasisSet::basis - array not initialized"); - - - basis_rank1 = new ACECTildeBasisFunction *[src.nelements]; - basis = new ACECTildeBasisFunction *[src.nelements]; - - //copy basis arrays - for (SPECIES_TYPE mu = 0; mu < src.nelements; ++mu) { - basis_rank1[mu] = new ACECTildeBasisFunction[src.total_basis_size_rank1[mu]]; - - for (size_t i = 0; i < src.total_basis_size_rank1[mu]; i++) { - basis_rank1[mu][i] = src.basis_rank1[mu][i]; - } - - - basis[mu] = new ACECTildeBasisFunction[src.total_basis_size[mu]]; - for (size_t i = 0; i < src.total_basis_size[mu]; i++) { - basis[mu][i] = src.basis[mu][i]; - } - } - //DON"T COPY CONTIGUOUS ARRAY, REBUILD THEM -} - -void ACECTildeBasisSet::_clean_contiguous_arrays() { - ACEFlattenBasisSet::_clean_contiguous_arrays(); - - delete[] full_c_tildes_rank1; - full_c_tildes_rank1 = nullptr; - - delete[] full_c_tildes; - full_c_tildes = nullptr; -} - -//re-pack the constituent dynamic arrays of all basis functions in contiguous arrays -void ACECTildeBasisSet::pack_flatten_basis() { - compute_array_sizes(basis_rank1, basis); - - //1. clean contiguous arrays - _clean_contiguous_arrays(); - //2. allocate contiguous arrays - delete[] full_ns_rank1; - full_ns_rank1 = new NS_TYPE[rank_array_total_size_rank1]; - delete[] full_ls_rank1; - full_ls_rank1 = new NS_TYPE[rank_array_total_size_rank1]; - delete[] full_mus_rank1; - full_mus_rank1 = new SPECIES_TYPE[rank_array_total_size_rank1]; - delete[] full_ms_rank1; - full_ms_rank1 = new MS_TYPE[rank_array_total_size_rank1]; - - delete[] full_c_tildes_rank1; - full_c_tildes_rank1 = new DOUBLE_TYPE[coeff_array_total_size_rank1]; - - - delete[] full_ns; - full_ns = new NS_TYPE[rank_array_total_size]; - delete[] full_ls; - full_ls = new LS_TYPE[rank_array_total_size]; - delete[] full_mus; - full_mus = new SPECIES_TYPE[rank_array_total_size]; - delete[] full_ms; - full_ms = new MS_TYPE[ms_array_total_size]; - - delete[] full_c_tildes; - full_c_tildes = new DOUBLE_TYPE[coeff_array_total_size]; - - - //3. copy the values from private C_tilde_B_basis_function arrays to new contigous space - //4. clean private memory - //5. reassign private array pointers - - //r = 0, rank = 1 - size_t rank_array_ind_rank1 = 0; - size_t coeff_array_ind_rank1 = 0; - size_t ms_array_ind_rank1 = 0; - - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - for (int func_ind_r1 = 0; func_ind_r1 < total_basis_size_rank1[mu]; ++func_ind_r1) { - ACECTildeBasisFunction &func = basis_rank1[mu][func_ind_r1]; - - //copy values ns from c_tilde_basis_function private memory to contigous memory part - full_ns_rank1[rank_array_ind_rank1] = func.ns[0]; - - //copy values ls from c_tilde_basis_function private memory to contigous memory part - full_ls_rank1[rank_array_ind_rank1] = func.ls[0]; - - //copy values mus from c_tilde_basis_function private memory to contigous memory part - full_mus_rank1[rank_array_ind_rank1] = func.mus[0]; - - //copy values ctildes from c_tilde_basis_function private memory to contigous memory part - memcpy(&full_c_tildes_rank1[coeff_array_ind_rank1], func.ctildes, - func.ndensity * sizeof(DOUBLE_TYPE)); - - - //copy values mus from c_tilde_basis_function private memory to contigous memory part - memcpy(&full_ms_rank1[ms_array_ind_rank1], func.ms_combs, - func.num_ms_combs * - func.rank * sizeof(MS_TYPE)); - - //release memory of each ACECTildeBasisFunction if it is not proxy - func._clean(); - - func.mus = &full_mus_rank1[rank_array_ind_rank1]; - func.ns = &full_ns_rank1[rank_array_ind_rank1]; - func.ls = &full_ls_rank1[rank_array_ind_rank1]; - func.ms_combs = &full_ms_rank1[ms_array_ind_rank1]; - func.ctildes = &full_c_tildes_rank1[coeff_array_ind_rank1]; - func.is_proxy = true; - - rank_array_ind_rank1 += func.rank; - ms_array_ind_rank1 += func.rank * - func.num_ms_combs; - coeff_array_ind_rank1 += func.num_ms_combs * func.ndensity; - - } - } - - - //rank>1, r>0 - size_t rank_array_ind = 0; - size_t coeff_array_ind = 0; - size_t ms_array_ind = 0; - - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - for (int func_ind = 0; func_ind < total_basis_size[mu]; ++func_ind) { - ACECTildeBasisFunction &func = basis[mu][func_ind]; - - //copy values mus from c_tilde_basis_function private memory to contigous memory part - memcpy(&full_mus[rank_array_ind], func.mus, - func.rank * sizeof(SPECIES_TYPE)); - - //copy values ns from c_tilde_basis_function private memory to contigous memory part - memcpy(&full_ns[rank_array_ind], func.ns, - func.rank * sizeof(NS_TYPE)); - //copy values ls from c_tilde_basis_function private memory to contigous memory part - memcpy(&full_ls[rank_array_ind], func.ls, - func.rank * sizeof(LS_TYPE)); - //copy values mus from c_tilde_basis_function private memory to contigous memory part - memcpy(&full_ms[ms_array_ind], func.ms_combs, - func.num_ms_combs * - func.rank * sizeof(MS_TYPE)); - - //copy values ctildes from c_tilde_basis_function private memory to contigous memory part - memcpy(&full_c_tildes[coeff_array_ind], func.ctildes, - func.num_ms_combs * func.ndensity * sizeof(DOUBLE_TYPE)); - - - //release memory of each ACECTildeBasisFunction if it is not proxy - func._clean(); - - func.ns = &full_ns[rank_array_ind]; - func.ls = &full_ls[rank_array_ind]; - func.mus = &full_mus[rank_array_ind]; - func.ctildes = &full_c_tildes[coeff_array_ind]; - func.ms_combs = &full_ms[ms_array_ind]; - func.is_proxy = true; - - rank_array_ind += func.rank; - ms_array_ind += func.rank * - func.num_ms_combs; - coeff_array_ind += func.num_ms_combs * func.ndensity; - } - } -} - -void fwrite_c_tilde_b_basis_func(FILE *fptr, ACECTildeBasisFunction &func) { - RANK_TYPE r; - fprintf(fptr, "ctilde_basis_func: "); - fprintf(fptr, "rank=%d ndens=%d mu0=%d ", func.rank, func.ndensity, func.mu0); - - fprintf(fptr, "mu=("); - for (r = 0; r < func.rank; ++r) - fprintf(fptr, " %d ", func.mus[r]); - fprintf(fptr, ")\n"); - - fprintf(fptr, "n=("); - for (r = 0; r < func.rank; ++r) - fprintf(fptr, " %d ", func.ns[r]); - fprintf(fptr, ")\n"); - - fprintf(fptr, "l=("); - for (r = 0; r < func.rank; ++r) - fprintf(fptr, " %d ", func.ls[r]); - fprintf(fptr, ")\n"); - - fprintf(fptr, "num_ms=%d\n", func.num_ms_combs); - - for (int m_ind = 0; m_ind < func.num_ms_combs; m_ind++) { - fprintf(fptr, "<"); - for (r = 0; r < func.rank; ++r) - fprintf(fptr, " %d ", func.ms_combs[m_ind * func.rank + r]); - fprintf(fptr, ">: "); - for (DENSITY_TYPE p = 0; p < func.ndensity; p++) - fprintf(fptr, " %.18f ", func.ctildes[m_ind * func.ndensity + p]); - fprintf(fptr, "\n"); - } - -} - -void ACECTildeBasisSet::save(const string &filename) { - FILE *fptr; - fptr = fopen(filename.c_str(), "w"); - - fprintf(fptr, "nelements=%d\n", nelements); - - //elements mapping - fprintf(fptr, "elements:"); - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) - fprintf(fptr, " %s", elements_name[mu].c_str()); - fprintf(fptr, "\n\n"); - - fprintf(fptr, "lmax=%d\n\n", lmax); - - fprintf(fptr, "embedding-function: %s\n", npoti.c_str()); - - fprintf(fptr, "%ld FS parameters: ", FS_parameters.size()); - for (int i = 0; i < FS_parameters.size(); ++i) { - fprintf(fptr, " %f", FS_parameters.at(i)); - } - fprintf(fptr, "\n"); - - //hard-core energy cutoff repulsion - fprintf(fptr, "core energy-cutoff parameters: "); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - fprintf(fptr, "%.18f %.18f\n", rho_core_cutoffs(mu_i), drho_core_cutoffs(mu_i)); - - // save E0 values - fprintf(fptr, "E0:"); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - fprintf(fptr, " %.18f", E0vals(mu_i)); - fprintf(fptr, "\n"); - - - fprintf(fptr, "\n"); - - - fprintf(fptr, "radbasename=%s\n", radial_functions->radbasename.c_str()); - fprintf(fptr, "nradbase=%d\n", nradbase); - fprintf(fptr, "nradmax=%d\n", nradmax); - - - fprintf(fptr, "cutoffmax=%f\n", cutoffmax); - - fprintf(fptr, "deltaSplineBins=%f\n", deltaSplineBins); - - //hard-core repulsion - fprintf(fptr, "core repulsion parameters: "); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) - fprintf(fptr, "%.18f %.18f\n", radial_functions->prehc(mu_i, mu_j), radial_functions->lambdahc(mu_j, mu_j)); - - - - - - //TODO: radial functions - //radparameter - fprintf(fptr, "radparameter="); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) - fprintf(fptr, " %.18f", radial_functions->lambda(mu_i, mu_j)); - fprintf(fptr, "\n"); - - fprintf(fptr, "cutoff="); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) - fprintf(fptr, " %.18f", radial_functions->cut(mu_i, mu_j)); - fprintf(fptr, "\n"); - - fprintf(fptr, "dcut="); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) - fprintf(fptr, " %.18f", radial_functions->dcut(mu_i, mu_j)); - fprintf(fptr, "\n"); - - fprintf(fptr, "crad="); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { - for (NS_TYPE k = 0; k < nradbase; k++) { - for (NS_TYPE n = 0; n < nradmax; n++) { - for (LS_TYPE l = 0; l <= lmax; l++) { - fprintf(fptr, " %.18f", radial_functions->crad(mu_i, mu_j, n, l, k)); - } - fprintf(fptr, "\n"); - } - } - } - - fprintf(fptr, "\n"); - - fprintf(fptr, "rankmax=%d\n", rankmax); - fprintf(fptr, "ndensitymax=%d\n", ndensitymax); - fprintf(fptr, "\n"); - - //num_c_tilde_max - fprintf(fptr, "num_c_tilde_max=%d\n", num_ctilde_max); - fprintf(fptr, "num_ms_combinations_max=%d\n", num_ms_combinations_max); - - - //write total_basis_size and total_basis_size_rank1 - fprintf(fptr, "total_basis_size_rank1: "); - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - fprintf(fptr, "%d ", total_basis_size_rank1[mu]); - } - fprintf(fptr, "\n"); - - for (SPECIES_TYPE mu = 0; mu < nelements; mu++) - for (SHORT_INT_TYPE func_ind = 0; func_ind < total_basis_size_rank1[mu]; ++func_ind) - fwrite_c_tilde_b_basis_func(fptr, basis_rank1[mu][func_ind]); - - fprintf(fptr, "total_basis_size: "); - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - fprintf(fptr, "%d ", total_basis_size[mu]); - } - fprintf(fptr, "\n"); - - for (SPECIES_TYPE mu = 0; mu < nelements; mu++) - for (SHORT_INT_TYPE func_ind = 0; func_ind < total_basis_size[mu]; ++func_ind) - fwrite_c_tilde_b_basis_func(fptr, basis[mu][func_ind]); - - - fclose(fptr); -} - -void fread_c_tilde_b_basis_func(FILE *fptr, ACECTildeBasisFunction &func) { - RANK_TYPE r; - int res; - char buf[3][128]; - - res = fscanf(fptr, " ctilde_basis_func: "); - - res = fscanf(fptr, "rank=%s ndens=%s mu0=%s ", buf[0], buf[1], buf[2]); - if (res != 3) - throw invalid_argument("Could not read C-tilde basis function"); - - func.rank = (RANK_TYPE) stol(buf[0]); - func.ndensity = (DENSITY_TYPE) stol(buf[1]); - func.mu0 = (SPECIES_TYPE) stol(buf[2]); - - func.mus = new SPECIES_TYPE[func.rank]; - func.ns = new NS_TYPE[func.rank]; - func.ls = new LS_TYPE[func.rank]; - - res = fscanf(fptr, " mu=("); - for (r = 0; r < func.rank; ++r) { - res = fscanf(fptr, "%s", buf[0]); - if (res != 1) - throw invalid_argument("Could not read C-tilde basis function"); - func.mus[r] = (SPECIES_TYPE) stol(buf[0]); - } - res = fscanf(fptr, " )"); // ")" - - res = fscanf(fptr, " n=("); // "n=" - for (r = 0; r < func.rank; ++r) { - res = fscanf(fptr, "%s", buf[0]); - if (res != 1) - throw invalid_argument("Could not read C-tilde basis function"); - - func.ns[r] = (NS_TYPE) stol(buf[0]); - } - res = fscanf(fptr, " )"); - - res = fscanf(fptr, " l=("); - for (r = 0; r < func.rank; ++r) { - res = fscanf(fptr, "%s", buf[0]); - if (res != 1) - throw invalid_argument("Could not read C-tilde basis function"); - func.ls[r] = (NS_TYPE) stol(buf[0]); - } - res = fscanf(fptr, " )"); - - res = fscanf(fptr, " num_ms=%s\n", buf[0]); - if (res != 1) - throw invalid_argument("Could not read C-tilde basis function"); - - func.num_ms_combs = (SHORT_INT_TYPE) stoi(buf[0]); - - func.ms_combs = new MS_TYPE[func.rank * func.num_ms_combs]; - func.ctildes = new DOUBLE_TYPE[func.ndensity * func.num_ms_combs]; - - for (int m_ind = 0; m_ind < func.num_ms_combs; m_ind++) { - res = fscanf(fptr, " <"); - for (r = 0; r < func.rank; ++r) { - res = fscanf(fptr, "%s", buf[0]); - if (res != 1) - throw invalid_argument("Could not read C-tilde basis function"); - func.ms_combs[m_ind * func.rank + r] = stoi(buf[0]); - } - res = fscanf(fptr, " >:"); - for (DENSITY_TYPE p = 0; p < func.ndensity; p++) { - res = fscanf(fptr, "%s", buf[0]); - if (res != 1) - throw invalid_argument("Could not read C-tilde basis function"); - func.ctildes[m_ind * func.ndensity + p] = stod(buf[0]); - } - } -} - -string -format_error_message(const char *buffer, const string &filename, const string &var_name, const string &expected) { - string err_message = "File '" + filename + "': couldn't read '" + var_name + "'"; - if (buffer) - err_message = err_message + ", read:'" + buffer + "'"; - if (!expected.empty()) - err_message = err_message + ". Expected format: '" + expected + "'"; - return err_message; -} - -void throw_error(const string &filename, const string &var_name, const string expected = "") { - throw invalid_argument(format_error_message(nullptr, filename, var_name, expected)); -} - -DOUBLE_TYPE stod_err(const char *buffer, const string &filename, const string &var_name, const string expected = "") { - try { - return stod(buffer); - } catch (invalid_argument &exc) { - throw invalid_argument(format_error_message(buffer, filename, var_name, expected).c_str()); - } -} - -int stoi_err(const char *buffer, const string &filename, const string &var_name, const string expected = "") { - try { - return stoi(buffer); - } catch (invalid_argument &exc) { - throw invalid_argument(format_error_message(buffer, filename, var_name, expected).c_str()); - } -} - -long int stol_err(const char *buffer, const string &filename, const string &var_name, const string expected = "") { - try { - return stol(buffer); - } catch (invalid_argument &exc) { - throw invalid_argument(format_error_message(buffer, filename, var_name, expected).c_str()); - } -} - -void ACECTildeBasisSet::load(const string filename) { - int res; - char buffer[1024], buffer2[1024]; - string radbasename = "ChebExpCos"; - - FILE *fptr; - fptr = fopen(filename.c_str(), "r"); - if (fptr == NULL) - throw invalid_argument("Could not open file " + filename); - - //read number of elements - res = fscanf(fptr, " nelements="); - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "nelements", "nelements=[number]"); - nelements = stoi_err(buffer, filename, "nelements", "nelements=[number]"); - - //elements mapping - elements_name = new string[nelements]; - res = fscanf(fptr, " elements:"); - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "elements", "elements: Ele1 Ele2 ..."); - elements_name[mu] = buffer; - } - - // load angular basis - only need spherical harmonics parameter - res = fscanf(fptr, " lmax=%s\n", buffer); - if (res != 1) - throw_error(filename, "lmax", "lmax=[number]"); - lmax = stoi_err(buffer, filename, "lmax", "lmax=[number]"); - spherical_harmonics.init(lmax); - - - // reading "embedding-function:" - bool is_embedding_function_specified = false; - res = fscanf(fptr, " embedding-function: %s", buffer); - if (res == 0) { - //throw_error(filename, "E0", " E0: E0-species1 E0-species2 ..."); - this->npoti = "FinnisSinclair"; // default values - //printf("Warning! No embedding-function is specified, embedding-function: FinnisSinclair would be assumed\n"); - is_embedding_function_specified = false; - } else { - this->npoti = buffer; - is_embedding_function_specified = true; - } - int parameters_size; - res = fscanf(fptr, "%s FS parameters:", buffer); - if (res != 1) - throw_error(filename, "FS parameters size", "[number] FS parameters: par1 par2 ..."); - parameters_size = stoi_err(buffer, filename, "FS parameters size", "[number] FS parameters"); - FS_parameters.resize(parameters_size); - for (int i = 0; i < FS_parameters.size(); ++i) { - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "FS parameter", "[number] FS parameters: [par1] [par2] ..."); - FS_parameters[i] = stod_err(buffer, filename, "FS parameter", "[number] FS parameters: [par1] [par2] ..."); - } - - if (!is_embedding_function_specified) { - // assuming non-linear potential, and embedding function type is important - for (int j = 1; j < parameters_size; j += 2) - if (FS_parameters[j] != 1.0) { //if not ensure linearity of embedding function parameters - printf("ERROR! Your potential is non-linear\n"); - printf("Please specify 'embedding-function: FinnisSinclair' or 'embedding-function: FinnisSinclairShiftedScaled' before 'FS parameters size' line\n"); - throw_error(filename, "embedding-function", "FinnisSinclair or FinnisSinclairShiftedScaled"); - } - printf("Notice! No embedding-function is specified, but potential has linear embedding, default embedding-function: FinnisSinclair would be assumed\n"); - } - - //hard-core energy cutoff repulsion - res = fscanf(fptr, " core energy-cutoff parameters:"); - if (res != 0) - throw_error(filename, "core energy-cutoff parameters", "core energy-cutoff parameters: [par1] [par2]"); - - rho_core_cutoffs.init(nelements, "rho_core_cutoffs"); - drho_core_cutoffs.init(nelements, "drho_core_cutoffs"); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) { - res = fscanf(fptr, "%s %s", buffer, buffer2); - if (res != 2) - throw_error(filename, "core energy-cutoff parameters", - "core energy-cutoff parameters: [rho_core_cut] [drho_core_cutoff] ..."); - rho_core_cutoffs(mu_i) = stod_err(buffer, filename, "rho core cutoff", - "core energy-cutoff parameters: [rho_core_cut] [drho_core_cutoff] ..."); - drho_core_cutoffs(mu_i) = stod_err(buffer2, filename, "drho_core_cutoff", - "core energy-cutoff parameters: [rho_core_cut] [drho_core_cutoff] ..."); - } - - // atom energy shift E0 (energy of isolated atom) - E0vals.init(nelements); - - // reading "E0:" - res = fscanf(fptr, " E0: %s", buffer); - if (res == 0) { - //throw_error(filename, "E0", " E0: E0-species1 E0-species2 ..."); - E0vals.fill(0.0); - } else { - double E0 = atof(buffer); - E0vals(0) = E0; - - for (SPECIES_TYPE mu_i = 1; mu_i < nelements; ++mu_i) { - res = fscanf(fptr, " %lf", &E0); - if (res != 1) - throw_error(filename, "E0", " couldn't read one of the E0 values"); - E0vals(mu_i) = E0; - } - res = fscanf(fptr, "\n"); - if (res != 0) - printf("file %s : format seems broken near E0; trying to continue...\n", filename.c_str()); - } - - // check which radial basis we need to load - res = fscanf(fptr, " radbasename=%s\n", buffer); - if (res != 1) { - throw_error(filename, "radbasename", "rabbasename=ChebExpCos|ChebPow|ACE.jl.Basic"); - } else { - radbasename = buffer; - } - -// printf("radbasename = `%s`\n", radbasename.c_str()); - if (radbasename == "ChebExpCos" | radbasename == "ChebPow") { - _load_radial_ACERadial(fptr, filename, radbasename); - } else if (radbasename == "ACE.jl.Basic") { - _load_radial_SHIPsBasic(fptr, filename, radbasename); - } else { - throw invalid_argument( - ("File '" + filename + "': I don't know how to read radbasename = " + radbasename).c_str()); - } - - res = fscanf(fptr, " rankmax="); - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "rankmax", "rankmax=[number]"); - rankmax = stoi_err(buffer, filename, "rankmax", "rankmax=[number]"); - - res = fscanf(fptr, " ndensitymax="); - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "ndensitymax", "ndensitymax=[number]"); - ndensitymax = stoi_err(buffer, filename, "ndensitymax", "ndensitymax=[number]"); - - // read the list of correlations to be put into the basis - //num_c_tilde_max - res = fscanf(fptr, " num_c_tilde_max="); - res = fscanf(fptr, "%s\n", buffer); - if (res != 1) - throw_error(filename, "num_c_tilde_max", "num_c_tilde_max=[number]"); - num_ctilde_max = stol_err(buffer, filename, "num_c_tilde_max", "num_c_tilde_max=[number]"); - - res = fscanf(fptr, " num_ms_combinations_max="); - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "num_ms_combinations_max", "num_ms_combinations_max=[number]"); -// throw invalid_argument(("File '" + filename + "': couldn't read num_ms_combinations_max").c_str()); - num_ms_combinations_max = stol_err(buffer, filename, "num_ms_combinations_max", "num_ms_combinations_max=[number]"); - - //read total_basis_size_rank1 - total_basis_size_rank1 = new SHORT_INT_TYPE[nelements]; - basis_rank1 = new ACECTildeBasisFunction *[nelements]; - res = fscanf(fptr, " total_basis_size_rank1: "); - - - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "total_basis_size_rank1", "total_basis_size_rank1: [size_ele1] [size_ele2] ..."); -// throw invalid_argument(("File '" + filename + "': couldn't read total_basis_size_rank1").c_str()); - total_basis_size_rank1[mu] = stoi_err(buffer, filename, "total_basis_size_rank1", - "total_basis_size_rank1: [size_ele1] [size_ele2] ..."); - basis_rank1[mu] = new ACECTildeBasisFunction[total_basis_size_rank1[mu]]; - } - for (SPECIES_TYPE mu = 0; mu < nelements; mu++) - for (SHORT_INT_TYPE func_ind = 0; func_ind < total_basis_size_rank1[mu]; ++func_ind) { - fread_c_tilde_b_basis_func(fptr, basis_rank1[mu][func_ind]); - } - - //read total_basis_size - res = fscanf(fptr, " total_basis_size: "); - total_basis_size = new SHORT_INT_TYPE[nelements]; - basis = new ACECTildeBasisFunction *[nelements]; - - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "total_basis_size", "total_basis_size: [size_ele1] [size_ele2] ..."); - total_basis_size[mu] = stoi_err(buffer, filename, "total_basis_size", - "total_basis_size: [size_ele1] [size_ele2] ..."); - basis[mu] = new ACECTildeBasisFunction[total_basis_size[mu]]; - } - for (SPECIES_TYPE mu = 0; mu < nelements; mu++) - for (SHORT_INT_TYPE func_ind = 0; func_ind < total_basis_size[mu]; ++func_ind) { - fread_c_tilde_b_basis_func(fptr, basis[mu][func_ind]); - } - - fclose(fptr); - -// radial_functions->radbasename = radbasename; - radial_functions->setuplookupRadspline(); - pack_flatten_basis(); -} - -void ACECTildeBasisSet::compute_array_sizes(ACECTildeBasisFunction **basis_rank1, ACECTildeBasisFunction **basis) { - //compute arrays sizes - rank_array_total_size_rank1 = 0; - //ms_array_total_size_rank1 = rank_array_total_size_rank1; - coeff_array_total_size_rank1 = 0; - - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - if (total_basis_size_rank1[mu] > 0) { - rank_array_total_size_rank1 += total_basis_size_rank1[mu]; - - ACEAbstractBasisFunction &func = basis_rank1[mu][0];//TODO: get total density instead of density from first function - coeff_array_total_size_rank1 += total_basis_size_rank1[mu] * func.ndensity; - } - } - - rank_array_total_size = 0; - coeff_array_total_size = 0; - - ms_array_total_size = 0; - max_dB_array_size = 0; - - - max_B_array_size = 0; - - size_t cur_ms_size = 0; - size_t cur_ms_rank_size = 0; - - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - - cur_ms_size = 0; - cur_ms_rank_size = 0; - for (int func_ind = 0; func_ind < total_basis_size[mu]; ++func_ind) { - auto &func = basis[mu][func_ind]; - rank_array_total_size += func.rank; - ms_array_total_size += func.rank * func.num_ms_combs; - coeff_array_total_size += func.ndensity * func.num_ms_combs; - - cur_ms_size += func.num_ms_combs; - cur_ms_rank_size += func.rank * func.num_ms_combs; - } - - if (cur_ms_size > max_B_array_size) - max_B_array_size = cur_ms_size; - - if (cur_ms_rank_size > max_dB_array_size) - max_dB_array_size = cur_ms_rank_size; - } -} - -void ACECTildeBasisSet::_clean_basis_arrays() { - if (basis_rank1 != nullptr) - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - delete[] basis_rank1[mu]; - basis_rank1[mu] = nullptr; - } - - if (basis != nullptr) - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - delete[] basis[mu]; - basis[mu] = nullptr; - } - delete[] basis; - basis = nullptr; - - delete[] basis_rank1; - basis_rank1 = nullptr; -} - -//pack into 1D array with all basis functions -void ACECTildeBasisSet::flatten_basis(C_tilde_full_basis_vector2d &mu0_ctilde_basis_vector) { - - _clean_basis_arrays(); - basis_rank1 = new ACECTildeBasisFunction *[nelements]; - basis = new ACECTildeBasisFunction *[nelements]; - - delete[] total_basis_size_rank1; - delete[] total_basis_size; - total_basis_size_rank1 = new SHORT_INT_TYPE[nelements]; - total_basis_size = new SHORT_INT_TYPE[nelements]; - - - size_t tot_size_rank1 = 0; - size_t tot_size = 0; - - for (SPECIES_TYPE mu = 0; mu < this->nelements; ++mu) { - tot_size = 0; - tot_size_rank1 = 0; - - for (auto &func: mu0_ctilde_basis_vector[mu]) { - if (func.rank == 1) tot_size_rank1 += 1; - else tot_size += 1; - } - - total_basis_size_rank1[mu] = tot_size_rank1; - basis_rank1[mu] = new ACECTildeBasisFunction[tot_size_rank1]; - - total_basis_size[mu] = tot_size; - basis[mu] = new ACECTildeBasisFunction[tot_size]; - } - - - for (SPECIES_TYPE mu = 0; mu < this->nelements; ++mu) { - size_t ind_rank1 = 0; - size_t ind = 0; - - for (auto &func: mu0_ctilde_basis_vector[mu]) { - if (func.rank == 1) { //r=0, rank=1 - basis_rank1[mu][ind_rank1] = func; - ind_rank1 += 1; - } else { //r>0, rank>1 - basis[mu][ind] = func; - ind += 1; - } - } - - } -} - - -void ACECTildeBasisSet::_load_radial_ACERadial(FILE *fptr, - const string filename, - const string radbasename) { - int res; - char buffer[1024], buffer2[1024]; - - res = fscanf(fptr, " nradbase="); - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "nradbase", "nradbase=[number]"); -// throw invalid_argument(("File '" + filename + "': couldn't read nradbase").c_str()); - nradbase = stoi_err(buffer, filename, "nradbase", "nradbase=[number]"); - - res = fscanf(fptr, " nradmax="); - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "nradmax", "nradmax=[number]"); - nradmax = stoi_err(buffer, filename, "nradmax", "nradmax=[number]"); - - res = fscanf(fptr, " cutoffmax="); - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "cutoffmax", "cutoffmax=[number]"); - cutoffmax = stod_err(buffer, filename, "cutoffmax", "cutoffmax=[number]"); - - - res = fscanf(fptr, " deltaSplineBins="); - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "deltaSplineBins", "deltaSplineBins=[spline density, Angstroms]"); -// throw invalid_argument(("File '" + filename + "': couldn't read ntot").c_str()); - deltaSplineBins = stod_err(buffer, filename, "deltaSplineBins", "deltaSplineBins=[spline density, Angstroms]"); - - - if (radial_functions == nullptr) - radial_functions = new ACERadialFunctions(nradbase, lmax, nradmax, - deltaSplineBins, - nelements, - cutoffmax, radbasename); - else - radial_functions->init(nradbase, lmax, nradmax, - deltaSplineBins, - nelements, - cutoffmax, radbasename); - - - //hard-core repulsion - res = fscanf(fptr, " core repulsion parameters:"); - if (res != 0) - throw_error(filename, "core repulsion parameters", "core repulsion parameters: [prehc lambdahc] ..."); -// throw invalid_argument(("File '" + filename + "': couldn't read core repulsion parameters").c_str()); - - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { - res = fscanf(fptr, "%s %s", buffer, buffer2); - if (res != 2) - throw_error(filename, "core repulsion parameters", "core repulsion parameters: [prehc lambdahc] ..."); - radial_functions->prehc(mu_i, mu_j) = stod_err(buffer, filename, "core repulsion parameters", - "core repulsion parameters: [prehc lambdahc] ..."); - radial_functions->lambdahc(mu_i, mu_j) = stod_err(buffer2, filename, "core repulsion parameters", - "core repulsion parameters: [prehc lambdahc] ..."); - } - - - - //read radial functions parameter - res = fscanf(fptr, " radparameter="); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "radparameter", "radparameter=[param_ele1] [param_ele2]"); - radial_functions->lambda(mu_i, mu_j) = stod_err(buffer, filename, "radparameter", - "radparameter=[param_ele1] [param_ele2]"); - } - - - res = fscanf(fptr, " cutoff="); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "cutoff", "cutoff=[param_ele1] [param_ele2]"); - radial_functions->cut(mu_i, mu_j) = stod_err(buffer, filename, "cutoff", - "cutoff=[param_ele1] [param_ele2]"); - } - - - res = fscanf(fptr, " dcut="); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) { - res = fscanf(fptr, " %s", buffer); - if (res != 1) - throw_error(filename, "dcut", "dcut=[param_ele1] [param_ele2]"); - radial_functions->dcut(mu_i, mu_j) = stod_err(buffer, filename, "dcut", "dcut=[param_ele1] [param_ele2]"); - } - - - res = fscanf(fptr, " crad="); - for (SPECIES_TYPE mu_i = 0; mu_i < nelements; ++mu_i) - for (SPECIES_TYPE mu_j = 0; mu_j < nelements; ++mu_j) - for (NS_TYPE k = 0; k < nradbase; k++) - for (NS_TYPE n = 0; n < nradmax; n++) - for (LS_TYPE l = 0; l <= lmax; l++) { - res = fscanf(fptr, "%s", buffer); - if (res != 1) - throw_error(filename, "crad", "crad=[crad_]...[crad_knl]: nradbase*nrad*(l+1) times"); - radial_functions->crad(mu_i, mu_j, n, l, k) = stod_err(buffer, filename, "crad", - "crad=[crad_]...[crad_knl]: nradbase*nrad*(l+1) times"); - } -} - -void ACECTildeBasisSet::_load_radial_SHIPsBasic(FILE *fptr, - const string filename, - const string radbasename) { - // create a radial basis object, and read it from the file pointer - SHIPsRadialFunctions *ships_radial_functions = new SHIPsRadialFunctions(); - ships_radial_functions->fread(fptr); - - //mimic ships_radial_functions to ACERadialFunctions - ships_radial_functions->nradial = ships_radial_functions->get_maxn(); - ships_radial_functions->nradbase = ships_radial_functions->get_maxn(); - - nradbase = ships_radial_functions->get_maxn(); - nradmax = ships_radial_functions->get_maxn(); - cutoffmax = ships_radial_functions->get_rcut(); - deltaSplineBins = 0.001; - - ships_radial_functions->init(nradbase, lmax, nradmax, - deltaSplineBins, - nelements, - cutoffmax, radbasename); - - - if (radial_functions) delete radial_functions; - radial_functions = ships_radial_functions; - radial_functions->prehc.fill(0); - radial_functions->lambdahc.fill(1); - radial_functions->lambda.fill(0); - - - radial_functions->cut.fill(ships_radial_functions->get_rcut()); - radial_functions->dcut.fill(0); - - radial_functions->crad.fill(0); - -} \ No newline at end of file diff --git a/lib/pace/ace_c_basis.h b/lib/pace/ace_c_basis.h deleted file mode 100644 index ec6b9e8afc..0000000000 --- a/lib/pace/ace_c_basis.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Yury Lysogorskiy on 1.04.20. - -#ifndef ACE_C_BASIS_H -#define ACE_C_BASIS_H - -#include "ace_flatten_basis.h" - -typedef vector> C_tilde_full_basis_vector2d; - -/** - * ACE basis set of C-tilde basis functions - */ -class ACECTildeBasisSet : public ACEFlattenBasisSet { -public: - - ACECTildeBasisFunction **basis_rank1 = nullptr; ///< two-dimensional array of first-rank basis function with indices: [species index][func index] - ACECTildeBasisFunction **basis = nullptr; ///< two-dimensional array of higher rank basis function with indices: [species index][func index] - - DOUBLE_TYPE *full_c_tildes_rank1 = nullptr; ///< C_tilde coefficients contiguous package, size: coeff_array_total_size_rank1 - DOUBLE_TYPE *full_c_tildes = nullptr; ///< C_tilde coefficients contiguous package, size: coeff_array_total_size - - //TODO: remove? - SHORT_INT_TYPE num_ctilde_max = 0; - - - /** - * Default constructor - */ - ACECTildeBasisSet() = default; - - /** - * Constructor from .ace file - */ - ACECTildeBasisSet(const string filename); - - /** - * Copy constructor (see. Rule of Three) - * @param other - */ - ACECTildeBasisSet(const ACECTildeBasisSet &other); - - /** - * operator= (see. Rule of Three) - * @param other - * @return - */ - ACECTildeBasisSet &operator=(const ACECTildeBasisSet &other); - - /** - * Destructor (see. Rule of Three) - */ - ~ACECTildeBasisSet() override; - - /** - * Cleaning dynamic memory of the class (see. Rule of Three) - */ - void _clean() override; - - /** - * Copying and cleaning dynamic memory of the class (see. Rule of Three) - * @param src - */ - void _copy_dynamic_memory(const ACECTildeBasisSet &src); - - /** - * Copying scalar variables - * @param src - */ - void _copy_scalar_memory(const ACECTildeBasisSet &src); - - /** - * Clean contiguous arrays (full_c_tildes_rank1, full_c_tildes) and those of base class - */ - void _clean_contiguous_arrays() override ; - - /** - * Save potential to .ace file - * @param filename .ace file name - */ - void save(const string &filename) override; - - /** - * Load potential from .ace - * @param filename .ace file name - */ - void load(const string filename) override; - - /** - * Load the ACE type radial basis - */ - void _load_radial_ACERadial(FILE *fptr, - const string filename, - const string radbasename); - - void _load_radial_SHIPsBasic(FILE * fptr, - const string filename, - const string radbasename ); - - /** - * Re-pack the constituent dynamic arrays of all basis functions in contiguous arrays - */ - void pack_flatten_basis() override; - - /** - * Computes flatten array sizes - * @param basis_rank1 two-dimensional array of first-rank ACECTildeBasisFunctions - * @param basis two-dimensional array of higher-rank ACECTildeBasisFunctions - */ - void compute_array_sizes(ACECTildeBasisFunction** basis_rank1, ACECTildeBasisFunction** basis); - - /** - * Clean basis arrays 'basis_rank1' and 'basis' - */ - void _clean_basis_arrays(); - - /** - * Pack two-dimensional vector of ACECTildeBasisFunction into 1D dynami array with all basis functions - * @param mu0_ctilde_basis_vector vector> - */ - void flatten_basis(C_tilde_full_basis_vector2d& mu0_ctilde_basis_vector); - - /** - * Empty stub implementation - */ - void flatten_basis() override{}; -}; - -#endif //ACE_C_BASIS_H diff --git a/lib/pace/ace_c_basisfunction.h b/lib/pace/ace_c_basisfunction.h deleted file mode 100644 index 4e2795590e..0000000000 --- a/lib/pace/ace_c_basisfunction.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Yury Lysogorskiy on 26.02.20. - -#ifndef ACE_C_BASISFUNCTION_H -#define ACE_C_BASISFUNCTION_H - -#include -#include -#include -#include - -#include "ace_types.h" - -//macros for copying the member-array from "other" object for C-tilde and B-basis -#define basis_mem_copy(other, array, size, type) if(other.array) { \ - if(!is_proxy) delete[] array;\ - array = new type[(size)];\ - is_proxy = false;\ - memcpy(array, other.array, (size) * sizeof(type));\ -} - -/** - * Abstract basis function, that stores general quantities - */ -struct ACEAbstractBasisFunction { - /** - * flattened array of computed combinations of (m1, m2, ..., m_rank) - * which have non-zero general Clebsch-Gordan coefficient: - * \f$ \mathbf{m}_1, \dots, \mathbf{m}_\mathrm{num ms combs}\f$ = - * \f$ (m_1, m_2, \dots, m_{rank})_1, \dots, (m_1, m_2, \dots, m_{rank})_{\mathrm{num ms combs}} \f$, - * size = num_ms_combs * rank, - * effective shape: [num_ms_combs][rank] - */ - MS_TYPE *ms_combs = nullptr; - - /** - * species types of neighbours atoms \f$ \mathbf{\mu} = (\mu_1, \mu_2, \dots, \mu_{rank}) \f$, - * should be lexicographically sorted, - * size = rank, - * effective shape: [rank] - */ - SPECIES_TYPE *mus = nullptr; - - /** - * indices for radial part \f$ \mathbf{n} = (n_1, n_2, \dots, n_{rank}) \f$, - * should be lexicographically sorted, - * size = rank, - * effective shape: [rank] - */ - NS_TYPE *ns = nullptr; - - - /** - * indices for radial part \f$ \mathbf{l} = (l_1, l_2, \dots, l_{rank}) \f$, - * should be lexicographically sorted, - * size = rank, - * effective shape: [rank] - */ - LS_TYPE *ls = nullptr; - - SHORT_INT_TYPE num_ms_combs = 0; ///< number of different ms-combinations - - RANK_TYPE rank = 0; ///< number of atomic base functions "A"s in basis function product B - - DENSITY_TYPE ndensity = 0; ///< number of densities - - SPECIES_TYPE mu0 = 0; ///< species type of central atom - - /** - * whether ms array contains only "non-negative" ms-combinations. - * positive ms-combination is when the first non-zero m is positive (0 1 -1) - * negative ms-combination is when the first non-zero m is negative (0 -1 1) - */ - bool is_half_ms_basis = false; - - /* - * flag, whether object is "owner" (i.e. responsible for memory cleaning) of - * the ms, ns, ls, mus and other dynamically allocated arrases or just a proxy for them - */ - bool is_proxy = false; - - /** - * Copying static and dynamic memory variables from another ACEAbstractBasisFunction. - * Always copy the dynamic memory, even if the source is a proxy object - * @param other - */ - virtual void _copy_from(const ACEAbstractBasisFunction &other) { - rank = other.rank; - ndensity = other.ndensity; - mu0 = other.mu0; - num_ms_combs = other.num_ms_combs; - is_half_ms_basis = other.is_half_ms_basis; - is_proxy = false; - - basis_mem_copy(other, mus, rank, SPECIES_TYPE) - basis_mem_copy(other, ns, rank, NS_TYPE) - basis_mem_copy(other, ls, rank, LS_TYPE) - basis_mem_copy(other, ms_combs, num_ms_combs * rank, MS_TYPE) - } - - /** - * Clean the dynamically allocated memory if object is responsible for it - */ - virtual void _clean() { - //release memory if the structure is not proxy - if (!is_proxy) { - delete[] mus; - delete[] ns; - delete[] ls; - delete[] ms_combs; - } - - mus = nullptr; - ns = nullptr; - ls = nullptr; - ms_combs = nullptr; - } - -}; - -/** - * Representation of C-tilde basis function, i.e. the function that is summed up over a group of B-functions - * that differs only by intermediate coupling orbital moment \f$ L \f$ and coefficients. - */ -struct ACECTildeBasisFunction : public ACEAbstractBasisFunction { - - /** - * c_tilde coefficients for all densities, - * size = num_ms_combs*ndensity, - * effective shape [num_ms_combs][ndensity] - */ - DOUBLE_TYPE *ctildes = nullptr; - - /* - * Default constructor - */ - ACECTildeBasisFunction() = default; - - // Because the ACECTildeBasisFunction contains dynamically allocated arrays, the Rule of Three should be - // fulfilled, i.e. copy constructor (copy the dynamic arrays), operator= (release previous arrays and - // copy the new dynamic arrays) and destructor (release all dynamically allocated memory) - - /** - * Copy constructor, to fulfill the Rule of Three. - * Always copy the dynamic memory, even if the source is a proxy object. - */ - ACECTildeBasisFunction(const ACECTildeBasisFunction &other) { - _copy_from(other); - } - - /* - * operator=, to fulfill the Rule of Three. - * Always copy the dynamic memory, even if the source is a proxy object - */ - ACECTildeBasisFunction &operator=(const ACECTildeBasisFunction &other) { - _clean(); - _copy_from(other); - return *this; - } - - /* - * Destructor - */ - ~ACECTildeBasisFunction() { - _clean(); - } - - /** - * Copy from another object, always copy the memory, even if the source is a proxy object - * @param other - */ - void _copy_from(const ACECTildeBasisFunction &other) { - ACEAbstractBasisFunction::_copy_from(other); - is_proxy = false; - basis_mem_copy(other, ctildes, num_ms_combs * ndensity, DOUBLE_TYPE) - } - - /** - * Clean the dynamically allocated memory if object is responsible for it - */ - void _clean() override { - ACEAbstractBasisFunction::_clean(); - //release memory if the structure is not proxy - if (!is_proxy) { - delete[] ctildes; - } - ctildes = nullptr; - } - - /** - * Print the information about basis function to cout, in order to ease the output redirection. - */ - void print() const { - using namespace std; - cout << "ACECTildeBasisFunction: ndensity= " << (int) this->ndensity << ", mu0 = " << (int) this->mu0 << " "; - cout << " mus=("; - for (RANK_TYPE r = 0; r < this->rank; r++) - cout << (int) this->mus[r] << " "; - cout << "), ns=("; - for (RANK_TYPE r = 0; r < this->rank; r++) - cout << this->ns[r] << " "; - cout << "), ls=("; - for (RANK_TYPE r = 0; r < this->rank; r++) - cout << this->ls[r] << " "; - - cout << "), " << this->num_ms_combs << " m_s combinations: {" << endl; - - for (int i = 0; i < this->num_ms_combs; i++) { - cout << "\t< "; - for (RANK_TYPE r = 0; r < this->rank; r++) - cout << this->ms_combs[i * this->rank + r] << " "; - cout << " >: c_tilde="; - for (DENSITY_TYPE p = 0; p < this->ndensity; ++p) - cout << " " << this->ctildes[i * this->ndensity + p] << " "; - cout << endl; - } - if (this->is_proxy) - cout << "proxy "; - if (this->is_half_ms_basis) - cout << "half_ms_basis"; - cout << "}" << endl; - } -}; - -#endif //ACE_C_BASISFUNCTION_H diff --git a/lib/pace/ace_complex.h b/lib/pace/ace_complex.h deleted file mode 100644 index 5fdb4b5b93..0000000000 --- a/lib/pace/ace_complex.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Yury Lysogorskiy on 26.02.20. - -#ifndef ACE_COMPLEX_H -#define ACE_COMPLEX_H - - -/** -A custom data structure for complex numbers and overloaded operations with them. -*/ -struct ACEComplex { -public: - /** - Double, real part of the complex number - */ - DOUBLE_TYPE real; - /** - Double, imaginary part of the complex number - */ - DOUBLE_TYPE img; - - ACEComplex &operator=(const ACEComplex &rhs) = default; - - ACEComplex &operator=(const DOUBLE_TYPE &rhs) { - this->real = rhs; - this->img = 0.; - return *this; - } - - /** - Overloading of arithmetical operator += ACEComplex - */ - ACEComplex &operator+=(const ACEComplex &rhs) { - this->real += rhs.real; - this->img += rhs.img; - return *this; // return the result by reference - } - - /** - Overloading of arithmetical operator += DOUBLE_TYPE - */ - ACEComplex &operator+=(const DOUBLE_TYPE &rhs) { - this->real += rhs; - return *this; // return the result by reference - } - - /** - Overloading of arithmetical operator *= DOUBLE_TYPE - */ - ACEComplex &operator*=(const DOUBLE_TYPE &rhs) { - this->real *= rhs; - this->img *= rhs; - return *this; // return the result by reference - } - - /** - Overloading of arithmetical operator *= ACEComplex - */ - ACEComplex &operator*=(const ACEComplex &rhs) { - DOUBLE_TYPE old_real = this->real; - this->real = old_real * rhs.real - this->img * rhs.img; - this->img = old_real * rhs.img + this->img * rhs.real; - return *this; // return the result by reference - } - - /** - Overloading of arithmetical operator * ACEComplex - */ - ACEComplex operator*(const ACEComplex &cm2) const { - ACEComplex res{real * cm2.real - img * cm2.img, - real * cm2.img + img * cm2.real}; - return res; - } - - /* - * Return complex conjugated copy of itself - */ - ACEComplex conjugated() const { - ACEComplex res{real, -img}; - return res; - } - - /* - * Complex conjugate itself inplace - */ - void conjugate() { - img = -img; - } - - /* - * Multiplication by ACEComplex and return real-part only - */ - DOUBLE_TYPE real_part_product(const ACEComplex &cm2) const { - return real * cm2.real - img * cm2.img; - } - - /* - * Multiplication by DOUBLE_TYPE and return real-part only - */ - DOUBLE_TYPE real_part_product(const DOUBLE_TYPE &cm2) const { - return real * cm2; - } - - /* - * Overloading of arithmetical operator * by DOUBLE_TYPE - */ - ACEComplex operator*(const DOUBLE_TYPE &cm2) const { - ACEComplex res{real * cm2, - img * cm2}; - return res; - } - - /* - * Overloading of arithmetical operator + ACEComplex - */ - ACEComplex operator+(const ACEComplex &cm2) const { - ACEComplex res{real + cm2.real, - img + cm2.img}; - return res; - } - - /* - * Overloading of arithmetical operator + with DOUBLE_TYPE - */ - ACEComplex operator+(const DOUBLE_TYPE &cm2) const { - ACEComplex res{real + cm2, img}; - return res; - } - - /* - * Overloading of arithmetical operator == ACEComplex - */ - bool operator==(const ACEComplex &c2) const { - return (real == c2.real) && (img == c2.img); - } - - /* - * Overloading of arithmetical operator == DOUBLE_TYPE - */ - bool operator==(const DOUBLE_TYPE &d2) const { - return (real == d2) && (img == 0.); - } - - /* - * Overloading of arithmetical operator != ACEComplex - */ - bool operator!=(const ACEComplex &c2) const { - return (real != c2.real) || (img != c2.img); - } - - /* - * Overloading of arithmetical operator != DOUBLE_TYPE - */ - bool operator!=(const DOUBLE_TYPE &d2) const { - return (real != d2) || (img != 0.); - } - -}; - -/* - * double * complex for commutativity with complex * double - */ -inline ACEComplex operator*(const DOUBLE_TYPE &real, const ACEComplex &cm) { - return cm * real; -} - -/* - * double + complex for commutativity with complex + double - */ -inline ACEComplex operator+(const DOUBLE_TYPE &real, const ACEComplex &cm) { - return cm + real; -} - -/** -A structure to store the derivative of \f$ Y_{lm} \f$ -*/ -struct ACEDYcomponent { -public: - /** - complex, contains the three components of derivative of Ylm, - \f$ \frac{dY_{lm}}{dx}, \frac{dY_{lm}}{dy} and \frac{dY_{lm}}{dz}\f$ - */ - ACEComplex a[3]; - - /* - * Overloading of arithmetical operator*= DOUBLE_TYPE - */ - ACEDYcomponent &operator*=(const DOUBLE_TYPE &rhs) { - this->a[0] *= rhs; - this->a[1] *= rhs; - this->a[2] *= rhs; - return *this; - } - - /* - * Overloading of arithmetical operator * ACEComplex - */ - ACEDYcomponent operator*(const ACEComplex &rhs) const { - ACEDYcomponent res; - res.a[0] = this->a[0] * rhs; - res.a[1] = this->a[1] * rhs; - res.a[2] = this->a[2] * rhs; - return res; - } - - /* - * Overloading of arithmetical operator * DOUBLE_TYPE - */ - ACEDYcomponent operator*(const DOUBLE_TYPE &rhs) const { - ACEDYcomponent res; - res.a[0] = this->a[0] * rhs; - res.a[1] = this->a[1] * rhs; - res.a[2] = this->a[2] * rhs; - return res; - } - - /* - * Return conjugated copy of itself - */ - ACEDYcomponent conjugated() const { - ACEDYcomponent res; - res.a[0] = this->a[0].conjugated(); - res.a[1] = this->a[1].conjugated(); - res.a[2] = this->a[2].conjugated(); - return res; - } - - /* - * Conjugated itself in-place - */ - void conjugate() { - this->a[0].conjugate(); - this->a[1].conjugate(); - this->a[2].conjugate(); - } - -}; - - -#endif //ACE_COMPLEX_H diff --git a/lib/pace/ace_contigous_array.h b/lib/pace/ace_contigous_array.h deleted file mode 100644 index f008fa203f..0000000000 --- a/lib/pace/ace_contigous_array.h +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Yury Lysogorskiy on 11.01.20. -#ifndef ACE_CONTIGUOUSARRAYND_H -#define ACE_CONTIGUOUSARRAYND_H - -#include - -#include "ace_types.h" - -using namespace std; - -/** - * Common predecessor class to represent multidimensional array of type T - * and store it in memory contiguous form - * - * @tparam T data type - */ -template -class ContiguousArrayND { -protected: - T *data = nullptr; ///< pointer to contiguous data - size_t size = 0; ///< total array size - string array_name = "Array"; /// 0) { - data = new T[size]; - for (size_t ind = 0; ind < size; ind++) - data[ind] = other.data[ind]; - } - } else { //is proxy, then copy the pointer - data = other.data; - } - } - - /** - * Overload operator= - * @param other another ContiguousArrayND - * @return itself - */ - - ContiguousArrayND &operator=(const ContiguousArrayND &other) { -#ifdef MULTIARRAY_LIFE_CYCLE - cout< 0) { - - if(data!=nullptr) delete[] data; - data = new T[size]; - - for (size_t ind = 0; ind < size; ind++) - data[ind] = other.data[ind]; - } - } else { //is proxy, then copy the pointer - data = other.data; - } - } - return *this; - } - - - //TODO: make destructor virtual, check the destructors in inherited classes - - /** - * Destructor - */ - ~ContiguousArrayND() { -#ifdef MULTIARRAY_LIFE_CYCLE - cout<array_name = name; - } - - /** - * Get total number of elements in array (its size) - * @return array size - */ - size_t get_size() const { - return size; - } - - /** - * Fill array with value - * @param value value to fill - */ - void fill(T value) { - for (size_t ind = 0; ind < size; ind++) - data[ind] = value; - } - - /** - * Get array data at absolute index ind for reading - * @param ind absolute index - * @return array value - */ - inline const T &get_data(size_t ind) const { -#ifdef MULTIARRAY_INDICES_CHECK - if ((ind < 0) | (ind >= size)) { - printf("%s: get_data ind=%d out of range (0, %d)\n", array_name, ind, size); - exit(EXIT_FAILURE); - } -#endif - return data[ind]; - } - - /** - * Get array data at absolute index ind for writing - * @param ind absolute index - * @return array value - */ - inline T &get_data(size_t ind) { -#ifdef MULTIARRAY_INDICES_CHECK - if ((ind < 0) | (ind >= size)) { - printf("%s: get_data ind=%ld out of range (0, %ld)\n", array_name.c_str(), ind, size); - exit(EXIT_FAILURE); - } -#endif - return data[ind]; - } - - /** - * Get array data pointer - * @return data array pointer - */ - inline T* get_data() const { - return data; - } - - /** - * Overload comparison operator== - * Compare the total size and array values elementwise. - * - * @param other another array - * @return - */ - bool operator==(const ContiguousArrayND &other) const { - if (this->size != other.size) - return false; - - for (size_t i = 0; i < this->size; ++i) - if (this->data[i] != other.data[i]) - return false; - - return true; - } - - - /** - * Convert to flatten vector container - * @return vector container - */ - vector to_flatten_vector() const { - vector res; - - res.resize(size); - size_t vec_ind = 0; - - for (int vec_ind = 0; vec_ind < size; vec_ind++) - res.at(vec_ind) = data[vec_ind]; - - return res; - } // end to_flatten_vector() - - - /** - * Set values from flatten vector container - * @param vec container - */ - void set_flatten_vector(const vector &vec) { - if (vec.size() != size) - throw std::invalid_argument("Flatten vector size is not consistent with expected size"); - for (size_t i = 0; i < size; i++) { - data[i] = vec[i]; - } - } - - bool is_proxy(){ - return is_proxy_; - } - -}; - - -#endif //ACE_CONTIGUOUSARRAYND_H \ No newline at end of file diff --git a/lib/pace/ace_evaluator.cpp b/lib/pace/ace_evaluator.cpp deleted file mode 100644 index 987f4502bf..0000000000 --- a/lib/pace/ace_evaluator.cpp +++ /dev/null @@ -1,660 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Yury Lysogorskiy on 31.01.20. - -#include "ace_evaluator.h" - -#include "ace_abstract_basis.h" -#include "ace_types.h" - -void ACEEvaluator::init(ACEAbstractBasisSet *basis_set) { - A.init(basis_set->nelements, basis_set->nradmax + 1, basis_set->lmax + 1, "A"); - A_rank1.init(basis_set->nelements, basis_set->nradbase, "A_rank1"); - - rhos.init(basis_set->ndensitymax + 1, "rhos"); // +1 density for core repulsion - dF_drho.init(basis_set->ndensitymax + 1, "dF_drho"); // +1 density for core repulsion -} - -void ACEEvaluator::init_timers() { - loop_over_neighbour_timer.init(); - forces_calc_loop_timer.init(); - forces_calc_neighbour_timer.init(); - energy_calc_timer.init(); - per_atom_calc_timer.init(); - total_time_calc_timer.init(); -} - -//================================================================================================================ - -void ACECTildeEvaluator::set_basis(ACECTildeBasisSet &bas) { - basis_set = &bas; - init(basis_set); -} - -void ACECTildeEvaluator::init(ACECTildeBasisSet *basis_set) { - - ACEEvaluator::init(basis_set); - - - weights.init(basis_set->nelements, basis_set->nradmax + 1, basis_set->lmax + 1, - "weights"); - - weights_rank1.init(basis_set->nelements, basis_set->nradbase, "weights_rank1"); - - - DG_cache.init(1, basis_set->nradbase, "DG_cache"); - DG_cache.fill(0); - - R_cache.init(1, basis_set->nradmax, basis_set->lmax + 1, "R_cache"); - R_cache.fill(0); - - DR_cache.init(1, basis_set->nradmax, basis_set->lmax + 1, "DR_cache"); - DR_cache.fill(0); - - Y_cache.init(1, basis_set->lmax + 1, "Y_cache"); - Y_cache.fill({0, 0}); - - DY_cache.init(1, basis_set->lmax + 1, "dY_dense_cache"); - DY_cache.fill({0.}); - - //hard-core repulsion - DCR_cache.init(1, "DCR_cache"); - DCR_cache.fill(0); - dB_flatten.init(basis_set->max_dB_array_size, "dB_flatten"); - - -} - -void ACECTildeEvaluator::resize_neighbours_cache(int max_jnum) { - if(basis_set== nullptr) { - throw std::invalid_argument("ACECTildeEvaluator: basis set is not assigned"); - } - if (R_cache.get_dim(0) < max_jnum) { - - //TODO: implement grow - R_cache.resize(max_jnum, basis_set->nradmax, basis_set->lmax + 1); - R_cache.fill(0); - - DR_cache.resize(max_jnum, basis_set->nradmax, basis_set->lmax + 1); - DR_cache.fill(0); - - DG_cache.resize(max_jnum, basis_set->nradbase); - DG_cache.fill(0); - - Y_cache.resize(max_jnum, basis_set->lmax + 1); - Y_cache.fill({0, 0}); - - DY_cache.resize(max_jnum, basis_set->lmax + 1); - DY_cache.fill({0}); - - //hard-core repulsion - DCR_cache.init(max_jnum, "DCR_cache"); - DCR_cache.fill(0); - } -} - - - -// double** r - atomic coordinates of atom I -// int* types - atomic types if atom I -// int **firstneigh - ptr to 1st J int value of each I atom. Usage: jlist = firstneigh[i]; -// Usage: j = jlist_of_i[jj]; -// jnum - number of J neighbors for each I atom. jnum = numneigh[i]; - -void -ACECTildeEvaluator::compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) { - if(basis_set== nullptr) { - throw std::invalid_argument("ACECTildeEvaluator: basis set is not assigned"); - } - per_atom_calc_timer.start(); -#ifdef PRINT_MAIN_STEPS - printf("\n ATOM: ind = %d r_norm=(%f, %f, %f)\n",i, x[i][0], x[i][1], x[i][2]); -#endif - DOUBLE_TYPE evdwl = 0, evdwl_cut = 0, rho_core = 0; - DOUBLE_TYPE r_norm; - DOUBLE_TYPE xn, yn, zn, r_xyz; - DOUBLE_TYPE R, GR, DGR, R_over_r, DR, DCR; - DOUBLE_TYPE *r_hat; - - SPECIES_TYPE mu_j; - RANK_TYPE r, rank, t; - NS_TYPE n; - LS_TYPE l; - MS_TYPE m, m_t; - - SPECIES_TYPE *mus; - NS_TYPE *ns; - LS_TYPE *ls; - MS_TYPE *ms; - - int j, jj, func_ind, ms_ind; - SHORT_INT_TYPE factor; - - ACEComplex Y{0}, Y_DR{0.}; - ACEComplex B{0.}; - ACEComplex dB{0}; - ACEComplex A_cache[basis_set->rankmax]; - - dB_flatten.fill({0.}); - - ACEDYcomponent grad_phi_nlm{0}, DY{0.}; - - //size is +1 of max to avoid out-of-boundary array access in double-triangular scheme - ACEComplex A_forward_prod[basis_set->rankmax + 1]; - ACEComplex A_backward_prod[basis_set->rankmax + 1]; - - DOUBLE_TYPE inv_r_norm; - DOUBLE_TYPE r_norms[jnum]; - DOUBLE_TYPE inv_r_norms[jnum]; - DOUBLE_TYPE rhats[jnum][3];//normalized vector - SPECIES_TYPE elements[jnum]; - const DOUBLE_TYPE xtmp = x[i][0]; - const DOUBLE_TYPE ytmp = x[i][1]; - const DOUBLE_TYPE ztmp = x[i][2]; - DOUBLE_TYPE f_ji[3]; - - bool is_element_mapping = element_type_mapping.get_size() > 0; - SPECIES_TYPE mu_i; - if (is_element_mapping) - mu_i = element_type_mapping(type[i]); - else - mu_i = type[i]; - - const SHORT_INT_TYPE total_basis_size_rank1 = basis_set->total_basis_size_rank1[mu_i]; - const SHORT_INT_TYPE total_basis_size = basis_set->total_basis_size[mu_i]; - - ACECTildeBasisFunction *basis_rank1 = basis_set->basis_rank1[mu_i]; - ACECTildeBasisFunction *basis = basis_set->basis[mu_i]; - - DOUBLE_TYPE rho_cut, drho_cut, fcut, dfcut; - DOUBLE_TYPE dF_drho_core; - - //TODO: lmax -> lmaxi (get per-species type) - const LS_TYPE lmaxi = basis_set->lmax; - - //TODO: nradmax -> nradiali (get per-species type) - const NS_TYPE nradiali = basis_set->nradmax; - - //TODO: nradbase -> nradbasei (get per-species type) - const NS_TYPE nradbasei = basis_set->nradbase; - - //TODO: get per-species type number of densities - const DENSITY_TYPE ndensity= basis_set->ndensitymax; - - neighbours_forces.resize(jnum, 3); - neighbours_forces.fill(0); - - //TODO: shift nullifications to place where arrays are used - weights.fill({0}); - weights_rank1.fill(0); - A.fill({0}); - A_rank1.fill(0); - rhos.fill(0); - dF_drho.fill(0); - -#ifdef EXTRA_C_PROJECTIONS - basis_projections_rank1.init(total_basis_size_rank1, ndensity, "c_projections_rank1"); - basis_projections.init(total_basis_size, ndensity, "c_projections"); -#endif - - //proxy references to spherical harmonics and radial functions arrays - const Array2DLM &ylm = basis_set->spherical_harmonics.ylm; - const Array2DLM &dylm = basis_set->spherical_harmonics.dylm; - - const Array2D &fr = basis_set->radial_functions->fr; - const Array2D &dfr = basis_set->radial_functions->dfr; - - const Array1D &gr = basis_set->radial_functions->gr; - const Array1D &dgr = basis_set->radial_functions->dgr; - - loop_over_neighbour_timer.start(); - - int jj_actual = 0; - SPECIES_TYPE type_j = 0; - int neighbour_index_mapping[jnum]; // jj_actual -> jj - //loop over neighbours, compute distance, consider only atoms within with rradial_functions->cut(mu_i, mu_j); - r_xyz = sqrt(xn * xn + yn * yn + zn * zn); - - if (r_xyz >= current_cutoff) - continue; - - inv_r_norm = 1 / r_xyz; - - r_norms[jj_actual] = r_xyz; - inv_r_norms[jj_actual] = inv_r_norm; - rhats[jj_actual][0] = xn * inv_r_norm; - rhats[jj_actual][1] = yn * inv_r_norm; - rhats[jj_actual][2] = zn * inv_r_norm; - elements[jj_actual] = mu_j; - neighbour_index_mapping[jj_actual] = jj; - jj_actual++; - } - - int jnum_actual = jj_actual; - - //ALGORITHM 1: Atomic base A - for (jj = 0; jj < jnum_actual; ++jj) { - r_norm = r_norms[jj]; - mu_j = elements[jj]; - r_hat = rhats[jj]; - - //proxies - Array2DLM &Y_jj = Y_cache(jj); - Array2DLM &DY_jj = DY_cache(jj); - - - basis_set->radial_functions->evaluate(r_norm, basis_set->nradbase, nradiali, mu_i, mu_j); - basis_set->spherical_harmonics.compute_ylm(r_hat[0], r_hat[1], r_hat[2], lmaxi); - //loop for computing A's - //rank = 1 - for (n = 0; n < basis_set->nradbase; n++) { - GR = gr(n); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("-neigh atom %d\n", jj); - printf("gr(n=%d)(r=%f) = %f\n", n, r_norm, gr(n)); - printf("dgr(n=%d)(r=%f) = %f\n", n, r_norm, dgr(n)); -#endif - DG_cache(jj, n) = dgr(n); - A_rank1(mu_j, n) += GR * Y00; - } - //loop for computing A's - // for rank > 1 - for (n = 0; n < nradiali; n++) { - auto &A_lm = A(mu_j, n); - for (l = 0; l <= lmaxi; l++) { - R = fr(n, l); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("R(nl=%d,%d)(r=%f)=%f\n", n + 1, l, r_norm, R); -#endif - - DR_cache(jj, n, l) = dfr(n, l); - R_cache(jj, n, l) = R; - - for (m = 0; m <= l; m++) { - Y = ylm(l, m); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("Y(lm=%d,%d)=(%f, %f)\n", l, m, Y.real, Y.img); -#endif - A_lm(l, m) += R * Y; //accumulation sum over neighbours - Y_jj(l, m) = Y; - DY_jj(l, m) = dylm(l, m); - } - } - } - - //hard-core repulsion - rho_core += basis_set->radial_functions->cr; - DCR_cache(jj) = basis_set->radial_functions->dcr; - - } //end loop over neighbours - - //complex conjugate A's (for NEGATIVE (-m) terms) - // for rank > 1 - for (mu_j = 0; mu_j < basis_set->nelements; mu_j++) { - for (n = 0; n < nradiali; n++) { - auto &A_lm = A(mu_j, n); - for (l = 0; l <= lmaxi; l++) { - //fill in -m part in the outer loop using the same m <-> -m symmetry as for Ylm - for (m = 1; m <= l; m++) { - factor = m % 2 == 0 ? 1 : -1; - A_lm(l, -m) = A_lm(l, m).conjugated() * factor; - } - } - } - } //now A's are constructed - loop_over_neighbour_timer.stop(); - - // ==================== ENERGY ==================== - - energy_calc_timer.start(); -#ifdef EXTRA_C_PROJECTIONS - basis_projections_rank1.fill(0); - basis_projections.fill(0); -#endif - - //ALGORITHM 2: Basis functions B with iterative product and density rho(p) calculation - //rank=1 - for (int func_rank1_ind = 0; func_rank1_ind < total_basis_size_rank1; ++func_rank1_ind) { - ACECTildeBasisFunction *func = &basis_rank1[func_rank1_ind]; -// ndensity = func->ndensity; -#ifdef PRINT_LOOPS_INDICES - printf("Num density = %d r = 0\n",(int) ndensity ); - print_C_tilde_B_basis_function(*func); -#endif - double A_cur = A_rank1(func->mus[0], func->ns[0] - 1); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("A_r=1(x=%d, n=%d)=(%f)\n", func->mus[0], func->ns[0], A_cur); - printf(" coeff[0] = %f\n", func->ctildes[0]); -#endif - for (DENSITY_TYPE p = 0; p < ndensity; ++p) { - //for rank=1 (r=0) only 1 ms-combination exists (ms_ind=0), so index of func.ctildes is 0..ndensity-1 - rhos(p) += func->ctildes[p] * A_cur; -#ifdef EXTRA_C_PROJECTIONS - //aggregate C-projections separately - basis_projections_rank1(func_rank1_ind, p)+= func->ctildes[p] * A_cur; -#endif - } - } // end loop for rank=1 - - //rank>1 - int func_ms_ind = 0; - int func_ms_t_ind = 0;// index for dB - - for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { - ACECTildeBasisFunction *func = &basis[func_ind]; - //TODO: check if func->ctildes are zero, then skip -// ndensity = func->ndensity; - rank = func->rank; - r = rank - 1; -#ifdef PRINT_LOOPS_INDICES - printf("Num density = %d r = %d\n",(int) ndensity, (int)r ); - print_C_tilde_B_basis_function(*func); -#endif - mus = func->mus; - ns = func->ns; - ls = func->ls; - - //loop over {ms} combinations in sum - for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { - ms = &func->ms_combs[ms_ind * rank]; // current ms-combination (of length = rank) - - //loop over m, collect B = product of A with given ms - A_forward_prod[0] = 1; - A_backward_prod[r] = 1; - - //fill forward A-product triangle - for (t = 0; t < rank; t++) { - //TODO: optimize ns[t]-1 -> ns[t] during functions construction - A_cache[t] = A(mus[t], ns[t] - 1, ls[t], ms[t]); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("A(x=%d, n=%d, l=%d, m=%d)=(%f,%f)\n", mus[t], ns[t], ls[t], ms[t], A_cache[t].real, - A_cache[t].img); -#endif - A_forward_prod[t + 1] = A_forward_prod[t] * A_cache[t]; - } - - B = A_forward_prod[t]; - -#ifdef DEBUG_FORCES_CALCULATIONS - printf("B = (%f, %f)\n", (B).real, (B).img); -#endif - //fill backward A-product triangle - for (t = r; t >= 1; t--) { - A_backward_prod[t - 1] = - A_backward_prod[t] * A_cache[t]; - } - - for (t = 0; t < rank; ++t, ++func_ms_t_ind) { - dB = A_forward_prod[t] * A_backward_prod[t]; //dB - product of all A's except t-th - dB_flatten(func_ms_t_ind) = dB; -#ifdef DEBUG_FORCES_CALCULATIONS - m_t = ms[t]; - printf("dB(n,l,m)(%d,%d,%d) = (%f, %f)\n", ns[t], ls[t], m_t, (dB).real, (dB).img); -#endif - } - - for (DENSITY_TYPE p = 0; p < ndensity; ++p) { - //real-part only multiplication - rhos(p) += B.real_part_product(func->ctildes[ms_ind * ndensity + p]); - -#ifdef EXTRA_C_PROJECTIONS - //aggregate C-projections separately - basis_projections(func_ind, p)+=B.real_part_product(func->ctildes[ms_ind * ndensity + p]); -#endif - -#ifdef PRINT_INTERMEDIATE_VALUES - printf("rhos(%d) += %f\n", p, B.real_part_product(func->ctildes[ms_ind * ndensity + p])); - printf("Rho[i = %d][p = %d] = %f\n", i , p , rhos(p)); -#endif - } - }//end of loop over {ms} combinations in sum - }// end loop for rank>1 - -#ifdef DEBUG_FORCES_CALCULATIONS - printf("rhos = "); - for(DENSITY_TYPE p =0; prho_core_cutoffs(mu_i); - drho_cut = basis_set->drho_core_cutoffs(mu_i); - - basis_set->inner_cutoff(rho_core, rho_cut, drho_cut, fcut, dfcut); - basis_set->FS_values_and_derivatives(rhos, evdwl, dF_drho, ndensity); - - dF_drho_core = evdwl * dfcut + 1; - for (DENSITY_TYPE p = 0; p < ndensity; ++p) - dF_drho(p) *= fcut; - evdwl_cut = evdwl * fcut + rho_core; - - // E0 shift - evdwl_cut += basis_set->E0vals(mu_i); - -#ifdef DEBUG_FORCES_CALCULATIONS - printf("dFrhos = "); - for(DENSITY_TYPE p =0; pndensity; - for (DENSITY_TYPE p = 0; p < ndensity; ++p) { - //for rank=1 (r=0) only 1 ms-combination exists (ms_ind=0), so index of func.ctildes is 0..ndensity-1 - weights_rank1(func->mus[0], func->ns[0] - 1) += dF_drho(p) * func->ctildes[p]; - } - } - - // rank>1 - func_ms_ind = 0; - func_ms_t_ind = 0;// index for dB - DOUBLE_TYPE theta = 0; - for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { - ACECTildeBasisFunction *func = &basis[func_ind]; -// ndensity = func->ndensity; - rank = func->rank; - mus = func->mus; - ns = func->ns; - ls = func->ls; - for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { - ms = &func->ms_combs[ms_ind * rank]; - theta = 0; - for (DENSITY_TYPE p = 0; p < ndensity; ++p) { - theta += dF_drho(p) * func->ctildes[ms_ind * ndensity + p]; -#ifdef DEBUG_FORCES_CALCULATIONS - printf("(p=%d) theta += dF_drho[p] * func.ctildes[ms_ind * ndensity + p] = %f * %f = %f\n",p, dF_drho(p), func->ctildes[ms_ind * ndensity + p],dF_drho(p)*func->ctildes[ms_ind * ndensity + p]); - printf("theta=%f\n",theta); -#endif - } - - theta *= 0.5; // 0.5 factor due to possible double counting ??? - for (t = 0; t < rank; ++t, ++func_ms_t_ind) { - m_t = ms[t]; - factor = (m_t % 2 == 0 ? 1 : -1); - dB = dB_flatten(func_ms_t_ind); - weights(mus[t], ns[t] - 1, ls[t], m_t) += theta * dB; //Theta_array(func_ms_ind); - // update -m_t (that could also be positive), because the basis is half_basis - weights(mus[t], ns[t] - 1, ls[t], -m_t) += - theta * (dB).conjugated() * factor;// Theta_array(func_ms_ind); -#ifdef DEBUG_FORCES_CALCULATIONS - printf("dB(n,l,m)(%d,%d,%d) = (%f, %f)\n", ns[t], ls[t], m_t, (dB).real, (dB).img); - printf("theta = %f\n",theta); - printf("weights(n,l,m)(%d,%d,%d) += (%f, %f)\n", ns[t], ls[t], m_t, (theta * dB * 0.5).real, - (theta * dB * 0.5).img); - printf("weights(n,l,-m)(%d,%d,%d) += (%f, %f)\n", ns[t], ls[t], -m_t, - ( theta * (dB).conjugated() * factor * 0.5).real, - ( theta * (dB).conjugated() * factor * 0.5).img); -#endif - } - } - } - energy_calc_timer.stop(); - -// ==================== FORCES ==================== -#ifdef PRINT_MAIN_STEPS - printf("\nFORCE CALCULATION\n"); - printf("loop over neighbours\n"); -#endif - - forces_calc_loop_timer.start(); -// loop over neighbour atoms for force calculations - for (jj = 0; jj < jnum_actual; ++jj) { - mu_j = elements[jj]; - r_hat = rhats[jj]; - inv_r_norm = inv_r_norms[jj]; - - Array2DLM &Y_cache_jj = Y_cache(jj); - Array2DLM &DY_cache_jj = DY_cache(jj); - -#ifdef PRINT_LOOPS_INDICES - printf("\nneighbour atom #%d\n", jj); - printf("rhat = (%f, %f, %f)\n", r_hat[0], r_hat[1], r_hat[2]); -#endif - - forces_calc_neighbour_timer.start(); - - f_ji[0] = f_ji[1] = f_ji[2] = 0; - -//for rank = 1 - for (n = 0; n < nradbasei; ++n) { - if (weights_rank1(mu_j, n) == 0) - continue; - auto &DG = DG_cache(jj, n); - DGR = DG * Y00; - DGR *= weights_rank1(mu_j, n); -#ifdef DEBUG_FORCES_CALCULATIONS - printf("r=1: (n,l,m)=(%d, 0, 0)\n",n+1); - printf("\tGR(n=%d, r=%f)=%f\n",n+1,r_norm, gr(n)); - printf("\tDGR(n=%d, r=%f)=%f\n",n+1,r_norm, dgr(n)); - printf("\tdF+=(%f, %f, %f)\n",DGR * r_hat[0], DGR * r_hat[1], DGR * r_hat[2]); -#endif - f_ji[0] += DGR * r_hat[0]; - f_ji[1] += DGR * r_hat[1]; - f_ji[2] += DGR * r_hat[2]; - } - -//for rank > 1 - for (n = 0; n < nradiali; n++) { - for (l = 0; l <= lmaxi; l++) { - R_over_r = R_cache(jj, n, l) * inv_r_norm; - DR = DR_cache(jj, n, l); - - // for m>=0 - for (m = 0; m <= l; m++) { - ACEComplex w = weights(mu_j, n, l, m); - if (w == 0) - continue; - //counting for -m cases if m>0 - if (m > 0) w *= 2; - - DY = DY_cache_jj(l, m); - Y_DR = Y_cache_jj(l, m) * DR; - - grad_phi_nlm.a[0] = Y_DR * r_hat[0] + DY.a[0] * R_over_r; - grad_phi_nlm.a[1] = Y_DR * r_hat[1] + DY.a[1] * R_over_r; - grad_phi_nlm.a[2] = Y_DR * r_hat[2] + DY.a[2] * R_over_r; -#ifdef DEBUG_FORCES_CALCULATIONS - printf("d_phi(n=%d, l=%d, m=%d) = ((%f,%f), (%f,%f), (%f,%f))\n",n+1,l,m, - grad_phi_nlm.a[0].real, grad_phi_nlm.a[0].img, - grad_phi_nlm.a[1].real, grad_phi_nlm.a[1].img, - grad_phi_nlm.a[2].real, grad_phi_nlm.a[2].img); - - printf("weights(n,l,m)(%d,%d,%d) = (%f,%f)\n", n+1, l, m,w.real, w.img); - //if (m>0) w*=2; - printf("dF(n,l,m)(%d, %d, %d) += (%f, %f, %f)\n", n + 1, l, m, - w.real_part_product(grad_phi_nlm.a[0]), - w.real_part_product(grad_phi_nlm.a[1]), - w.real_part_product(grad_phi_nlm.a[2]) - ); -#endif -// real-part multiplication only - f_ji[0] += w.real_part_product(grad_phi_nlm.a[0]); - f_ji[1] += w.real_part_product(grad_phi_nlm.a[1]); - f_ji[2] += w.real_part_product(grad_phi_nlm.a[2]); - } - } - } - - -#ifdef PRINT_INTERMEDIATE_VALUES - printf("f_ji(jj=%d, i=%d)=(%f, %f, %f)\n", jj, i, - f_ji[0], f_ji[1], f_ji[2] - ); -#endif - - //hard-core repulsion - DCR = DCR_cache(jj); -#ifdef DEBUG_FORCES_CALCULATIONS - printf("DCR = %f\n",DCR); -#endif - f_ji[0] += dF_drho_core * DCR * r_hat[0]; - f_ji[1] += dF_drho_core * DCR * r_hat[1]; - f_ji[2] += dF_drho_core * DCR * r_hat[2]; -#ifdef PRINT_INTERMEDIATE_VALUES - printf("with core-repulsion\n"); - printf("f_ji(jj=%d, i=%d)=(%f, %f, %f)\n", jj, i, - f_ji[0], f_ji[1], f_ji[2] - ); - printf("neighbour_index_mapping[jj=%d]=%d\n",jj,neighbour_index_mapping[jj]); -#endif - - neighbours_forces(neighbour_index_mapping[jj], 0) = f_ji[0]; - neighbours_forces(neighbour_index_mapping[jj], 1) = f_ji[1]; - neighbours_forces(neighbour_index_mapping[jj], 2) = f_ji[2]; - - forces_calc_neighbour_timer.stop(); - }// end loop over neighbour atoms for forces - - forces_calc_loop_timer.stop(); - - //now, energies and forces are ready - //energies(i) = evdwl + rho_core; - e_atom = evdwl_cut; - -#ifdef PRINT_INTERMEDIATE_VALUES - printf("energies(i) = FS(...rho_p_accum...) = %f\n", evdwl); -#endif - per_atom_calc_timer.stop(); -} \ No newline at end of file diff --git a/lib/pace/ace_evaluator.h b/lib/pace/ace_evaluator.h deleted file mode 100644 index 356ea52563..0000000000 --- a/lib/pace/ace_evaluator.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Yury Lysogorskiy on 31.01.20. - -#ifndef ACE_EVALUATOR_H -#define ACE_EVALUATOR_H - -#include "ace_abstract_basis.h" -#include "ace_arraynd.h" -#include "ace_array2dlm.h" -#include "ace_c_basis.h" -#include "ace_complex.h" -#include "ace_timing.h" -#include "ace_types.h" - -/** - * Basic evaluator class, that should accept the basis set and implement the "compute_atom" method using given basis set. - */ -class ACEEvaluator { -protected: - - Array2D A_rank1 = Array2D("A_rank1"); ///< 2D-array for storing A's for rank=1, shape: A(mu_j,n) - Array4DLM A = Array4DLM("A"); ///< 4D array with (l,m) last indices for storing A's for rank>1: A(mu_j, n, l, m) - - Array1D rhos = Array1D("rhos"); ///< densities \f$ \rho^{(p)} \f$(ndensity), p = 0 .. ndensity-1 - Array1D dF_drho = Array1D("dF_drho"); ///< derivatives of cluster functional wrt. densities, index = 0 .. ndensity-1 - - /** - * Initialize internal arrays according to basis set sizes - * @param basis_set - */ - void init(ACEAbstractBasisSet *basis_set); - -public: - // set of timers for code profiling - - ACETimer loop_over_neighbour_timer; ///< timer for loop over neighbours when constructing A's for single central atom - ACETimer per_atom_calc_timer; ///< timer for single compute_atom call - - - ACETimer forces_calc_loop_timer; ///< timer for forces calculations for single central atom - ACETimer forces_calc_neighbour_timer; ///< timer for loop over neighbour atoms for force calculations - - ACETimer energy_calc_timer; ///< timer for energy calculation - ACETimer total_time_calc_timer; ///< timer for total calculations of all atoms within given atomic environment system - - /** - * Initialize all timers - */ - void init_timers(); - - /** - * Mapping from external atoms types, i.e. LAMMPS, to internal SPECIES_TYPE, used in basis functions - */ - Array1D element_type_mapping = Array1D("element_type_mapping"); - - - DOUBLE_TYPE e_atom = 0; ///< energy of current atom, including core-repulsion - - /** - * temporary array for the pair forces between current atom_i and its neighbours atom_k - * neighbours_forces(k,3), k = 0..num_of_neighbours(atom_i)-1 - */ - Array2D neighbours_forces = Array2D("neighbours_forces"); - - ACEEvaluator() = default; - - virtual ~ACEEvaluator() = default; - - /** - * The key method to compute energy and forces for atom 'i'. - * Method will update the "e_atom" variable and "neighbours_forces(jj, alpha)" array - * - * @param i atom index - * @param x atomic positions array of the real and ghost atoms, shape: [atom_ind][3] - * @param type atomic types array of the real and ghost atoms, shape: [atom_ind] - * @param jnum number of neighbours of atom_i - * @param jlist array of neighbour indices, shape: [jnum] - */ - virtual void compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) = 0; - - /** - * Resize all caches over neighbours atoms - * @param max_jnum maximum number of neighbours - */ - virtual void resize_neighbours_cache(int max_jnum) = 0; - -#ifdef EXTRA_C_PROJECTIONS - /** - * 2D array to store projections of basis function for rank = 1, shape: [func_ind][ndensity] - */ - Array2D basis_projections_rank1 = Array2D("basis_projections_rank1"); - - /** - * 2D array to store projections of basis function for rank > 1, shape: [func_ind][ndensity] - */ - Array2D basis_projections = Array2D("basis_projections"); -#endif -}; - -//TODO: split into separate file -/** - * Evaluator for C-tilde basis set, that should accept the basis set and implement the "compute_atom" method using given basis set. - */ -class ACECTildeEvaluator : public ACEEvaluator { - - /** - * Weights \f$ \omega_{i \mu n 0 0} \f$ for rank = 1, see Eq.(10) from implementation notes, - * 'i' is fixed for the current atom, shape: [nelements][nradbase] - */ - Array2D weights_rank1 = Array2D("weights_rank1"); - - /** - * Weights \f$ \omega_{i \mu n l m} \f$ for rank > 1, see Eq.(10) from implementation notes, - * 'i' is fixed for the current atom, shape: [nelements][nradbase][l=0..lmax, m] - */ - Array4DLM weights = Array4DLM("weights"); - - /** - * cache for gradients of \f$ g(r)\f$: grad_phi(jj,n)=A2DLM(l,m) - * shape:[max_jnum][nradbase] - */ - Array2D DG_cache = Array2D("DG_cache"); - - - /** - * cache for \f$ R_{nl}(r)\f$ - * shape:[max_jnum][nradbase][0..lmax] - */ - Array3D R_cache = Array3D("R_cache"); - /** - * cache for derivatives of \f$ R_{nl}(r)\f$ - * shape:[max_jnum][nradbase][0..lmax] - */ - Array3D DR_cache = Array3D("DR_cache"); - /** - * cache for \f$ Y_{lm}(\hat{r})\f$ - * shape:[max_jnum][0..lmax][m] - */ - Array3DLM Y_cache = Array3DLM("Y_cache"); - /** - * cache for \f$ \nabla Y_{lm}(\hat{r})\f$ - * shape:[max_jnum][0..lmax][m] - */ - Array3DLM DY_cache = Array3DLM("dY_dense_cache"); - - /** - * cache for derivatives of hard-core repulsion - * shape:[max_jnum] - */ - Array1D DCR_cache = Array1D("DCR_cache"); - - /** - * Partial derivatives \f$ dB_{i \mu n l m t}^{(r)} \f$ with sequential numbering over [func_ind][ms_ind][r], - * shape:[func_ms_r_ind] - */ - Array1D dB_flatten = Array1D("dB_flatten"); - - /** - * pointer to the ACEBasisSet object - */ - ACECTildeBasisSet *basis_set = nullptr; - - /** - * Initialize internal arrays according to basis set sizes - * @param basis_set - */ - void init(ACECTildeBasisSet *basis_set); - -public: - - ACECTildeEvaluator() = default; - - explicit ACECTildeEvaluator(ACECTildeBasisSet &bas) { - set_basis(bas); - } - - /** - * set the basis function to the ACE evaluator - * @param bas - */ - void set_basis(ACECTildeBasisSet &bas); - - /** - * The key method to compute energy and forces for atom 'i'. - * Method will update the "e_atom" variable and "neighbours_forces(jj, alpha)" array - * - * @param i atom index - * @param x atomic positions array of the real and ghost atoms, shape: [atom_ind][3] - * @param type atomic types array of the real and ghost atoms, shape: [atom_ind] - * @param jnum number of neighbours of atom_i - * @param jlist array of neighbour indices, shape: [jnum] - */ - void compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) override; - - /** - * Resize all caches over neighbours atoms - * @param max_jnum maximum number of neighbours - */ - void resize_neighbours_cache(int max_jnum) override; -}; - - -#endif //ACE_EVALUATOR_H \ No newline at end of file diff --git a/lib/pace/ace_flatten_basis.cpp b/lib/pace/ace_flatten_basis.cpp deleted file mode 100644 index 541785a202..0000000000 --- a/lib/pace/ace_flatten_basis.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by yury on 28.04.2020. - -#include "ace_flatten_basis.h" - -ACEFlattenBasisSet::ACEFlattenBasisSet(const ACEFlattenBasisSet &other) { - _copy_scalar_memory(other); - _copy_dynamic_memory(other); -} - -ACEFlattenBasisSet &ACEFlattenBasisSet::operator=(const ACEFlattenBasisSet &other) { - if (this != &other) { - _clean(); - _copy_scalar_memory(other); - _copy_dynamic_memory(other); - } - return *this; -} - - -ACEFlattenBasisSet::~ACEFlattenBasisSet() { - ACEFlattenBasisSet::_clean(); -} - -void ACEFlattenBasisSet::_clean() { - //chained call of base class method - ACEAbstractBasisSet::_clean(); - _clean_contiguous_arrays(); - _clean_basissize_arrays(); - -} - -void ACEFlattenBasisSet::_clean_basissize_arrays() { - delete[] total_basis_size; - total_basis_size = nullptr; - - delete[] total_basis_size_rank1; - total_basis_size_rank1 = nullptr; -} - -void ACEFlattenBasisSet::_clean_contiguous_arrays() { - delete[] full_ns_rank1; - full_ns_rank1 = nullptr; - - delete[] full_ls_rank1; - full_ls_rank1 = nullptr; - - delete[] full_mus_rank1; - full_mus_rank1 = nullptr; - - delete[] full_ms_rank1; - full_ms_rank1 = nullptr; - - ////// - - delete[] full_ns; - full_ns = nullptr; - - delete[] full_ls; - full_ls = nullptr; - - delete[] full_mus; - full_mus = nullptr; - - delete[] full_ms; - full_ms = nullptr; -} - -void ACEFlattenBasisSet::_copy_scalar_memory(const ACEFlattenBasisSet &src) { - ACEAbstractBasisSet::_copy_scalar_memory(src); - - rank_array_total_size_rank1 = src.rank_array_total_size_rank1; - coeff_array_total_size_rank1 = src.coeff_array_total_size_rank1; - rank_array_total_size = src.rank_array_total_size; - ms_array_total_size = src.ms_array_total_size; - coeff_array_total_size = src.coeff_array_total_size; - - max_B_array_size = src.max_B_array_size; - max_dB_array_size = src.max_dB_array_size; - num_ms_combinations_max = src.num_ms_combinations_max; -} - -void ACEFlattenBasisSet::_copy_dynamic_memory(const ACEFlattenBasisSet &src) { //allocate new memory - - ACEAbstractBasisSet::_copy_dynamic_memory(src); - - if (src.total_basis_size_rank1 == nullptr) - throw runtime_error("Could not copy ACEFlattenBasisSet::total_basis_size_rank1 - array not initialized"); - if (src.total_basis_size == nullptr) - throw runtime_error("Could not copy ACEFlattenBasisSet::total_basis_size - array not initialized"); - - delete[] total_basis_size_rank1; - total_basis_size_rank1 = new SHORT_INT_TYPE[nelements]; - delete[] total_basis_size; - total_basis_size = new SHORT_INT_TYPE[nelements]; - - //copy - for (SPECIES_TYPE mu = 0; mu < nelements; ++mu) { - total_basis_size_rank1[mu] = src.total_basis_size_rank1[mu]; - total_basis_size[mu] = src.total_basis_size[mu]; - } -} - diff --git a/lib/pace/ace_flatten_basis.h b/lib/pace/ace_flatten_basis.h deleted file mode 100644 index e21cbb749a..0000000000 --- a/lib/pace/ace_flatten_basis.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Lysogroskiy Yury on 28.04.2020. - -#ifndef ACE_EVALUATOR_ACE_FLATTEN_BASIS_H -#define ACE_EVALUATOR_ACE_FLATTEN_BASIS_H - - -#include "ace_abstract_basis.h" -#include "ace_c_basisfunction.h" -#include "ace_radial.h" -#include "ace_spherical_cart.h" -#include "ace_types.h" - -/** - * Basis set with basis function attributes, i.e. \f$ \mathbf{n}, \mathbf{l}, \mathbf{m}\f$, etc. - * packed into contiguous arrays for the cache-friendly memory layout. - */ -class ACEFlattenBasisSet : public ACEAbstractBasisSet { -public: - //arrays and its sizes for rank = 1 basis functions for packed basis - - size_t rank_array_total_size_rank1 = 0; ///< size for full_ns_rank1, full_ls_rank1, full_Xs_rank1 - size_t coeff_array_total_size_rank1 = 0; ///< size for full coefficients array (depends on B or C-Tilde basis) - - NS_TYPE *full_ns_rank1 = nullptr; ///< ns contiguous package [rank_array_total_size_rank1] - LS_TYPE *full_ls_rank1 = nullptr; ///< ls contiguous package [rank_array_total_size_rank1] - SPECIES_TYPE *full_mus_rank1 = nullptr; ///< mus contiguous package [rank_array_total_size_rank1] - MS_TYPE *full_ms_rank1 = nullptr; ///< m_s contiguous package[rank_array_total_size_rank1] - - //arrays and its sizes for rank > 1 basis functions for packed basis - size_t rank_array_total_size = 0; ///< size for full_ns, full_ls, full_Xs - size_t ms_array_total_size = 0; ///< size for full_ms array - size_t coeff_array_total_size = 0;///< size for full coefficients arrays (depends on B- or C- basis) - - NS_TYPE *full_ns = nullptr; ///< ns contiguous package [rank_array_total_size] - LS_TYPE *full_ls = nullptr; ///< ls contiguous package [rank_array_total_size] - SPECIES_TYPE *full_mus = nullptr; ///< mus contiguous package [rank_array_total_size] - MS_TYPE *full_ms = nullptr; ///< //m_s contiguous package [ms_array_total_size] - - /** - * Rearrange basis functions in contiguous memory to optimize cache access - */ - virtual void pack_flatten_basis() = 0; - - virtual void flatten_basis() = 0; - - //1D flat array basis representation: [mu] - SHORT_INT_TYPE *total_basis_size_rank1 = nullptr; ///< per-species type array of total_basis_rank1[mu] sizes - SHORT_INT_TYPE *total_basis_size = nullptr; ///< per-species type array of total_basis[mu] sizes - - size_t max_B_array_size = 0; ///< maximum over elements array size for B[func_ind][ms_ind] - size_t max_dB_array_size = 0; ///< maximum over elements array size for dB[func_ind][ms_ind][r] - - SHORT_INT_TYPE num_ms_combinations_max = 0; ///< maximum number of ms combinations among all basis functions - - /** - * Default constructor - */ - ACEFlattenBasisSet() = default; - - /** - * Copy constructor (see Rule of Three) - * @param other - */ - ACEFlattenBasisSet(const ACEFlattenBasisSet &other); - - /** - * operator= (see Rule of Three) - * @param other - * @return - */ - ACEFlattenBasisSet &operator=(const ACEFlattenBasisSet &other); - - /** - * Destructor (see Rule of Three) - */ - ~ACEFlattenBasisSet() override; - - // routines for copying and cleaning dynamic memory of the class (see Rule of Three) - /** - * Cleaning dynamic memory of the class (see. Rule of Three), - * must be idempotent for safety - */ - void _clean() override; - - /** - * Copying scalar variables - * @param src - */ - void _copy_scalar_memory(const ACEFlattenBasisSet &src); - - /** - * Copying and cleaning dynamic memory of the class (see. Rule of Three) - * @param src - */ - void _copy_dynamic_memory(const ACEFlattenBasisSet &src); - - /** - * Clean contiguous arrays - */ - virtual void _clean_contiguous_arrays(); - - /** - * Release dynamic arrays with basis set sizes - */ - void _clean_basissize_arrays(); -}; - -#endif //ACE_EVALUATOR_ACE_FLATTEN_BASIS_H diff --git a/lib/pace/ace_radial.cpp b/lib/pace/ace_radial.cpp deleted file mode 100644 index 01348a719c..0000000000 --- a/lib/pace/ace_radial.cpp +++ /dev/null @@ -1,566 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#include -#include -#include - -#include "ace_radial.h" - -const DOUBLE_TYPE pi = 3.14159265358979323846264338327950288419; // pi - -ACERadialFunctions::ACERadialFunctions(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, - SPECIES_TYPE nelements, - DOUBLE_TYPE cutoff, string radbasename) { - init(nradb, lmax, nradial, deltaSplineBins, nelements, cutoff, radbasename); -} - -void ACERadialFunctions::init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, - SPECIES_TYPE nelements, - DOUBLE_TYPE cutoff, string radbasename) { - this->nradbase = nradb; - this->lmax = lmax; - this->nradial = nradial; - this->deltaSplineBins = deltaSplineBins; - this->nelements = nelements; - this->cutoff = cutoff; - this->radbasename = radbasename; - - gr.init(nradbase, "gr"); - dgr.init(nradbase, "dgr"); - d2gr.init(nradbase, "d2gr"); - - - fr.init(nradial, lmax + 1, "fr"); - dfr.init(nradial, lmax + 1, "dfr"); - d2fr.init(nradial, lmax + 1, "d2fr"); - - - cheb.init(nradbase + 1, "cheb"); - dcheb.init(nradbase + 1, "dcheb"); - cheb2.init(nradbase + 1, "cheb2"); - - - splines_gk.init(nelements, nelements, "splines_gk"); - splines_rnl.init(nelements, nelements, "splines_rnl"); - splines_hc.init(nelements, nelements, "splines_hc"); - - lambda.init(nelements, nelements, "lambda"); - lambda.fill(1.); - - cut.init(nelements, nelements, "cut"); - cut.fill(1.); - - dcut.init(nelements, nelements, "dcut"); - dcut.fill(1.); - - crad.init(nelements, nelements, nradial, (lmax + 1), nradbase, "crad"); - crad.fill(0.); - - //hard-core repulsion - prehc.init(nelements, nelements, "prehc"); - prehc.fill(0.); - - lambdahc.init(nelements, nelements, "lambdahc"); - lambdahc.fill(1.); - -} - - -/** -Function that computes Chebyshev polynomials of first and second kind - to setup the radial functions and the derivatives - -@param n, x - -@returns cheb1, dcheb1 -*/ -void ACERadialFunctions::calcCheb(NS_TYPE n, DOUBLE_TYPE x) { - if (n < 0) { - char s[1024]; - sprintf(s, "The order n of the polynomials should be positive %d\n", n); - throw std::invalid_argument(s); - } - DOUBLE_TYPE twox = 2.0 * x; - cheb(0) = 1.; - dcheb(0) = 0.; - cheb2(0) = 1.; - - if (nradbase > 1) { - cheb(1) = x; - cheb2(1) = twox; - } - for (NS_TYPE m = 1; m <= n - 1; m++) { - cheb(m + 1) = twox * cheb(m) - cheb(m - 1); - cheb2(m + 1) = twox * cheb2(m) - cheb2(m - 1); - } - for (NS_TYPE m = 1; m <= n; m++) { - dcheb(m) = m * cheb2(m - 1); - } -#ifdef DEBUG_RADIAL - for ( NS_TYPE m=0; m<=n; m++ ) { - printf(" m %d cheb %f dcheb %f \n", m, cheb(m), dcheb(m)); - } -#endif -} - -/** -Function that computes radial basis. - -@param lam, nradbase, cut, dcut, r - -@returns gr, dgr -*/ -void ACERadialFunctions::radbase(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r) { - /*lam is given by the formula (24), that contains cut */ - - if (r < cut) { - if (radbasename == "ChebExpCos") { - chebExpCos(lam, cut, dcut, r); - } else if (radbasename == "ChebPow") { - chebPow(lam, cut, dcut, r); - } else if (radbasename == "ChebLinear") { - chebLinear(lam, cut, dcut, r); - } else { - throw invalid_argument("Unknown radial basis function name: " + radbasename); - } - } else { - gr.fill(0); - dgr.fill(0); - } -} - -/*** - * Radial function: ChebExpCos, cheb exp scaling including cos envelope - * @param lam function parameter - * @param cut cutoff distance - * @param r function input argument - * @return fills in gr and dgr arrays - */ -void -ACERadialFunctions::chebExpCos(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r) { - DOUBLE_TYPE y2, y1, x, dx; - DOUBLE_TYPE env, denv, fcut, dfcut; - /* scaled distance x and derivative*/ - y1 = exp(-lam * r / cut); - y2 = exp(-lam); - x = 1.0 - 2.0 * ((y1 - y2) / (1 - y2)); - dx = 2 * (lam / cut) * (y1 / (1 - y2)); - /* calculation of Chebyshev polynomials from the recursion */ - calcCheb(nradbase - 1, x); - gr(0) = cheb(0); - dgr(0) = dcheb(0) * dx; - for (NS_TYPE n = 2; n <= nradbase; n++) { - gr(n - 1) = 0.5 - 0.5 * cheb(n - 1); - dgr(n - 1) = -0.5 * dcheb(n - 1) * dx; - } - env = 0.5 * (1.0 + cos(M_PI * r / cut)); - denv = -0.5 * sin(M_PI * r / cut) * M_PI / cut; - for (NS_TYPE n = 0; n < nradbase; n++) { - dgr(n) = gr(n) * denv + dgr(n) * env; - gr(n) = gr(n) * env; - } - // for radtype = 3 a smooth cut is already included in the basis function - dx = cut - dcut; - if (r > dx) { - fcut = 0.5 * (1.0 + cos(M_PI * (r - dx) / dcut)); - dfcut = -0.5 * sin(M_PI * (r - dx) / dcut) * M_PI / dcut; - for (NS_TYPE n = 0; n < nradbase; n++) { - dgr(n) = gr(n) * dfcut + dgr(n) * fcut; - gr(n) = gr(n) * fcut; - } - } -} - -/*** -* Radial function: ChebPow, Radial function: ChebPow -* - argument of Chebyshev polynomials -* x = 2.0*( 1.0 - (1.0 - r/rcut)^lam ) - 1.0 -* - radial function -* gr(n) = ( 1.0 - Cheb(n) )/2.0, n = 1,...,nradbase -* - the function fulfills: -* gr(n) = 0 at rcut -* dgr(n) = 0 at rcut for lam >= 1 -* second derivative zero at rcut for lam >= 2 -* -> the radial function does not require a separate cutoff function -* - corresponds to radial basis radtype=5 in Fortran code -* -* @param lam function parameter -* @param cut cutoff distance -* @param r function input argument -* @return fills in gr and dgr arrays -*/ -void -ACERadialFunctions::chebPow(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r) { - DOUBLE_TYPE y, dy, x, dx; - /* scaled distance x and derivative*/ - y = (1.0 - r / cut); - dy = pow(y, (lam - 1.0)); - y = dy * y; - dy = -lam / cut * dy; - - x = 2.0 * (1.0 - y) - 1.0; - dx = -2.0 * dy; - calcCheb(nradbase, x); - for (NS_TYPE n = 1; n <= nradbase; n++) { - gr(n - 1) = 0.5 - 0.5 * cheb(n); - dgr(n - 1) = -0.5 * dcheb(n) * dx; - } -} - - -void -ACERadialFunctions::chebLinear(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r) { - DOUBLE_TYPE x, dx; - /* scaled distance x and derivative*/ - x = (1.0 - r / cut); - dx = -1 / cut; - calcCheb(nradbase, x); - for (NS_TYPE n = 1; n <= nradbase; n++) { - gr(n - 1) = 0.5 - 0.5 * cheb(n); - dgr(n - 1) = -0.5 * dcheb(n) * dx; - } -} - -/** -Function that computes radial functions. - -@param nradbase, nelements, elei, elej - -@returns fr, dfr -*/ -void ACERadialFunctions::radfunc(SPECIES_TYPE elei, SPECIES_TYPE elej) { - DOUBLE_TYPE frval, dfrval; - for (NS_TYPE n = 0; n < nradial; n++) { - for (LS_TYPE l = 0; l <= lmax; l++) { - frval = 0.0; - dfrval = 0.0; - for (NS_TYPE k = 0; k < nradbase; k++) { - frval += crad(elei, elej, n, l, k) * gr(k); - dfrval += crad(elei, elej, n, l, k) * dgr(k); - } - fr(n, l) = frval; - dfr(n, l) = dfrval; - } - } -} - - -void ACERadialFunctions::all_radfunc(SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, DOUBLE_TYPE r) { - DOUBLE_TYPE lam = lambda(mu_i, mu_j); - DOUBLE_TYPE r_cut = cut(mu_i, mu_j); - DOUBLE_TYPE dr_cut = dcut(mu_i, mu_j); - // set up radial functions - radbase(lam, r_cut, dr_cut, r); //update gr, dgr - radfunc(mu_i, mu_j); // update fr(nr, l), dfr(nr, l) -} - - -void ACERadialFunctions::setuplookupRadspline() { - using namespace std::placeholders; - DOUBLE_TYPE lam, r_cut, dr_cut; - DOUBLE_TYPE cr_c, dcr_c, pre, lamhc; - - // at r = rcut + eps the function and its derivatives is zero - for (SPECIES_TYPE elei = 0; elei < nelements; elei++) { - for (SPECIES_TYPE elej = 0; elej < nelements; elej++) { - - lam = lambda(elei, elej); - r_cut = cut(elei, elej); - dr_cut = dcut(elei, elej); - - splines_gk(elei, elej).setupSplines(gr.get_size(), - std::bind(&ACERadialFunctions::radbase, this, lam, r_cut, dr_cut, - _1),//update gr, dgr - gr.get_data(), - dgr.get_data(), deltaSplineBins, cutoff); - - splines_rnl(elei, elej).setupSplines(fr.get_size(), - std::bind(&ACERadialFunctions::all_radfunc, this, elei, elej, - _1), // update fr(nr, l), dfr(nr, l) - fr.get_data(), - dfr.get_data(), deltaSplineBins, cutoff); - - - pre = prehc(elei, elej); - lamhc = lambdahc(elei, elej); -// radcore(r, pre, lamhc, cutoff, cr_c, dcr_c); - splines_hc(elei, elej).setupSplines(1, - std::bind(&ACERadialFunctions::radcore, _1, pre, lamhc, cutoff, - std::ref(cr_c), std::ref(dcr_c)), - &cr_c, - &dcr_c, deltaSplineBins, cutoff); - } - } - -} - -/** -Function that gets radial function from look-up table using splines. - -@param r, nradbase_c, nradial_c, lmax, mu_i, mu_j - -@returns fr, dfr, gr, dgr, cr, dcr -*/ -void -ACERadialFunctions::evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, - SPECIES_TYPE mu_j, bool calc_second_derivatives) { - auto &spline_gk = splines_gk(mu_i, mu_j); - auto &spline_rnl = splines_rnl(mu_i, mu_j); - auto &spline_hc = splines_hc(mu_i, mu_j); - - spline_gk.calcSplines(r, calc_second_derivatives); // populate splines_gk.values, splines_gk.derivatives; - for (NS_TYPE nr = 0; nr < nradbase_c; nr++) { - gr(nr) = spline_gk.values(nr); - dgr(nr) = spline_gk.derivatives(nr); - if (calc_second_derivatives) - d2gr(nr) = spline_gk.second_derivatives(nr); - } - - spline_rnl.calcSplines(r, calc_second_derivatives); - for (size_t ind = 0; ind < fr.get_size(); ind++) { - fr.get_data(ind) = spline_rnl.values.get_data(ind); - dfr.get_data(ind) = spline_rnl.derivatives.get_data(ind); - if (calc_second_derivatives) - d2fr.get_data(ind) = spline_rnl.second_derivatives.get_data(ind); - } - - spline_hc.calcSplines(r, calc_second_derivatives); - cr = spline_hc.values(0); - dcr = spline_hc.derivatives(0); - if (calc_second_derivatives) - d2cr = spline_hc.second_derivatives(0); -} - - -void -ACERadialFunctions::radcore(DOUBLE_TYPE r, DOUBLE_TYPE pre, DOUBLE_TYPE lambda, DOUBLE_TYPE cutoff, DOUBLE_TYPE &cr, - DOUBLE_TYPE &dcr) { -/* pseudocode for hard core repulsion -in: - r: distance - pre: prefactor: read from input, depends on pair of atoms mu_i mu_j - lambda: exponent: read from input, depends on pair of atoms mu_i mu_j - cutoff: cutoff distance: read from input, depends on pair of atoms mu_i mu_j -out: -cr: hard core repulsion -dcr: derivative of hard core repulsion - - function - \$f f_{core} = pre \exp( - \lambda r^2 ) / r \$f - -*/ - - DOUBLE_TYPE r2, lr2, y, x0, env, denv; - -// repulsion strictly positive and decaying - pre = abs(pre); - lambda = abs(lambda); - - r2 = r * r; - lr2 = lambda * r2; - if (lr2 < 50.0) { - y = exp(-lr2); - cr = pre * y / r; - dcr = -pre * y * (2.0 * lr2 + 1.0) / r2; - - x0 = r / cutoff; - env = 0.5 * (1.0 + cos(pi * x0)); - denv = -0.5 * sin(pi * x0) * pi / cutoff; - dcr = cr * denv + dcr * env; - cr = cr * env; - } else { - cr = 0.0; - dcr = 0.0; - } - -} - -void -ACERadialFunctions::evaluate_range(vector r_vec, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, - SPECIES_TYPE mu_j) { - if (nradbase_c > nradbase) - throw invalid_argument("nradbase_c couldn't be larger than nradbase"); - if (nradial_c > nradial) - throw invalid_argument("nradial_c couldn't be larger than nradial"); - if (mu_i > nelements) - throw invalid_argument("mu_i couldn't be larger than nelements"); - if (mu_j > nelements) - throw invalid_argument("mu_j couldn't be larger than nelements"); - - gr_vec.resize(r_vec.size(), nradbase_c); - dgr_vec.resize(r_vec.size(), nradbase_c); - d2gr_vec.resize(r_vec.size(), nradbase_c); - - fr_vec.resize(r_vec.size(), fr.get_dim(0), fr.get_dim(1)); - dfr_vec.resize(r_vec.size(), fr.get_dim(0), fr.get_dim(1)); - d2fr_vec.resize(r_vec.size(), fr.get_dim(0), fr.get_dim(1)); - - for (size_t i = 0; i < r_vec.size(); i++) { - DOUBLE_TYPE r = r_vec[i]; - this->evaluate(r, nradbase_c, nradial_c, mu_i, mu_j, true); - for (NS_TYPE nr = 0; nr < nradbase_c; nr++) { - gr_vec(i, nr) = gr(nr); - dgr_vec(i, nr) = dgr(nr); - d2gr_vec(i, nr) = d2gr(nr); - } - - for (NS_TYPE nr = 0; nr < nradial_c; nr++) { - for (LS_TYPE l = 0; l <= lmax; l++) { - fr_vec(i, nr, l) = fr(nr, l); - dfr_vec(i, nr, l) = dfr(nr, l); - d2fr_vec(i, nr, l) = d2fr(nr, l); - - } - } - } - -} - -void SplineInterpolator::setupSplines(int num_of_functions, RadialFunctions func, - DOUBLE_TYPE *values, - DOUBLE_TYPE *dvalues, DOUBLE_TYPE deltaSplineBins, DOUBLE_TYPE cutoff) { - - this->deltaSplineBins = deltaSplineBins; - this->cutoff = cutoff; - this->ntot = static_cast(cutoff / deltaSplineBins); - - DOUBLE_TYPE r, c[4]; - this->num_of_functions = num_of_functions; - this->values.resize(num_of_functions); - this->derivatives.resize(num_of_functions); - this->second_derivatives.resize(num_of_functions); - - Array1D f1g(num_of_functions); - Array1D f1gd1(num_of_functions); - f1g.fill(0); - f1gd1.fill(0); - - nlut = ntot; - DOUBLE_TYPE f0, f1, f0d1, f1d1; - int idx; - - // cutoff is global cutoff - rscalelookup = (DOUBLE_TYPE) nlut / cutoff; - invrscalelookup = 1.0 / rscalelookup; - - lookupTable.init(ntot + 1, num_of_functions, 4); - if (values == nullptr & num_of_functions > 0) - throw invalid_argument("SplineInterpolator::setupSplines: values could not be null"); - if (dvalues == nullptr & num_of_functions > 0) - throw invalid_argument("SplineInterpolator::setupSplines: dvalues could not be null"); - - for (int n = nlut; n >= 1; n--) { - r = invrscalelookup * DOUBLE_TYPE(n); - func(r); //populate values and dvalues arrays - for (int func_id = 0; func_id < num_of_functions; func_id++) { - f0 = values[func_id]; - f1 = f1g(func_id); - f0d1 = dvalues[func_id] * invrscalelookup; - f1d1 = f1gd1(func_id); - // evaluate coefficients - c[0] = f0; - c[1] = f0d1; - c[2] = 3.0 * (f1 - f0) - f1d1 - 2.0 * f0d1; - c[3] = -2.0 * (f1 - f0) + f1d1 + f0d1; - // store coefficients - for (idx = 0; idx <= 3; idx++) - lookupTable(n, func_id, idx) = c[idx]; - - // evaluate function values and derivatives at current position - f1g(func_id) = c[0]; - f1gd1(func_id) = c[1]; - } - } - - -} - - -void SplineInterpolator::calcSplines(DOUBLE_TYPE r, bool calc_second_derivatives) { - DOUBLE_TYPE wl, wl2, wl3, w2l1, w3l2, w4l2; - DOUBLE_TYPE c[4]; - int func_id, idx; - DOUBLE_TYPE x = r * rscalelookup; - int nl = static_cast(floor(x)); - - if (nl <= 0) - throw std::invalid_argument("Encountered very small distance. Stopping."); - - if (nl < nlut) { - wl = x - DOUBLE_TYPE(nl); - wl2 = wl * wl; - wl3 = wl2 * wl; - w2l1 = 2.0 * wl; - w3l2 = 3.0 * wl2; - w4l2 = 6.0 * wl; - for (func_id = 0; func_id < num_of_functions; func_id++) { - for (idx = 0; idx <= 3; idx++) { - c[idx] = lookupTable(nl, func_id, idx); - } - values(func_id) = c[0] + c[1] * wl + c[2] * wl2 + c[3] * wl3; - derivatives(func_id) = (c[1] + c[2] * w2l1 + c[3] * w3l2) * rscalelookup; - if (calc_second_derivatives) - second_derivatives(func_id) = (c[2] + c[3] * w4l2) * rscalelookup * rscalelookup * 2; - } - } else { // fill with zeroes - values.fill(0); - derivatives.fill(0); - if (calc_second_derivatives) - second_derivatives.fill(0); - } -} - -void SplineInterpolator::calcSplines(DOUBLE_TYPE r, SHORT_INT_TYPE func_ind) { - DOUBLE_TYPE wl, wl2, wl3, w2l1, w3l2; - DOUBLE_TYPE c[4]; - int idx; - DOUBLE_TYPE x = r * rscalelookup; - int nl = static_cast(floor(x)); - - if (nl <= 0) - throw std::invalid_argument("Encountered very small distance. Stopping."); - - if (nl < nlut) { - wl = x - DOUBLE_TYPE(nl); - wl2 = wl * wl; - wl3 = wl2 * wl; - w2l1 = 2.0 * wl; - w3l2 = 3.0 * wl2; - - for (idx = 0; idx <= 3; idx++) { - c[idx] = lookupTable(nl, func_ind, idx); - } - values(func_ind) = c[0] + c[1] * wl + c[2] * wl2 + c[3] * wl3; - derivatives(func_ind) = (c[1] + c[2] * w2l1 + c[3] * w3l2) * rscalelookup; - - } else { // fill with zeroes - values(func_ind) = 0; - derivatives(func_ind) = 0; - } -} diff --git a/lib/pace/ace_radial.h b/lib/pace/ace_radial.h deleted file mode 100644 index e45cfaec79..0000000000 --- a/lib/pace/ace_radial.h +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef ACE_RADIAL_FUNCTIONS_H -#define ACE_RADIAL_FUNCTIONS_H - -#include "ace_arraynd.h" -#include "ace_types.h" -#include - -using namespace std; - -//typedef void (*RadialFunctions)(DOUBLE_TYPE x); -typedef std::function RadialFunctions; - -/** - * Class that implement spline interpolation and caching for radial functions - */ -class SplineInterpolator { -public: - DOUBLE_TYPE cutoff = 0; ///< cutoff - DOUBLE_TYPE deltaSplineBins = 0.001; - int ntot = 10000; ///< Number of bins for look-up tables. - int nlut = 10000; ///< number of nodes in look-up table - DOUBLE_TYPE invrscalelookup = 1; ///< inverse of conversion coefficient from distance to lookup table within cutoff range - DOUBLE_TYPE rscalelookup = 1; ///< conversion coefficient from distance to lookup table within cutoff range - int num_of_functions = 0;///< number of functions to spline-interpolation - - Array1D values;// = Array1D("values"); ///< shape: [func_ind] - Array1D derivatives;// = Array1D("derivatives");///< shape: [func_ind] - Array1D second_derivatives;// = Array1D("second_derivatives");///< shape: [func_ind] - - Array3D lookupTable = Array3D("lookupTable");///< shape: [ntot+1][func_ind][4] - - /** - * Setup splines - * - * @param num_of_functions number of functions - * @param func subroutine, that update `values` and `dvalues` arrays - * @param values values - * @param dvalues derivatives - */ - void setupSplines(int num_of_functions, RadialFunctions func, - DOUBLE_TYPE *values, - DOUBLE_TYPE *dvalues, DOUBLE_TYPE deltaSplineBins, DOUBLE_TYPE cutoff); - - /** - * Populate `values` and `derivatives` arrays with a spline-interpolation for - * all functions - * - * @param r - * - * @return: populate 'values' and 'derivatives' - */ - void calcSplines(DOUBLE_TYPE r, bool calc_second_derivatives = false); - - /** - * Populate `values` and `derivatives` arrays with a spline-interpolation for - * all functions - * - * @param r - * - * @return: populate 'values' and 'derivatives' - */ - void calcSplines(DOUBLE_TYPE r, SHORT_INT_TYPE func_ind); -}; - -/** - * Interface class for radial basis functions with rank=1 (g_k), R_nl (rank>1) and hard-core repulsion radial functions - */ -class AbstractRadialBasis { -public: - SPECIES_TYPE nelements = 0; ///< number of elements - Array2D cut = Array2D("cut"); ///< cutoffs, shape: [nelements][nelements] - Array2D dcut = Array2D("dcut"); ///< decay of cutoff, shape: [nelements][nelements] - DOUBLE_TYPE cutoff = 0; ///< cutoff - -// int ntot = 10000; ///< Number of bins for look-up tables. - DOUBLE_TYPE deltaSplineBins; - LS_TYPE lmax = 0; ///< maximum value of `l` - NS_TYPE nradial = 0; ///< maximum number `n` of radial functions \f$ R_{nl}(r) \f$ - NS_TYPE nradbase = 0; ///< number of radial basis functions \f$ g_k(r) \f$ - - // Arrays for look-up tables. - Array2D splines_gk; ///< array of spline interpolator to store g_k, shape: [nelements][nelements] - Array2D splines_rnl; ///< array of spline interpolator to store R_nl, shape: [nelements][nelements] - Array2D splines_hc; ///< array of spline interpolator to store R_nl shape: [nelements][nelements] - //-------------------------------------------------------------------------- - - string radbasename = "ChebExpCos"; ///< type of radial basis functions \f$ g_{k}(r) \f$ (default="ChebExpCos") - - /** - Arrays to store radial functions. - */ - Array1D gr = Array1D("gr"); ///< g_k(r) functions, shape: [nradbase] - Array1D dgr = Array1D("dgr"); ///< derivatives of g_k(r) functions, shape: [nradbase] - Array1D d2gr = Array1D("d2gr"); ///< derivatives of g_k(r) functions, shape: [nradbase] - - Array2D fr = Array2D("fr"); ///< R_nl(r) functions, shape: [nradial][lmax+1] - Array2D dfr = Array2D( - "dfr"); ///< derivatives of R_nl(r) functions, shape: [nradial][lmax+1] - Array2D d2fr = Array2D( - "d2fr"); ///< derivatives of R_nl(r) functions, shape: [nradial][lmax+1] - - - - DOUBLE_TYPE cr; ///< hard-core repulsion - DOUBLE_TYPE dcr; ///< derivative of hard-core repulsion - DOUBLE_TYPE d2cr; ///< derivative of hard-core repulsion - - Array5D crad = Array5D( - "crad"); ///< expansion coefficients of radial functions into radial basis function, see Eq. (27) of PRB, shape: [nelements][nelements][lmax + 1][nradial][nradbase] - Array2D lambda = Array2D( - "lambda"); ///< distance scaling parameter Eq.(24) of PRB, shape: [nelements][nelements] - - Array2D prehc = Array2D( - "prehc"); ///< hard-core repulsion coefficients (prefactor), shape: [nelements][nelements] - Array2D lambdahc = Array2D( - "lambdahc");; ///< hard-core repulsion coefficients (lambdahc), shape: [nelements][nelements] - - virtual void - evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, - bool calc_second_derivatives = false) = 0; - - virtual void - init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, SPECIES_TYPE nelements, - DOUBLE_TYPE cutoff, - string radbasename = "ChebExpCos") = 0; - - /** - * Function that sets up the look-up tables for spline-representation of radial functions. - */ - virtual void setuplookupRadspline() = 0; - - virtual AbstractRadialBasis *clone() const = 0; - - virtual ~AbstractRadialBasis() = default; -}; - - -/** -Class to store radial functions and their associated functions. \n -*/ -class ACERadialFunctions final : public AbstractRadialBasis { -public: - - //-------------------------------------------------------------------------- - - /** - Arrays to store Chebyshev polynomials. - */ - Array1D cheb = Array1D( - "cheb"); ///< Chebyshev polynomials of the first kind, shape: [nradbase+1] - Array1D dcheb = Array1D( - "dcheb"); ///< derivatives Chebyshev polynomials of the first kind, shape: [nradbase+1] - Array1D cheb2 = Array1D( - "cheb2"); ///< Chebyshev polynomials of the second kind, shape: [nradbase+1] - - //-------------------------------------------------------------------------- - - Array2D gr_vec; - Array2D dgr_vec; - Array2D d2gr_vec; - - Array3D fr_vec; - Array3D dfr_vec; - Array3D d2fr_vec; - //------------------------------------------------------------------------ - /** - * Default constructor - */ - ACERadialFunctions() = default; - - /** - * Parametrized constructor - * - * @param nradb number of radial basis function \f$ g_k(r) \f$ - nradbase - * @param lmax maximum orbital moment - lmax - * @param nradial maximum n-index of radial functions \f$ R_{nl}(r) \f$ - nradial - * @param ntot Number of bins for spline look-up tables. - * @param nelements numer of elements - * @param cutoff cutoff - * @param radbasename type of radial basis function \f$ g_k(r) \f$ (default: "ChebExpCos") - */ - ACERadialFunctions(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, - SPECIES_TYPE nelements, - DOUBLE_TYPE cutoff, string radbasename = "ChebExpCos"); - - /** - * Initialize arrays for given parameters - * - * @param nradb number of radial basis function \f$ g_k(r) \f$ - nradbase - * @param lmax maximum orbital moment - lmax - * @param nradial maximum n-index of radial functions \f$ R_{nl}(r) \f$ - nradial - * @param ntot Number of bins for spline look-up tables. - * @param nelements numer of elements - * @param cutoff cutoff - * @param radbasename type of radial basis function \f$ g_k(r) \f$ (default: "ChebExpCos") - */ - void init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, SPECIES_TYPE nelements, - DOUBLE_TYPE cutoff, - string radbasename = "ChebExpCos") final; - - /** - * Destructor - */ - ~ACERadialFunctions() final = default; - - /** - * Function that computes Chebyshev polynomials of first and second kind - * to setup the radial functions and the derivatives - * - * @param n maximum polynom order - * @param x - * - * @returns fills cheb, dcheb and cheb2 arrays - */ - void calcCheb(NS_TYPE n, DOUBLE_TYPE x); - - /** - * Function that computes radial basis functions \$f g_k(r) \$f, see Eq.(21) of PRB paper - * @param lam \$f \lambda \$f parameter, see eq. (24) of PRB paper - * @param cut cutoff - * @param dcut cutoff decay - * @param r distance - * - * @return function fills gr and dgr arrays - */ - void radbase(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r); - - /** - * Function that computes radial core repulsion \$f f_{core} = pre \exp( - \lambda r^2 ) / r \$f, - * and its derivative, see Eq.(27) of implementation notes. - * - * @param r distance - * @param pre prefactor: read from input, depends on pair of atoms mu_i mu_j - * @param lambda exponent: read from input, depends on pair of atoms mu_i mu_j - * @param cutoff cutoff distance: read from input, depends on pair of atoms mu_i mu_j - * @param cr (out) hard core repulsion - * @param dcr (out) derivative of hard core repulsion - */ - static void radcore(DOUBLE_TYPE r, DOUBLE_TYPE pre, DOUBLE_TYPE lambda, DOUBLE_TYPE cutoff, DOUBLE_TYPE &cr, - DOUBLE_TYPE &dcr); - - /** - * Function that sets up the look-up tables for spline-representation of radial functions. - */ - void setuplookupRadspline() final; - - /** - * Function that computes radial functions \f$ R_{nl}(r)\f$ (see Eq. 27 from PRB paper) - * and its derivatives for all range of n,l, - * ONLY if radial basis functions (gr and dgr) are computed. - * @param elei first species type - * @param elej second species type - * - * @return fills in fr, dfr arrays - */ - void radfunc(SPECIES_TYPE elei, SPECIES_TYPE elej); - - /** - * Compute all radial functions R_nl(r), radial basis functions g_k(r) and hard-core repulsion function hc(r) - * - * @param r distance - * @param nradbase_c - * @param nradial_c - * @param mu_i - * @param mu_j - * - * @return update gr(k), dgr(k), fr(n,l), dfr(n,l), cr, dcr - */ - void evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, - bool calc_second_derivatives = false) final; - - - void - evaluate_range(vector r_vec, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, - SPECIES_TYPE mu_j); - - void chebExpCos(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r); - - void chebPow(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r); - - void chebLinear(DOUBLE_TYPE lam, DOUBLE_TYPE cut, DOUBLE_TYPE dcut, DOUBLE_TYPE r); - - /** - * Setup all radial functions for element pair mu_i-mu_j and distance r - * @param mu_i first specie type - * @param mu_j second specie type - * @param r distance - * @return update fr(nr, l), dfr(nr, l) - */ - void all_radfunc(SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, DOUBLE_TYPE r); - - ACERadialFunctions *clone() const override { - return new ACERadialFunctions(*this); - }; -}; - -#endif \ No newline at end of file diff --git a/lib/pace/ace_recursive.cpp b/lib/pace/ace_recursive.cpp deleted file mode 100644 index c895418943..0000000000 --- a/lib/pace/ace_recursive.cpp +++ /dev/null @@ -1,1340 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Christoph Ortner on 20.12.2020 - -#include "ace_recursive.h" - -#include "ace_abstract_basis.h" -#include "ace_types.h" - -/* ------------------------------------------------------------ - * ACEDAG Implementation - * (just the DAG construction, not the traversal) - * ------------------------------------------------------------ */ - -/* Notes on different Tags: - * rec1 - first basic implementation - * rec2 - avoid index arithmetic, contiguous layout, - * canonical evaluator in ACE.jl format - * rec3 - split nodes into interior and leaf nodes - */ - -void ACEDAG::init(Array2D xAspec, - Array2D AAspec, - Array1D orders, - Array2D jl_coeffs, - int _heuristic ) { - - // remember which heuristic we want to use! - heuristic = _heuristic; - - /* stage one of the graph is just extracting the A basis from - * the tensor product format into the linear list; all information - * for that is already stored in Aspec, and the only thing to do here is - * to construct zero-coefficients. Still we have to copy Aspec, since - * the one we have here will (may?) be deleted. */ - int num1 = xAspec.get_dim(0); - Aspec = xAspec; //YL: just copying the multiarray: Aspec = xAspec; - - /* fill the one-particle basis into the DAGmap - * DAGmap[ (i1,...,in) ] = iAA index where the (i1,...,in) basis functions - * lives. - */ - TDAGMAP DAGmap; - for (int iA = 0; iA < num1; iA++) { - vector a(1); - a[0] = iA; - DAGmap[a] = iA; - } - - /* For stage 2 we now want to construct the actual recursion; the - recursion info will be stored in DAGspec, while the - coefficients go into DAGcoeffs. These arrays are initialized to - length `num2`, but they will have to grow as we add additional - artificial nodes into the graph. - - initially we treat all nodes as having children, but then in a - second stage below we reorganize. */ - int num2 = AAspec.get_dim(0); - int ndensity = jl_coeffs.get_dim(1); - nodes_pre.resize(2*num2, 2); - coeffs_pre.resize(2*num2, ndensity); - - /* the first basis function we construct will get index num1, - * since there are already num1 one-particle basis functions - * to collect during stage 1 */ - dag_idx = num1; - /* main loop over AA basis set to transform into DAG */ - for (int iAA = 0; iAA < num2; iAA++) { - // create a vector representing the current basis function - int ord = orders(iAA); - vector aa(ord); - for (int t = 0; t < ord; t++) aa[t] = AAspec(iAA, t); - vector c(ndensity); - for (int p = 0; p < ndensity; p++) c[p] = jl_coeffs(iAA, p); - insert_node(DAGmap, aa, c); - } - - /* convert to 3-stage format through reordering - * interior nodes first, then leaf nodes */ - - // allocate storage - num_nodes = dag_idx; // store total size of dag - // num_nodes - num1 = number of many-body nodes. - nodes.resize(num_nodes - num1, 2); - coeffs.resize(num_nodes - num1, ndensity); - - // find out which nodes have children - haschild.resize(num_nodes - num1); - haschild.fill(false); - for (int iAA = 0; iAA < num_nodes - num1; iAA++) { - if (nodes_pre(iAA, 0) >= num1) - haschild(nodes_pre(iAA, 0)-num1) = true; - if (nodes_pre(iAA, 1) >= num1) - haschild(nodes_pre(iAA, 1)-num1) = true; - } - - // to reorder the graph we need a fresh map from preordered indices to - // postordered indices; for the 1-particle basis the order remains the same. - // TODO: doesn't need to be a map, could be a vector. - map neworder; - for (int iA = 0; iA < num1; iA++) - neworder[iA] = iA; - - // insert all interior nodes - num2_int = 0; - num2_leaf = 0; - dag_idx = num1; - int i1, i2, i1pre, i2pre; - for (int iAA = 0; iAA < num_nodes - num1; iAA++) { - if (haschild(iAA)) { - num2_int += 1; - // indices into AAbuf before reordering - i1pre = nodes_pre(iAA, 0); - i2pre = nodes_pre(iAA, 1); - // indices into AAbuf after reordering - i1 = neworder[i1pre]; - i2 = neworder[i2pre]; - // insert the current node : iAA is old order, dag_idx is new order - neworder[num1+iAA] = dag_idx; - nodes(dag_idx-num1, 0) = i1; - nodes(dag_idx-num1, 1) = i2; - for (int t = 0; t < ndensity; t++) - coeffs(dag_idx-num1, t) = coeffs_pre(iAA, t); - dag_idx++; - } - } - - // insert all leaf nodes - for (int iAA = 0; iAA < num_nodes - num1; iAA++) { - if (!haschild(iAA)) { - num2_leaf += 1; - // indices into AAbuf before reordering - i1pre = nodes_pre(iAA, 0); - i2pre = nodes_pre(iAA, 1); - // insert the current node : no need to remember the new order now - nodes(dag_idx-num1, 0) = neworder[i1pre]; - nodes(dag_idx-num1, 1) = neworder[i2pre]; - for (int t = 0; t < ndensity; t++) - coeffs(dag_idx-num1, t) = coeffs_pre(iAA, t); - dag_idx++; - } - } -#ifdef DEBUG - cout << "num2_int = " << num2_int << "; num2_leaf = " << num2_leaf << "\n"; -#endif - // free up memory that is no longer needed - nodes_pre.resize(0, 0); - coeffs_pre.resize(0, 0); - haschild.resize(0); - - /* finalize dag: allocate buffer storage */ - AAbuf.resize(num1 + num2_int); - w.resize(num_nodes); - // TODO: technically only need num1 + num2_int for w, this can save one - // memory access later, probably not worth the crazy code duplication. -} - -void ACEDAG::insert_node(TDAGMAP &DAGmap, vector a, vector c) { - /* start with a list of all possible partitions into 2 groups - * and check whether any of these nodes are already in the dag */ - auto partitions = find_2partitions(a); - int ndensity = c.size(); - int num1 = get_num1(); - - // TODO: first try to find partitions into nodes that are already parents - // that way we will get more leaf nodes! - for (TPARTITION const& p : partitions) { - /* this is the good case; the parent nodes are both already in the - * graph; add the new node and return. This is also the only place in the - * code where an actual insert happens. */ - if (DAGmap.count(p.first) && DAGmap.count(p.second)) { - if (nodes_pre.get_dim(0) < dag_idx + 1) { //check if array is sufficiently large - int newsize = (dag_idx * 3) / 2; - nodes_pre.resize(newsize, 2); // grow arrays if necessary - coeffs_pre.resize(newsize, ndensity); - } - int i1 = DAGmap[p.first]; - int i2 = DAGmap[p.second]; - nodes_pre(dag_idx - num1, 0) = i1; - nodes_pre(dag_idx - num1, 1) = i2; - DAGmap[a] = dag_idx; - for (int p = 0; p < ndensity; p++) - coeffs_pre(dag_idx - num1, p) = c[p]; - dag_idx += 1; - return; - } - } - - /* if we are here, then this means, the new node cannot yet be inserted. - * We first need to insert some intermediate auxiliary nodes. For this - * we use a simple heuristic: - * try to find a partition where one of the two nodes are already - * in the graph, if there are several, then we remember the longest - * (this is a very greedy heuristic!!) - * .... (continue below) .... - */ - TPARTITION longest; - int longest_length = 0; - for (auto const& p : partitions) { - int len = 0; - if (DAGmap.count(p.first)) { - len = p.first.size(); - } else if (DAGmap.count(p.second)) { - len = p.second.size(); - } - if ((len > 0) && (len > longest_length)) { - longest_length = len; - longest = p; - } - } - - /* sanity check */ - if (longest_length == 0) { - std::stringstream error_message; - error_message << "WARNING : something has gone horribly wrong! `longest_length == 0`! \n"; - error_message << "a = ["; - for (int t = 0; t < a.size(); t++) - error_message << a[t] << ", "; - error_message << "]\n"; - throw std::logic_error(error_message.str()); -// return; - } - - /* If there is a partition with one component already in the graph, - * then we only need to add in the other component. Note that there will - * always be at least one such partition, namely all those containing - * a one-element node e.g. (1,2,3,4) -> (1,) (2,3,4) then (1,) is - * a one-particle basis function and hence always in the graph. - * If heuristic == 0, then we just take one of those partitionas and move on. - * - * We also accept the found partition if longest_length > 1. - * And we also accept it if we have a 2- or 3-correlation. - */ - - if ( (heuristic == 0) - || (longest_length > 1) - || (a.size() <= 3)) { - /* insert the other node that isn't in the DAG yet - * this is an artificial node so it gets zero-coefficients - * This step is recursive, so more than one node might be inserted here */ - vector cz(ndensity); - for (int i = 0; i < ndensity; i++) cz[i] = 0.0; - TPARTITION p = longest; - if (DAGmap.count(p.first)) - insert_node(DAGmap, p.second, cz); - else - insert_node(DAGmap, p.first, cz); - } - - /* Second heuristic : heuristic == 1 - * Focus on inserting artificial 2-correlations - */ - else if (heuristic == 1) { - // and we also know that longest_length == 1 and nu = a.size >= 4. - int nu = a.size(); - // generate an artificial partition - vector a1(2); - for (int i = 0; i < 2; i++) a1[i] = a[i]; - vector a2(nu - 2); - for (int i = 0; i < nu - 2; i++) a2[i] = a[2 + i]; - vector cz(ndensity); - for (int i = 0; i < cz.size(); i++) cz[i] = 0.0; - // and insert both (we know neither are in the DAG yet) - insert_node(DAGmap, a1, cz); - insert_node(DAGmap, a2, cz); - } else { - cout << "WARNING : something has gone horribly wrong! \n"; - // TODO: Throw and error here?!? - return; - } - - - - /* now we should be ready to insert the entire tuple `a` since there is now - * an eligible parent pair. Here we recompute the partition of `a`, but - * that's a small price to pay for a clearer code. Maybe this can be - * optimized a bit by wrapping it all into a while loop or having a second - * version of `insert_node` ... */ - insert_node(DAGmap, a, c); -} - -TPARTITIONS ACEDAG::find_2partitions(vector v) { - int N = v.size(); - int zo; - TPARTITIONS partitions; - TPARTITION part; - /* This is a fun little hack to extract all subsets of the indices 1:N - * the number i will have binary representation with each digit indicating - * whether or not that index belongs to the selected subset */ - for (int i = 1; i < (1< v1(N1); - vector v2(N2); - int i1 =0, i2 = 0; - p = 1; - for (int n = 0; n < N; n++) { - zo = ((i / p) % 2); - p *= 2; - if (zo == 1) { - v1[i1] = v[n]; - i1 += 1; - } else { - v2[i2] = v[n]; - i2 += 1; - } - } - part = make_pair(v1, v2); - partitions.push_back(part); - } - return partitions; -} - -void ACEDAG::print() { - cout << "DAG Specification: \n" ; - cout << " n1 : " << get_num1() << "\n"; - cout << " n2 : " << get_num2() << "\n"; - cout << " num_nodes : " << num_nodes << "\n"; - cout << "--------------------\n"; - cout << "A-spec: \n"; - for (int iA = 0; iA < get_num1(); iA++) { - cout << iA << " : " << Aspec(iA, 0) << - Aspec(iA, 1) << Aspec(iA, 2) << Aspec(iA, 3) << "\n"; - } - - cout << "-----------\n"; - cout << "AA-tree\n"; - - for (int iAA = 0; iAA < get_num2(); iAA++) { - cout << iAA + get_num1() << " : " << - nodes(iAA, 0) << ", " << nodes(iAA, 1) << "\n"; - } -} - - -/* ------------------------------------------------------------ - * ACERecursiveEvaluator - * ------------------------------------------------------------ */ - - -void ACERecursiveEvaluator::set_basis(ACECTildeBasisSet &bas, int heuristic) { - basis_set = &bas; - init(basis_set, heuristic); -} - -void ACERecursiveEvaluator::init(ACECTildeBasisSet *basis_set, int heuristic) { - - ACEEvaluator::init(basis_set); - - - weights.init(basis_set->nelements, basis_set->nradmax + 1, basis_set->lmax + 1, - "weights"); - - weights_rank1.init(basis_set->nelements, basis_set->nradbase, "weights_rank1"); - - - DG_cache.init(1, basis_set->nradbase, "DG_cache"); - DG_cache.fill(0); - - R_cache.init(1, basis_set->nradmax, basis_set->lmax + 1, "R_cache"); - R_cache.fill(0); - - DR_cache.init(1, basis_set->nradmax, basis_set->lmax + 1, "DR_cache"); - DR_cache.fill(0); - - Y_cache.init(1, basis_set->lmax + 1, "Y_cache"); - Y_cache.fill({0, 0}); - - DY_cache.init(1, basis_set->lmax + 1, "dY_dense_cache"); - DY_cache.fill({0.}); - - //hard-core repulsion - DCR_cache.init(1, "DCR_cache"); - DCR_cache.fill(0); - dB_flatten.init(basis_set->max_dB_array_size, "dB_flatten"); - - /* convert to ACE.jl format to prepare for construction of DAG - * This will fill the arrays jl_Aspec, jl_AAspec, jl_orders - */ - acejlformat(); - - // test_acejlformat(); - - // now pass this info into the DAG - dag.init(jl_Aspec, jl_AAspec, jl_orders, jl_coeffs, heuristic); - - // finally empty the temporary arrays to clear up the memory... - // TODO -} - - -void ACERecursiveEvaluator::acejlformat() { - - int func_ms_ind = 0; - int func_ms_t_ind = 0;// index for dB - int j, jj, func_ind, ms_ind; - - SPECIES_TYPE mu_i = 0;//TODO: multispecies - const SHORT_INT_TYPE total_basis_size = basis_set->total_basis_size[mu_i]; - ACECTildeBasisFunction *basis = basis_set->basis[mu_i]; - - int AAidx = 0; - RANK_TYPE order, t; - SPECIES_TYPE *mus; - NS_TYPE *ns; - LS_TYPE *ls; - MS_TYPE *ms; - - /* transform basis into new format: - [A1 ... A_num1] - [(i1,i2)(i1,i2)(...)(i1,i2,i3)(...)] - where each ia represents an A_{ia} - */ - - /* compute max values for mu, n, l, m */ - SPECIES_TYPE maxmu = 0; //TODO: multispecies - NS_TYPE maxn = basis_set->nradmax; - LS_TYPE maxl = basis_set->lmax; - RANK_TYPE maxorder = basis_set->rankmax; - const DENSITY_TYPE ndensity = basis_set->ndensitymax; - - int num1 = 0; - - - /* create a 4D lookup table for the 1-p basis - * TODO: replace with a map?? - */ - Array4D A_lookup(int(maxmu+1), int(maxn), int(maxl+1), int(2*maxl+1)); - for (int mu = 0; mu < maxmu+1; mu++) - for (int n = 0; n < maxn; n++) - for (int l = 0; l < maxl+1; l++) - for (int m = 0; m < 2*maxl+1; m++) - A_lookup(mu, n, l, m) = -1; - int A_idx = 0; // linear index of A basis function (1-particle) - for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { - ACECTildeBasisFunction *func = &basis[func_ind]; -// func->print(); - order = func->rank; mus = func->mus; ns = func->ns; ls = func->ls; - for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { - ms = &func->ms_combs[ms_ind * order]; - for (t = 0; t < order; t++) { - int iA = A_lookup(mus[t], ns[t]-1, ls[t], ms[t]+ls[t]); - if (iA == -1) { - A_lookup(mus[t], ns[t] - 1, ls[t], ms[t] + ls[t]) = A_idx; - A_idx += 1; - } - } - } - } - - /* create the reverse list: linear indixes to mu,l,m,n - this keeps only the basis functions we really need */ - num1 = A_idx; - Array2D & Aspec = jl_Aspec; - Aspec.resize(num1, 4); - // Array2D Aspec(num1, 4); - for (int mu = 0; mu <= maxmu; mu++) - for (int n = 1; n <= maxn; n++) - for (int l = 0; l <= maxl; l++) - for (int m = -l; m <= l; m++) { - int iA = A_lookup(mu, n-1, l, l+m); - if (iA != -1) { - Aspec(iA, 0) = mu; - Aspec(iA, 1) = n; - Aspec(iA, 2) = l; - Aspec(iA, 3) = m; - } - } - - /* ============ HALF-BASIS TRICK START ============ */ - for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { - ACECTildeBasisFunction *func = &basis[func_ind]; - order = func->rank; mus = func->mus; ns = func->ns; ls = func->ls; - if (!( (mus[0] <= maxmu) && (ns[0] <= maxn) && (ls[0] <= maxl) )) - continue; - - for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { - ms = &func->ms_combs[ms_ind * order]; - - // find first positive and negative index - int pos_idx = order + 1; - int neg_idx = order + 1; - for (t = order-1; t >= 0; t--) - if (ms[t] > 0) pos_idx = t; - else if (ms[t] < 0) neg_idx = t; - - // if neg_idx < pos_idx then this means that ms is non-zero - // and that the first non-zero index is negative, hence this is - // a negative-sign tuple which we want to combine into - // its opposite. - if (neg_idx < pos_idx) { - // find the opposite tuple - int ms_ind2 = 0; - MS_TYPE *ms2; - bool found_opposite = false; - for (ms_ind2 = 0; ms_ind2 < func->num_ms_combs; ++ms_ind2) { - ms2 = &func->ms_combs[ms_ind2 * order]; - bool isopposite = true; - for (t = 0; t < order; t++) - if (ms[t] != -ms2[t]) { - isopposite = false; - break; - } - if (isopposite) { - found_opposite = true; - break; - } - } - - if (ms_ind == ms_ind2) { - cout << "WARNING - ms_ind == ms_ind2 \n"; - } - - // now we need to overwrite the coefficients - if (found_opposite) { - int sig = 1; - for (t = 0; t < order; t++) - if (ms[t] < 0) - sig *= -1; - for (int p = 0; p < ndensity; ++p) { - func->ctildes[ms_ind2 * ndensity + p] += - func->ctildes[ms_ind * ndensity + p]; - func->ctildes[ms_ind * ndensity + p] = 0.0; - } - } - } - } - } - - // /* ============ HALF-BASIS TRICK END ============ */ - - - /* count number of basis functions, keep only non-zero!! */ - int num2 = 0; - for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { - ACECTildeBasisFunction *func = &basis[func_ind]; - for (ms_ind = 0; ms_ind < (&basis[func_ind])->num_ms_combs; ++ms_ind, ++func_ms_ind) { - // check that the coefficients are actually non-zero - bool isnonzero = false; - for (DENSITY_TYPE p = 0; p < ndensity; ++p) - if (func->ctildes[ms_ind * ndensity + p] != 0.0) - isnonzero = true; - if (isnonzero) - num2++; - } - } - - - /* Now create the AA basis links into the A basis */ - num1 = A_idx; // total number of A-basis functions that we keep - // Array1D AAorders(num2); - Array1D & AAorders = jl_orders; - AAorders.resize(num2); - // Array2D AAspec(num2, maxorder); // specs of AA basis functions - Array2D & AAspec = jl_AAspec; - AAspec.resize(num2, maxorder); - jl_coeffs.resize(num2, ndensity); - AAidx = 0; // linear index into AA basis function - int len_flat = 0; - for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { - ACECTildeBasisFunction *func = &basis[func_ind]; - order = func->rank; mus = func->mus; ns = func->ns; ls = func->ls; - if (!((mus[0] <= maxmu) && (ns[0] <= maxn) && (ls[0] <= maxl))) //fool-proofing of functions - continue; - - for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { - ms = &func->ms_combs[ms_ind * order]; - - // check that the coefficients are actually non-zero - bool iszero = true; - for (DENSITY_TYPE p = 0; p < ndensity; ++p) - if (func->ctildes[ms_ind * ndensity + p] != 0.0) - iszero = false; - if (iszero) continue; - - AAorders(AAidx) = order; - for (t = 0; t < order; t++) { - int Ait = A_lookup(int(mus[t]), int(ns[t]-1), int(ls[t]), int(ms[t])+int(ls[t])); - AAspec(AAidx, t) = Ait; - len_flat += 1; - } - for (t = order; t < maxorder; t++) AAspec(AAidx, t) = -1; - /* copy over the coefficients */ - for (DENSITY_TYPE p = 0; p < ndensity; ++p) - jl_coeffs(AAidx, p) = func->ctildes[ms_ind * ndensity + p]; - AAidx += 1; - } - } - - // flatten the AAspec array - jl_AAspec_flat.resize(len_flat); - int idx_spec = 0; - for (int AAidx = 0; AAidx < jl_AAspec.get_dim(0); AAidx++) - for (int p = 0; p < jl_orders(AAidx); p++, idx_spec++) - jl_AAspec_flat(idx_spec) = jl_AAspec(AAidx, p); - -} - -void ACERecursiveEvaluator::test_acejlformat() { - - Array2D AAspec = jl_AAspec; - Array2D Aspec = jl_Aspec; - Array1D AAorders = jl_orders; - cout << "num2 = " << AAorders.get_dim(0) << "\n"; - int func_ms_ind = 0; - int func_ms_t_ind = 0;// index for dB - int j, jj, func_ind, ms_ind; - - SPECIES_TYPE mu_i = 0; - const SHORT_INT_TYPE total_basis_size = basis_set->total_basis_size[mu_i]; - ACECTildeBasisFunction *basis = basis_set->basis[mu_i]; - - RANK_TYPE order, t; - SPECIES_TYPE *mus; - NS_TYPE *ns; - LS_TYPE *ls; - MS_TYPE *ms; - - /* ==== test by printing the basis spec ====*/ - // TODO: convert this into an automatic consistency test - int iAA = 0; - for (func_ind = 0; func_ind < total_basis_size; ++func_ind) { - ACECTildeBasisFunction *func = &basis[func_ind]; - order = func->rank; mus = func->mus; ns = func->ns; ls = func->ls; - // func->print(); - //loop over {ms} combinations in sum - for (ms_ind = 0; ms_ind < func->num_ms_combs; ++ms_ind, ++func_ms_ind) { - ms = &func->ms_combs[ms_ind * order]; - - - cout << iAA << " : |"; - for (t = 0; t < order; t++) - cout << mus[t] << ";" << ns[t] << "," << ls[t] << "," << ms[t] << "|"; - cout << "\n"; - - cout << " ["; - for (t = 0; t < AAorders(iAA); t++) - cout << AAspec(iAA, int(t)) << ","; - cout << "]\n"; - cout << " |"; - for (t = 0; t < AAorders(iAA); t++) { - int iA = AAspec(iAA, t); - // cout << iA << ","; - cout << Aspec(iA, 0) << ";" - << Aspec(iA, 1) << "," - << Aspec(iA, 2) << "," - << Aspec(iA, 3) << "|"; - } - cout << "\n"; - iAA += 1; - } - } - /* ==== END TEST ==== */ - - -} - - - - -void ACERecursiveEvaluator::resize_neighbours_cache(int max_jnum) { - if(basis_set== nullptr) { - throw std::invalid_argument("ACERecursiveEvaluator: basis set is not assigned"); - } - if (R_cache.get_dim(0) < max_jnum) { - - //TODO: implement grow - R_cache.resize(max_jnum, basis_set->nradmax, basis_set->lmax + 1); - R_cache.fill(0); - - DR_cache.resize(max_jnum, basis_set->nradmax, basis_set->lmax + 1); - DR_cache.fill(0); - - DG_cache.resize(max_jnum, basis_set->nradbase); - DG_cache.fill(0); - - Y_cache.resize(max_jnum, basis_set->lmax + 1); - Y_cache.fill({0, 0}); - - DY_cache.resize(max_jnum, basis_set->lmax + 1); - DY_cache.fill({0}); - - //hard-core repulsion - DCR_cache.init(max_jnum, "DCR_cache"); - DCR_cache.fill(0); - } -} - - - -// double** r - atomic coordinates of atom I -// int* types - atomic types if atom I -// int **firstneigh - ptr to 1st J int value of each I atom. Usage: jlist = firstneigh[i]; -// Usage: j = jlist_of_i[jj]; -// jnum - number of J neighbors for each I atom. jnum = numneigh[i]; - -void -ACERecursiveEvaluator::compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) { - if(basis_set== nullptr) { - throw std::invalid_argument("ACERecursiveEvaluator: basis set is not assigned"); - } - per_atom_calc_timer.start(); -#ifdef PRINT_MAIN_STEPS - printf("\n ATOM: ind = %d r_norm=(%f, %f, %f)\n",i, x[i][0], x[i][1], x[i][2]); -#endif - DOUBLE_TYPE evdwl = 0, evdwl_cut = 0, rho_core = 0; - DOUBLE_TYPE r_norm; - DOUBLE_TYPE xn, yn, zn, r_xyz; - DOUBLE_TYPE R, GR, DGR, R_over_r, DR, DCR; - DOUBLE_TYPE *r_hat; - - SPECIES_TYPE mu_j; - RANK_TYPE r, rank, t; - NS_TYPE n; - LS_TYPE l; - MS_TYPE m, m_t; - - SPECIES_TYPE *mus; - NS_TYPE *ns; - LS_TYPE *ls; - MS_TYPE *ms; - - int j, jj, func_ind, ms_ind; - SHORT_INT_TYPE factor; - - ACEComplex Y{0}, Y_DR{0.}; - ACEComplex B{0.}; - ACEComplex dB{0}; - ACEComplex A_cache[basis_set->rankmax]; - - ACEComplex dA[basis_set->rankmax]; - int spec[basis_set->rankmax]; - - dB_flatten.fill({0.}); - - ACEDYcomponent grad_phi_nlm{0}, DY{0.}; - - //size is +1 of max to avoid out-of-boundary array access in double-triangular scheme - ACEComplex A_forward_prod[basis_set->rankmax + 1]; - ACEComplex A_backward_prod[basis_set->rankmax + 1]; - - DOUBLE_TYPE inv_r_norm; - DOUBLE_TYPE r_norms[jnum]; - DOUBLE_TYPE inv_r_norms[jnum]; - DOUBLE_TYPE rhats[jnum][3];//normalized vector - SPECIES_TYPE elements[jnum]; - const DOUBLE_TYPE xtmp = x[i][0]; - const DOUBLE_TYPE ytmp = x[i][1]; - const DOUBLE_TYPE ztmp = x[i][2]; - DOUBLE_TYPE f_ji[3]; - - bool is_element_mapping = element_type_mapping.get_size() > 0; - SPECIES_TYPE mu_i; - if (is_element_mapping) - mu_i = element_type_mapping(type[i]); - else - mu_i = type[i]; - - const SHORT_INT_TYPE total_basis_size_rank1 = basis_set->total_basis_size_rank1[mu_i]; - const SHORT_INT_TYPE total_basis_size = basis_set->total_basis_size[mu_i]; - - ACECTildeBasisFunction *basis_rank1 = basis_set->basis_rank1[mu_i]; - ACECTildeBasisFunction *basis = basis_set->basis[mu_i]; - - DOUBLE_TYPE rho_cut, drho_cut, fcut, dfcut; - DOUBLE_TYPE dF_drho_core; - - //TODO: lmax -> lmaxi (get per-species type) - const LS_TYPE lmaxi = basis_set->lmax; - - //TODO: nradmax -> nradiali (get per-species type) - const NS_TYPE nradiali = basis_set->nradmax; - - //TODO: nradbase -> nradbasei (get per-species type) - const NS_TYPE nradbasei = basis_set->nradbase; - - //TODO: get per-species type number of densities - const DENSITY_TYPE ndensity= basis_set->ndensitymax; - - neighbours_forces.resize(jnum, 3); - neighbours_forces.fill(0); - - //TODO: shift nullifications to place where arrays are used - weights.fill({0}); - weights_rank1.fill(0); - A.fill({0}); - A_rank1.fill(0); - rhos.fill(0); - dF_drho.fill(0); - -#ifdef EXTRA_C_PROJECTIONS - basis_projections_rank1.init(total_basis_size_rank1, ndensity, "c_projections_rank1"); - basis_projections.init(total_basis_size, ndensity, "c_projections"); -#endif - - //proxy references to spherical harmonics and radial functions arrays - const Array2DLM &ylm = basis_set->spherical_harmonics.ylm; - const Array2DLM &dylm = basis_set->spherical_harmonics.dylm; - - const Array2D &fr = basis_set->radial_functions->fr; - const Array2D &dfr = basis_set->radial_functions->dfr; - - const Array1D &gr = basis_set->radial_functions->gr; - const Array1D &dgr = basis_set->radial_functions->dgr; - - loop_over_neighbour_timer.start(); - - int jj_actual = 0; - SPECIES_TYPE type_j = 0; - int neighbour_index_mapping[jnum]; // jj_actual -> jj - //loop over neighbours, compute distance, consider only atoms within with rradial_functions->cut(mu_i, mu_j); - r_xyz = sqrt(xn * xn + yn * yn + zn * zn); - - if (r_xyz >= current_cutoff) - continue; - - inv_r_norm = 1 / r_xyz; - - r_norms[jj_actual] = r_xyz; - inv_r_norms[jj_actual] = inv_r_norm; - rhats[jj_actual][0] = xn * inv_r_norm; - rhats[jj_actual][1] = yn * inv_r_norm; - rhats[jj_actual][2] = zn * inv_r_norm; - elements[jj_actual] = mu_j; - neighbour_index_mapping[jj_actual] = jj; - jj_actual++; - } - - int jnum_actual = jj_actual; - - //ALGORITHM 1: Atomic base A - for (jj = 0; jj < jnum_actual; ++jj) { - r_norm = r_norms[jj]; - mu_j = elements[jj]; - r_hat = rhats[jj]; - - //proxies - Array2DLM &Y_jj = Y_cache(jj); - Array2DLM &DY_jj = DY_cache(jj); - - - basis_set->radial_functions->evaluate(r_norm, basis_set->nradbase, nradiali, mu_i, mu_j); - basis_set->spherical_harmonics.compute_ylm(r_hat[0], r_hat[1], r_hat[2], lmaxi); - //loop for computing A's - //rank = 1 - for (n = 0; n < basis_set->nradbase; n++) { - GR = gr(n); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("-neigh atom %d\n", jj); - printf("gr(n=%d)(r=%f) = %f\n", n, r_norm, gr(n)); - printf("dgr(n=%d)(r=%f) = %f\n", n, r_norm, dgr(n)); -#endif - DG_cache(jj, n) = dgr(n); - A_rank1(mu_j, n) += GR * Y00; - } - //loop for computing A's - // for rank > 1 - for (n = 0; n < nradiali; n++) { - auto &A_lm = A(mu_j, n); - for (l = 0; l <= lmaxi; l++) { - R = fr(n, l); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("R(nl=%d,%d)(r=%f)=%f\n", n + 1, l, r_norm, R); -#endif - - DR_cache(jj, n, l) = dfr(n, l); - R_cache(jj, n, l) = R; - - for (m = 0; m <= l; m++) { - Y = ylm(l, m); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("Y(lm=%d,%d)=(%f, %f)\n", l, m, Y.real, Y.img); -#endif - A_lm(l, m) += R * Y; //accumulation sum over neighbours - Y_jj(l, m) = Y; - DY_jj(l, m) = dylm(l, m); - } - } - } - - //hard-core repulsion - rho_core += basis_set->radial_functions->cr; - DCR_cache(jj) = basis_set->radial_functions->dcr; - - } //end loop over neighbours - - //complex conjugate A's (for NEGATIVE (-m) terms) - // for rank > 1 - for (mu_j = 0; mu_j < basis_set->nelements; mu_j++) { - for (n = 0; n < nradiali; n++) { - auto &A_lm = A(mu_j, n); - for (l = 0; l <= lmaxi; l++) { - //fill in -m part in the outer loop using the same m <-> -m symmetry as for Ylm - for (m = 1; m <= l; m++) { - factor = m % 2 == 0 ? 1 : -1; - A_lm(l, -m) = A_lm(l, m).conjugated() * factor; - } - } - } - } //now A's are constructed - loop_over_neighbour_timer.stop(); - - // ==================== ENERGY ==================== - - energy_calc_timer.start(); -#ifdef EXTRA_C_PROJECTIONS - basis_projections_rank1.fill(0); - basis_projections.fill(0); -#endif - - //ALGORITHM 2: Basis functions B with iterative product and density rho(p) calculation - //rank=1 - for (int func_rank1_ind = 0; func_rank1_ind < total_basis_size_rank1; ++func_rank1_ind) { - ACECTildeBasisFunction *func = &basis_rank1[func_rank1_ind]; -// ndensity = func->ndensity; -#ifdef PRINT_LOOPS_INDICES - printf("Num density = %d r = 0\n",(int) ndensity ); - print_C_tilde_B_basis_function(*func); -#endif - double A_cur = A_rank1(func->mus[0], func->ns[0] - 1); -#ifdef DEBUG_ENERGY_CALCULATIONS - printf("A_r=1(x=%d, n=%d)=(%f)\n", func->mus[0], func->ns[0], A_cur); - printf(" coeff[0] = %f\n", func->ctildes[0]); -#endif - for (DENSITY_TYPE p = 0; p < ndensity; ++p) { - //for rank=1 (r=0) only 1 ms-combination exists (ms_ind=0), so index of func.ctildes is 0..ndensity-1 - rhos(p) += func->ctildes[p] * A_cur; -#ifdef EXTRA_C_PROJECTIONS - //aggregate C-projections separately - basis_projections_rank1(func_rank1_ind, p)+= func->ctildes[p] * A_cur; -#endif - } - } // end loop for rank=1 - - // ================ START RECURSIVE EVALUATOR ==================== - // (rank > 1 only) - - /* STAGE 1: - * 1-particle basis is already evaluated, so we only need to - * copy it into the AA value buffer - */ - int num1 = dag.get_num1(); - for (int idx = 0; idx < num1; idx++) - dag.AAbuf(idx) = A( dag.Aspec(idx, 0), - dag.Aspec(idx, 1)-1, - dag.Aspec(idx, 2), - dag.Aspec(idx, 3) ); - - - if (recursive) { - /* STAGE 2: FORWARD PASS - * Forward pass: go through the dag and store all intermediate results - */ - - // rhos.fill(0); note the rhos are already reset and started filling above! - ACEComplex AAcur{0.0}; - int i1, i2; - - int * dag_nodes = dag.nodes.get_data(); - int idx_nodes = 0; - - DOUBLE_TYPE * dag_coefs = dag.coeffs.get_data(); - int idx_coefs = 0; - - int num2_int = dag.get_num2_int(); - int num2_leaf = dag.get_num2_leaf(); - - // interior nodes (save AA) - for (int idx = num1; idx < num1+num2_int; idx++) { - i1 = dag_nodes[idx_nodes]; idx_nodes++; - i2 = dag_nodes[idx_nodes]; idx_nodes++; - AAcur = dag.AAbuf(i1) * dag.AAbuf(i2); - dag.AAbuf(idx) = AAcur; - for (int p = 0; p < ndensity; p++, idx_coefs++) - rhos(p) += AAcur.real_part_product(dag_coefs[idx_coefs]); - } - - // leaf nodes -> no need to store in AAbuf - DOUBLE_TYPE AAcur_re = 0.0; - for (int _idx = 0; _idx < num2_leaf; _idx++) { - i1 = dag_nodes[idx_nodes]; idx_nodes++; - i2 = dag_nodes[idx_nodes]; idx_nodes++; - AAcur_re = dag.AAbuf(i1).real_part_product(dag.AAbuf(i2)); - for (int p = 0; p < ndensity; p++, idx_coefs++) - rhos(p) += AAcur_re * dag_coefs[idx_coefs]; - } - - } else { - - /* non-recursive Julia-style evaluator implementation */ - // TODO: fix array access to enable bounds checking again??? - ACEComplex AAcur{1.0}; - int *AAspec = jl_AAspec_flat.get_data(); - DOUBLE_TYPE *coeffs = jl_coeffs.get_data(); - int idx_spec = 0; - int idx_coefs = 0; - int order = 0; - int max_order = jl_AAspec.get_dim(1); - for (int iAA = 0; iAA < jl_AAspec.get_dim(0); iAA ++) { - AAcur = 1.0; - order = jl_orders(iAA); - for (int r = 0; r < order; r++, idx_spec++) - AAcur *= dag.AAbuf( AAspec[idx_spec] ); - for (int p = 0; p < ndensity; p++, idx_coefs++) - rhos(p) += AAcur.real_part_product(coeffs[idx_coefs]); - } - } - - /* we now have rho and can evaluate lots of things. - -------- this is back to the original PACE code --------- */ - -#ifdef DEBUG_FORCES_CALCULATIONS - printf("rhos = "); - for(DENSITY_TYPE p =0; prho_core_cutoffs(mu_i); - drho_cut = basis_set->drho_core_cutoffs(mu_i); - - basis_set->inner_cutoff(rho_core, rho_cut, drho_cut, fcut, dfcut); - basis_set->FS_values_and_derivatives(rhos, evdwl, dF_drho, ndensity); - - dF_drho_core = evdwl * dfcut + 1; - for (DENSITY_TYPE p = 0; p < ndensity; ++p) - dF_drho(p) *= fcut; - evdwl_cut = evdwl * fcut + rho_core; - - // E0 shift - evdwl_cut += basis_set->E0vals(mu_i); - - /* I've moved this from below the weight calculation - since I believe it only times the energy? the weights - are only needed for the forces? - But I believe we could add a third timer for computing just - the weights; this will allow us to check better where the - bottleneck is. - */ - energy_calc_timer.stop(); - - forces_calc_loop_timer.start(); - - -#ifdef DEBUG_FORCES_CALCULATIONS - printf("dFrhos = "); - for(DENSITY_TYPE p =0; pndensity; - for (DENSITY_TYPE p = 0; p < ndensity; ++p) { - //for rank=1 (r=0) only 1 ms-combination exists (ms_ind=0), so index of func.ctildes is 0..ndensity-1 - weights_rank1(func->mus[0], func->ns[0] - 1) += dF_drho(p) * func->ctildes[p]; - } - } - - /* --------- we now continue with the recursive code --------- */ - - if (recursive) { - /* STAGE 2: BACKWARD PASS */ - int i1, i2; - ACEComplex AA1{0.0}; - ACEComplex AA2{0.0}; - ACEComplex wcur{0.0}; - int num2_int = dag.get_num2_int(); - int num2_leaf = dag.get_num2_leaf(); - /* to prepare for the backward we first need to zero the weights */ - dag.w.fill({0.0}); - - int * dag_nodes = dag.nodes.get_data(); - int idx_nodes = 2 * (num2_int + num2_leaf) - 1; - - DOUBLE_TYPE * dag_coefs = dag.coeffs.get_data(); - int idx_coefs = ndensity * (num2_int + num2_leaf) - 1; - - for (int idx = num1+num2_int+num2_leaf - 1; idx >= num1; idx--) { - i2 = dag_nodes[idx_nodes]; idx_nodes--; - i1 = dag_nodes[idx_nodes]; idx_nodes--; - AA1 = dag.AAbuf(i1); - AA2 = dag.AAbuf(i2); - wcur = dag.w(idx); // [***] - for (int p = ndensity-1; p >= 0; p--, idx_coefs--) - wcur += dF_drho(p) * dag_coefs[idx_coefs]; - dag.w(i1) += wcur * AA2; // TODO: replace with explicit muladd? - dag.w(i2) += wcur * AA1; - } - - /* [***] - * Note that these weights don't really need to be stored for the - * leaf nodes. We tested splitting this for loop into two where - * for the leaf nodes the weight would just be initialized to 0.0 - * instead of reading from an array. The improvement was barely - * measurable, ca 3%, so we reverted to this simpler algorithm - */ - - - } else { - - // non-recursive ACE.jl style implemenation of gradients, but with - // a backward differentiation approach to the prod-A - // (cf. Algorithm 3 in the manuscript) - - dag.w.fill({0.0}); - ACEComplex AAf{1.0}, AAb{1.0}, theta{0.0}; - - int *AAspec = jl_AAspec_flat.get_data(); - DOUBLE_TYPE *coeffs = jl_coeffs.get_data(); - int idx_spec = 0; - int idx_coefs = 0; - int order = 0; - int max_order = jl_AAspec.get_dim(1); - for (int iAA = 0; iAA < jl_AAspec.get_dim(0); iAA ++ ) { - order = jl_orders(iAA); - theta = 0.0; - for (int p = 0; p < ndensity; p++, idx_coefs++) - theta += dF_drho(p) * coeffs[idx_coefs]; - dA[0] = 1.0; - AAf = 1.0; - for (int t = 0; t < order-1; t++, idx_spec++) { - spec[t] = AAspec[idx_spec]; - A_cache[t] = dag.AAbuf(spec[t]); - AAf *= A_cache[t]; - dA[t+1] = AAf; - } - spec[order-1] = AAspec[idx_spec]; idx_spec++; - A_cache[order-1] = dag.AAbuf(spec[order-1]); - AAb = 1.0; - for (int t = order-1; t >= 1; t--) { - AAb *= A_cache[t]; - dA[t-1] *= AAb; - dag.w(spec[t]) += theta * dA[t]; - } - dag.w(spec[0]) += theta * dA[0]; - } - - } - - /* STAGE 3: - * get the gradients from the 1-particle basis gradients and write them - * into the dF/drho derivatives. - */ - /* In order to reuse the original PACE code, we copy the weights back - * into the the PACE datastructure. */ - - for (int idx = 0; idx < num1; idx++) { - int m = dag.Aspec(idx, 3); - if (m >= 0) { - weights(dag.Aspec(idx, 0), // mu - dag.Aspec(idx, 1) - 1, // n - dag.Aspec(idx, 2), // l - m ) += dag.w(idx); - } else { - int factor = (m % 2 == 0 ? 1 : -1); - weights(dag.Aspec(idx, 0), // mu - dag.Aspec(idx, 1) - 1, // n - dag.Aspec(idx, 2), // l - -m ) += factor * dag.w(idx).conjugated(); - } - } - - - /* ------ From here we are now back to the original PACE code ---- */ - -// ==================== FORCES ==================== -#ifdef PRINT_MAIN_STEPS - printf("\nFORCE CALCULATION\n"); - printf("loop over neighbours\n"); -#endif - -// loop over neighbour atoms for force calculations - for (jj = 0; jj < jnum_actual; ++jj) { - mu_j = elements[jj]; - r_hat = rhats[jj]; - inv_r_norm = inv_r_norms[jj]; - - Array2DLM &Y_cache_jj = Y_cache(jj); - Array2DLM &DY_cache_jj = DY_cache(jj); - -#ifdef PRINT_LOOPS_INDICES - printf("\nneighbour atom #%d\n", jj); - printf("rhat = (%f, %f, %f)\n", r_hat[0], r_hat[1], r_hat[2]); -#endif - - forces_calc_neighbour_timer.start(); - - f_ji[0] = f_ji[1] = f_ji[2] = 0; - -//for rank = 1 - for (n = 0; n < nradbasei; ++n) { - if (weights_rank1(mu_j, n) == 0) - continue; - auto &DG = DG_cache(jj, n); - DGR = DG * Y00; - DGR *= weights_rank1(mu_j, n); -#ifdef DEBUG_FORCES_CALCULATIONS - printf("r=1: (n,l,m)=(%d, 0, 0)\n",n+1); - printf("\tGR(n=%d, r=%f)=%f\n",n+1,r_norm, gr(n)); - printf("\tDGR(n=%d, r=%f)=%f\n",n+1,r_norm, dgr(n)); - printf("\tdF+=(%f, %f, %f)\n",DGR * r_hat[0], DGR * r_hat[1], DGR * r_hat[2]); -#endif - f_ji[0] += DGR * r_hat[0]; - f_ji[1] += DGR * r_hat[1]; - f_ji[2] += DGR * r_hat[2]; - } - -//for rank > 1 - for (n = 0; n < nradiali; n++) { - for (l = 0; l <= lmaxi; l++) { - R_over_r = R_cache(jj, n, l) * inv_r_norm; - DR = DR_cache(jj, n, l); - - // for m>=0 - for (m = 0; m <= l; m++) { - ACEComplex w = weights(mu_j, n, l, m); - if (w == 0) - continue; - //counting for -m cases if m>0 - // if (m > 0) w *= 2; // not needed for recursive eval - - DY = DY_cache_jj(l, m); - Y_DR = Y_cache_jj(l, m) * DR; - - grad_phi_nlm.a[0] = Y_DR * r_hat[0] + DY.a[0] * R_over_r; - grad_phi_nlm.a[1] = Y_DR * r_hat[1] + DY.a[1] * R_over_r; - grad_phi_nlm.a[2] = Y_DR * r_hat[2] + DY.a[2] * R_over_r; -#ifdef DEBUG_FORCES_CALCULATIONS - printf("d_phi(n=%d, l=%d, m=%d) = ((%f,%f), (%f,%f), (%f,%f))\n",n+1,l,m, - grad_phi_nlm.a[0].real, grad_phi_nlm.a[0].img, - grad_phi_nlm.a[1].real, grad_phi_nlm.a[1].img, - grad_phi_nlm.a[2].real, grad_phi_nlm.a[2].img); - - printf("weights(n,l,m)(%d,%d,%d) = (%f,%f)\n", n+1, l, m, w.real, w.img); - //if (m>0) w*=2; - printf("dF(n,l,m)(%d, %d, %d) += (%f, %f, %f)\n", n + 1, l, m, - w.real_part_product(grad_phi_nlm.a[0]), - w.real_part_product(grad_phi_nlm.a[1]), - w.real_part_product(grad_phi_nlm.a[2]) - ); -#endif -// real-part multiplication only - f_ji[0] += w.real_part_product(grad_phi_nlm.a[0]); - f_ji[1] += w.real_part_product(grad_phi_nlm.a[1]); - f_ji[2] += w.real_part_product(grad_phi_nlm.a[2]); - } - } - } - - -#ifdef PRINT_INTERMEDIATE_VALUES - printf("f_ji(jj=%d, i=%d)=(%f, %f, %f)\n", jj, i, - f_ji[0], f_ji[1], f_ji[2] - ); -#endif - - //hard-core repulsion - DCR = DCR_cache(jj); -#ifdef DEBUG_FORCES_CALCULATIONS - printf("DCR = %f\n",DCR); -#endif - f_ji[0] += dF_drho_core * DCR * r_hat[0]; - f_ji[1] += dF_drho_core * DCR * r_hat[1]; - f_ji[2] += dF_drho_core * DCR * r_hat[2]; -#ifdef PRINT_INTERMEDIATE_VALUES - printf("with core-repulsion\n"); - printf("f_ji(jj=%d, i=%d)=(%f, %f, %f)\n", jj, i, - f_ji[0], f_ji[1], f_ji[2] - ); - printf("neighbour_index_mapping[jj=%d]=%d\n",jj,neighbour_index_mapping[jj]); -#endif - - neighbours_forces(neighbour_index_mapping[jj], 0) = f_ji[0]; - neighbours_forces(neighbour_index_mapping[jj], 1) = f_ji[1]; - neighbours_forces(neighbour_index_mapping[jj], 2) = f_ji[2]; - - forces_calc_neighbour_timer.stop(); - }// end loop over neighbour atoms for forces - - forces_calc_loop_timer.stop(); - - //now, energies and forces are ready - //energies(i) = evdwl + rho_core; - e_atom = evdwl_cut; - -#ifdef PRINT_INTERMEDIATE_VALUES - printf("energies(i) = FS(...rho_p_accum...) = %f\n", evdwl); -#endif - per_atom_calc_timer.stop(); -} \ No newline at end of file diff --git a/lib/pace/ace_recursive.h b/lib/pace/ace_recursive.h deleted file mode 100644 index 78e74feb86..0000000000 --- a/lib/pace/ace_recursive.h +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Christoph Ortner on 20.12.2020 - -#ifndef ACE_RECURSIVE_H -#define ACE_RECURSIVE_H - -#include "ace_abstract_basis.h" -#include "ace_arraynd.h" -#include "ace_array2dlm.h" -#include "ace_c_basis.h" -#include "ace_complex.h" -#include "ace_timing.h" -#include "ace_types.h" -#include "ace_evaluator.h" - -#include -#include -#include -#include -#include - -using namespace std; - - -typedef pair, vector > TPARTITION; -typedef list TPARTITIONS; - -typedef map, int> TDAGMAP; - -class ACEDAG { - - TPARTITIONS find_2partitions(vector v); - - void insert_node(TDAGMAP &dagmap, - vector node, - vector c); - - // the following fields are used only for *construction*, not evaluation - int dag_idx; // current index of dag node - Array2D nodes_pre; //TODO: YL: better to use vector<> - Array2D coeffs_pre; //TODO: YL: better to use vector<> - Array1D haschild; //TODO: YL: better to use vector<> - - /* which heuristic to choose for DAG construction? - * 0 : the simple original heuristic - * 1 : prioritize 2-correlation nodes and build the rest from those - */ - int heuristic = 0; - -public: - - ACEDAG() = default; - - void init(Array2D Aspec, Array2D AAspec, - Array1D orders, Array2D coeffs, - int heuristic ); - - Array1D AAbuf; - Array1D w; - - Array2D Aspec; - - // nodes in the graph - Array2D nodes; - Array2D coeffs; - - // total number of nodes in the dag - int num_nodes; - // number of interior nodes (with children) - int num2_int; - // number of leaf nodes (nc = no child) - int num2_leaf; - - - // number of 1-particle basis functions - // (these will be stored in the first num1 entries of AAbuf) - int get_num1() { return Aspec.get_dim(0); }; - // total number of n-correlation basis functions n > 1. - int get_num2() { return num_nodes - get_num1(); }; - int get_num2_int() { return num2_int; }; // with children - int get_num2_leaf() { return num2_leaf; }; // without children - - // debugging tool - void print(); -}; - - -/** - * Recursive Variant of the ACETildeEvaluator; should be 100% compatible - */ -class ACERecursiveEvaluator : public ACEEvaluator { - - /** - * Weights \f$ \omega_{i \mu n 0 0} \f$ for rank = 1, see Eq.(10) from implementation notes, - * 'i' is fixed for the current atom, shape: [nelements][nradbase] - */ - Array2D weights_rank1 = Array2D("weights_rank1"); - - /** - * Weights \f$ \omega_{i \mu n l m} \f$ for rank > 1, see Eq.(10) from implementation notes, - * 'i' is fixed for the current atom, shape: [nelements][nradbase][l=0..lmax, m] - */ - Array4DLM weights = Array4DLM("weights"); - - /** - * cache for gradients of \f$ g(r)\f$: grad_phi(jj,n)=A2DLM(l,m) - * shape:[max_jnum][nradbase] - */ - Array2D DG_cache = Array2D("DG_cache"); - - - /** - * cache for \f$ R_{nl}(r)\f$ - * shape:[max_jnum][nradbase][0..lmax] - */ - Array3D R_cache = Array3D("R_cache"); - /** - * cache for derivatives of \f$ R_{nl}(r)\f$ - * shape:[max_jnum][nradbase][0..lmax] - */ - Array3D DR_cache = Array3D("DR_cache"); - /** - * cache for \f$ Y_{lm}(\hat{r})\f$ - * shape:[max_jnum][0..lmax][m] - */ - Array3DLM Y_cache = Array3DLM("Y_cache"); - /** - * cache for \f$ \nabla Y_{lm}(\hat{r})\f$ - * shape:[max_jnum][0..lmax][m] - */ - Array3DLM DY_cache = Array3DLM("dY_dense_cache"); - - /** - * cache for derivatives of hard-core repulsion - * shape:[max_jnum] - */ - Array1D DCR_cache = Array1D("DCR_cache"); - - /** - * Partial derivatives \f$ dB_{i \mu n l m t}^{(r)} \f$ with sequential numbering over [func_ind][ms_ind][r], - * shape:[func_ms_r_ind] - */ - Array1D dB_flatten = Array1D("dB_flatten"); - - /** - * pointer to the ACEBasisSet object - */ - ACECTildeBasisSet *basis_set = nullptr; - - /** - * Initialize internal arrays according to basis set sizes - * @param basis_set - */ - void init(ACECTildeBasisSet *basis_set, int heuristic); - - /* convert the PACE to the ACE.jl format to prepare for DAG construction*/ - Array2D jl_Aspec; - Array2D jl_AAspec; - Array1D jl_AAspec_flat; - Array1D jl_orders; - Array2D jl_coeffs; - void acejlformat(); - - /* the main event : the computational graph */ - ACEDAG dag; - - bool recursive = true; - -public: - - - ACERecursiveEvaluator() = default; - - explicit ACERecursiveEvaluator(ACECTildeBasisSet &bas, - bool recursive = true) { - set_recursive(recursive); - set_basis(bas); - } - - /** - * set the basis function to the ACE evaluator - * @param bas - */ - void set_basis(ACECTildeBasisSet &bas, int heuristic = 0); - - /** - * The key method to compute energy and forces for atom 'i'. - * Method will update the "e_atom" variable and "neighbours_forces(jj, alpha)" array - * - * @param i atom index - * @param x atomic positions array of the real and ghost atoms, shape: [atom_ind][3] - * @param type atomic types array of the real and ghost atoms, shape: [atom_ind] - * @param jnum number of neighbours of atom_i - * @param jlist array of neighbour indices, shape: [jnum] - */ - void compute_atom(int i, DOUBLE_TYPE **x, const SPECIES_TYPE *type, const int jnum, const int *jlist) override; - - /** - * Resize all caches over neighbours atoms - * @param max_jnum maximum number of neighbours - */ - void resize_neighbours_cache(int max_jnum) override; - - /******* public functions related to recursive evaluator ********/ - - // print out the DAG for visual inspection - void print_dag() {dag.print();} - - // print out the jl format for visual inspection - // should be converted into a proper test - void test_acejlformat(); - - void set_recursive(bool tf) { recursive = tf; } - - /********************************/ - -}; - - -#endif //ACE_RECURSIVE_H \ No newline at end of file diff --git a/lib/pace/ace_spherical_cart.cpp b/lib/pace/ace_spherical_cart.cpp deleted file mode 100644 index f1f0fccced..0000000000 --- a/lib/pace/ace_spherical_cart.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Ralf Drautz, Yury Lysogorskiy - -#include - -#include "ace_spherical_cart.h" - -ACECartesianSphericalHarmonics::ACECartesianSphericalHarmonics(LS_TYPE lm) { - init(lm); -} - -void ACECartesianSphericalHarmonics::init(LS_TYPE lm) { - lmax = lm; - - alm.init(lmax, "alm"); - blm.init(lmax, "blm"); - cl.init(lmax + 1); - dl.init(lmax + 1); - - plm.init(lmax, "plm"); - dplm.init(lmax, "dplm"); - - ylm.init(lmax, "ylm"); - dylm.init(lmax, "dylm"); - - pre_compute(); -} - -/** -Destructor for ACECartesianSphericalHarmonics. - -@param None - -@returns None -*/ -ACECartesianSphericalHarmonics::~ACECartesianSphericalHarmonics() {} - - -void ACECartesianSphericalHarmonics::pre_compute() { - - DOUBLE_TYPE a, b; - DOUBLE_TYPE lsq, ld, l1, l2; - DOUBLE_TYPE msq; - - for (LS_TYPE l = 1; l <= lmax; l++) { - lsq = l * l; - ld = 2 * l; - l1 = (4 * lsq - 1); - l2 = lsq - ld + 1; - for (MS_TYPE m = 0; m < l - 1; m++) { - msq = m * m; - a = sqrt((DOUBLE_TYPE(l1)) / (DOUBLE_TYPE(lsq - msq))); - b = -sqrt((DOUBLE_TYPE(l2 - msq)) / (DOUBLE_TYPE(4 * l2 - 1))); - alm(l, m) = a; - blm(l, m) = b; - } - } - - for (LS_TYPE l = 1; l <= lmax; l++) { - cl(l) = -sqrt(1.0 + 0.5 / (DOUBLE_TYPE(l))); - dl(l) = sqrt(DOUBLE_TYPE(2 * (l - 1) + 3)); - } -} - - -void ACECartesianSphericalHarmonics::compute_barplm(DOUBLE_TYPE rz, LS_TYPE lmaxi) { - - // requires -1 <= rz <= 1 , NO CHECKING IS PERFORMED !!!!!!!!! - // prefactors include 1/sqrt(2) factor compared to reference - DOUBLE_TYPE t; - - // l=0, m=0 - //plm(0, 0) = Y00/sq1o4pi; //= sq1o4pi; - plm(0, 0) = Y00; //= 1; - dplm(0, 0) = 0.0; - - if (lmaxi > 0) { - - // l=1, m=0 - plm(1, 0) = Y00 * sq3 * rz; - dplm(1, 0) = Y00 * sq3; - - // l=1, m=1 - plm(1, 1) = -sq3o2 * Y00; - dplm(1, 1) = 0.0; - - // loop l = 2, lmax - for (LS_TYPE l = 2; l <= lmaxi; l++) { - for (MS_TYPE m = 0; m < l - 1; m++) { - plm(l, m) = alm(l, m) * (rz * plm(l - 1, m) + blm(l, m) * plm(l - 2, m)); - dplm(l, m) = alm(l, m) * (plm(l - 1, m) + rz * dplm(l - 1, m) + blm(l, m) * dplm(l - 2, m)); - } - t = dl(l) * plm(l - 1, l - 1); - plm(l, l - 1) = t * rz; - dplm(l, l - 1) = t; - plm(l, l) = cl(l) * plm(l - 1, l - 1); - dplm(l, l) = 0.0; - } - } -} //end compute_barplm - - -void ACECartesianSphericalHarmonics::compute_ylm(DOUBLE_TYPE rx, DOUBLE_TYPE ry, DOUBLE_TYPE rz, LS_TYPE lmaxi) { - - // requires rx^2 + ry^2 + rz^2 = 1 , NO CHECKING IS PERFORMED !!!!!!!!! - - DOUBLE_TYPE real; - DOUBLE_TYPE img; - MS_TYPE m; - ACEComplex phase; - ACEComplex phasem, mphasem1; - ACEComplex dyx, dyy, dyz; - ACEComplex rdy; - - phase.real = rx; - phase.img = ry; - //compute barplm - compute_barplm(rz, lmaxi); - - //m = 0 - m = 0; - for (LS_TYPE l = 0; l <= lmaxi; l++) { - - ylm(l, m).real = plm(l, m); - ylm(l, m).img = 0.0; - - dyz.real = dplm(l, m); - rdy.real = dyz.real * rz; - - dylm(l, m).a[0].real = -rdy.real * rx; - dylm(l, m).a[0].img = 0.0; - dylm(l, m).a[1].real = -rdy.real * ry; - dylm(l, m).a[1].img = 0.0; - dylm(l, m).a[2].real = dyz.real - rdy.real * rz; - dylm(l, m).a[2].img = 0; - } - //m = 0 - m = 1; - for (LS_TYPE l = 1; l <= lmaxi; l++) { - - ylm(l, m) = phase * plm(l, m); - -// std::cout << "Re ylm(" << l << "," << m <<")= " << ylm(l, m).real << std::endl; -// std::cout << "Im ylm(" << l << "," << m <<")= " << ylm(l, m).img << std::endl; - - dyx.real = plm(l, m); - dyx.img = 0.0; - dyy.real = 0.0; - dyy.img = plm(l, m); - dyz.real = phase.real * dplm(l, m); - dyz.img = phase.img * dplm(l, m); - - rdy.real = rx * dyx.real + +rz * dyz.real; - rdy.img = ry * dyy.img + rz * dyz.img; - - dylm(l, m).a[0].real = dyx.real - rdy.real * rx; - dylm(l, m).a[0].img = -rdy.img * rx; - dylm(l, m).a[1].real = -rdy.real * ry; - dylm(l, m).a[1].img = dyy.img - rdy.img * ry; - dylm(l, m).a[2].real = dyz.real - rdy.real * rz; - dylm(l, m).a[2].img = dyz.img - rdy.img * rz; - } - - // m > 1 - phasem = phase; - for (MS_TYPE m = 2; m <= lmaxi; m++) { - - mphasem1.real = phasem.real * DOUBLE_TYPE(m); - mphasem1.img = phasem.img * DOUBLE_TYPE(m); - phasem = phasem * phase; - - for (LS_TYPE l = m; l <= lmaxi; l++) { - - ylm(l, m).real = phasem.real * plm(l, m); - ylm(l, m).img = phasem.img * plm(l, m); - - dyx = mphasem1 * plm(l, m); - dyy.real = -dyx.img; - dyy.img = dyx.real; - dyz = phasem * dplm(l, m); - - rdy.real = rx * dyx.real + ry * dyy.real + rz * dyz.real; - rdy.img = rx * dyx.img + ry * dyy.img + rz * dyz.img; - - dylm(l, m).a[0].real = dyx.real - rdy.real * rx; - dylm(l, m).a[0].img = dyx.img - rdy.img * rx; - dylm(l, m).a[1].real = dyy.real - rdy.real * ry; - dylm(l, m).a[1].img = dyy.img - rdy.img * ry; - dylm(l, m).a[2].real = dyz.real - rdy.real * rz; - dylm(l, m).a[2].img = dyz.img - rdy.img * rz; - } - } - -} - diff --git a/lib/pace/ace_spherical_cart.h b/lib/pace/ace_spherical_cart.h deleted file mode 100644 index b2a0cb5913..0000000000 --- a/lib/pace/ace_spherical_cart.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Ralf Drautz, Yury Lysogorskiy - -#ifndef ACE_SPHERICAL_CART_H -#define ACE_SPHERICAL_CART_H - -#include - -#include "ace_arraynd.h" -#include "ace_array2dlm.h" -#include "ace_complex.h" -#include "ace_types.h" - - -using namespace std; - -const DOUBLE_TYPE sq1o4pi = 0.28209479177387814347; // sqrt(1/(4*pi)) -const DOUBLE_TYPE sq4pi = 3.54490770181103176384; // sqrt(4*pi) -const DOUBLE_TYPE sq3 = 1.73205080756887719318;//sqrt(3), numpy -const DOUBLE_TYPE sq3o2 = 1.22474487139158894067;//sqrt(3/2), numpy - -//definition of common factor for spherical harmonics = Y00 -//const DOUBLE_TYPE Y00 = sq1o4pi; -const DOUBLE_TYPE Y00 = 1; - -/** -Class to store spherical harmonics and their associated functions. \n -All the associated members such as \f$ P_{lm}, Y_{lm}\f$ etc are one dimensional arrays of length (L+1)*(L+2)/2. \n -The value that corresponds to a particular l, m configuration can be accessed through a \code ylm(l,m) \endcode \n -*/ -class ACECartesianSphericalHarmonics { -public: - - /** - int, the number of spherical harmonics to be found - */ - LS_TYPE lmax; - - /** - * Default constructor - */ - ACECartesianSphericalHarmonics() = default; - - /** - * Parametrized constructor. Dynamically initialises all the arrays. - * @param lmax maximum orbital moment - */ - explicit ACECartesianSphericalHarmonics(LS_TYPE lmax); - - /** - * Initialize internal arrays and precompute necessary coefficients - * @param lm maximum orbital moment - */ - void init(LS_TYPE lm); - - /** - * Destructor - */ - ~ACECartesianSphericalHarmonics(); - - /** - * Precompute necessaary helper arrays Precomputes the value of \f$ a_{lm}, b_{lm}, c_l, d_l \f$ - */ - void pre_compute(); - - /** - Function that computes \f$ \bar{P}_{lm} \f$ for the corresponding lmax value - Input is \f$ \hat{r}_z \f$ which is the $z$-component of the bond direction. - - For each \f$ \hat{r}_z \f$, this computes the whole range of \f$ \bar{P}_{lm} \f$ values - and its derivatives upto the lmax specified, which is a member of the class. - - @param rz, DOUBLE_TYPE - - @returns None - */ - void compute_barplm(DOUBLE_TYPE rz, LS_TYPE lmaxi); - - /** - Function that computes \f$ Y_{lm} \f$ for the corresponding lmax value - Input is the bond-directon vector \f$ \hat{r}_x, \hat{r}_y, \hat{r}_z \f$ - - Each \f$ Y_{lm} \f$ value is a ACEComplex object with real and imaginary parts. This function also - finds the derivatives, which are stored in the Dycomponent class, with each component being a - ACEComplex object. - - @param rx, DOUBLE_TYPE - @param ry, DOUBLE_TYPE - @param rz, DOUBLE_TYPE - @param lmaxi, int - */ - void compute_ylm(DOUBLE_TYPE rx, DOUBLE_TYPE ry, DOUBLE_TYPE rz, LS_TYPE lmaxi); - - Array2DLM alm; - Array2DLM blm; - Array1D cl; - Array1D dl; - - Array2DLM plm; - Array2DLM dplm; - - Array2DLM ylm; ///< Values of all spherical harmonics after \code compute_ylm(rx,ry,rz, lmaxi) \endcode call - Array2DLM dylm;///< Values of gradients of all spherical harmonics after \code compute_ylm(rx,ry,rz, lmaxi) \endcode call - -}; - - -#endif diff --git a/lib/pace/ace_timing.h b/lib/pace/ace_timing.h deleted file mode 100644 index 7f5243eb99..0000000000 --- a/lib/pace/ace_timing.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Yury Lysogorskiy on 19.02.20. - -#ifndef ACE_TIMING_H -#define ACE_TIMING_H - -#include - -using namespace std::chrono; -using Clock = std::chrono::high_resolution_clock; -using TimePoint = std::chrono::time_point; -using Duration = Clock::duration; - -////////////////////////////////////////// -#ifdef FINE_TIMING -/** - * Helper class for timing the code. - * The timer should be initialized to reset measured time and - * then call "start" and "stop" before and after measured code. - * The measured time is stored in "duration" variable - */ -struct ACETimer { - Duration duration; ///< measured duration - TimePoint start_moment; ///< start moment of current measurement - - ACETimer() { init(); }; - - /** - * Reset timer - */ - void init() { duration = std::chrono::nanoseconds(0); } - - /** - * Start timer - */ - void start() { start_moment = Clock::now(); } - - /** - * Stop timer, update measured "duration" - */ - void stop() { duration += Clock::now() - start_moment; } - - /** - * Get duration in microseconds - */ - long as_microseconds() { return std::chrono::duration_cast(duration).count(); } - - /** - * Get duration in nanoseconds - */ - long as_nanoseconds() { return std::chrono::duration_cast(duration).count(); } - -}; - -#else // EMPTY Definitions -/** - * Helper class for timing the code. - * The timer should be initialized to reset measured time and - * then call "start" and "stop" before and after measured code. - * The measured time is stored in "duration" variable - */ -struct ACETimer { - Duration duration; ///< measured duration - TimePoint start_moment; ///< start moment of current measurement - - ACETimer() {}; - - /** - * Reset timer - */ - void init() {} - - /** - * Start timer - */ - void start() {} - - /** - * Stop timer, update measured "duration" - */ - void stop() {} - - /** - * Get duration in microseconds - */ - long as_microseconds() {return 0; } - - /** - * Get duration in nanoseconds - */ - long as_nanoseconds() {return 0; } - -}; - -#endif -////////////////////////////////////////// - - -#endif //ACE_TIMING_H diff --git a/lib/pace/ace_types.h b/lib/pace/ace_types.h deleted file mode 100644 index f9b3cf7267..0000000000 --- a/lib/pace/ace_types.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Yury Lysogorskiy on 20.01.20. - -#ifndef ACE_TYPES_H -#define ACE_TYPES_H - -typedef char RANK_TYPE; -typedef int SPECIES_TYPE; -typedef short int NS_TYPE; -typedef short int LS_TYPE; - -typedef short int DENSITY_TYPE; - -typedef short int MS_TYPE; - -typedef short int SHORT_INT_TYPE; -typedef double DOUBLE_TYPE; - -#endif \ No newline at end of file diff --git a/lib/pace/ace_version.h b/lib/pace/ace_version.h deleted file mode 100644 index 9d61e5c505..0000000000 --- a/lib/pace/ace_version.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Lysogorskiy Yury on 07.04.2020. - -#ifndef ACE_VERSION_H -#define ACE_VERSION_H - -#define VERSION_YEAR 2021 -#define VERSION_MONTH 2 -#define VERSION_DAY 3 - -#endif //ACE_VERSION_Hls - diff --git a/lib/pace/ships_radial.cpp b/lib/pace/ships_radial.cpp deleted file mode 100644 index e948f03f21..0000000000 --- a/lib/pace/ships_radial.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// Created by Christoph Ortner on 03.06.2020 - -#include "ships_radial.h" - -#include -#include -#include - - -using namespace std; - -void SHIPsRadPolyBasis::_init(DOUBLE_TYPE r0, int p, DOUBLE_TYPE rcut, - DOUBLE_TYPE xl, DOUBLE_TYPE xr, - int pl, int pr, size_t maxn) { - this->p = p; - this->r0 = r0; - this->rcut = rcut; - this->xl = xl; - this->xr = xr; - this->pl = pl; - this->pr = pr; - this->maxn = maxn; - this->A.resize(maxn); - this->B.resize(maxn); - this->C.resize(maxn); - this->P.resize(maxn); - this->dP_dr.resize(maxn); -} - - -void SHIPsRadPolyBasis::fread(FILE *fptr) -{ - int res; //for fscanf result - int maxn, p, pl, pr, ntests; - double r0, xl, xr, a, b, c, rcut; - - // transform parameters - res = fscanf(fptr, "transform parameters: p=%d r0=%lf\n", &p, &r0); - if (res != 2) - throw invalid_argument("Couldn't read line: transform parameters: p=%d r0=%lf"); - // cutoff parameters - res = fscanf(fptr, "cutoff parameters: rcut=%lf xl=%lf xr=%lf pl=%d pr=%d\n", - &rcut, &xl, &xr, &pl, &pr); - if (res != 5) - throw invalid_argument("Couldn't read cutoff parameters: rcut=%lf xl=%lf xr=%lf pl=%d pr=%d"); - // basis size - res = fscanf(fptr, "recursion coefficients: maxn = %d\n", &maxn); - if (res != 1) - throw invalid_argument("Couldn't read recursion coefficients: maxn = %d"); - // initialize and allocate - this->_init(r0, p, rcut, xl, xr, pl, pr, maxn); - - // read basis coefficients - for (int i = 0; i < maxn; i++) { - res = fscanf(fptr, " %lf %lf %lf\n", &a, &b, &c); - if (res != 3) - throw invalid_argument("Couldn't read line: A_n B_n C_n"); - this->A(i) = DOUBLE_TYPE(a); - this->B(i) = DOUBLE_TYPE(b); - this->C(i) = DOUBLE_TYPE(c); - } - - // // check there are no consistency tests (I don't have time to fix this now) - // res = fscanf(fptr, "tests: ntests = %d\n", &ntests); - // if (res != 1) - // throw invalid_argument("Couldn't read line: tests: ntests = %d"); - // if (ntests != 0) - // throw invalid_argument("must have ntests = 0!"); - - // --------------------------------------------------------------------- - // run the consistency test this could be moved into a separate function - double r, Pn, dPn; - double err = 0.0; - - res = fscanf(fptr, "tests: ntests = %d\n", &ntests); - if (res != 1) - throw invalid_argument("Couldn't read line: tests: ntests = %d"); - for (size_t itest = 0; itest < ntests; itest++) { - // read an r argument - res = fscanf(fptr, " r=%lf\n", &r); - // printf("r = %lf \n", r); - if (res != 1) - throw invalid_argument("Couldn't read line: r=%lf"); - // printf("test %d, r=%f, maxn=%d \n", itest, r, maxn); - // evaluate the basis - this->calcP(r, maxn, SPECIES_TYPE(0), SPECIES_TYPE(0)); - // compare against the stored values - for (size_t n = 0; n < maxn; n++) { - res = fscanf(fptr, " %lf %lf\n", &Pn, &dPn); - if (res != 2) - throw invalid_argument("Couldn't read test value line: %lf %lf"); - err = max(err, abs(Pn - this->P(n)) + abs(dPn - this->dP_dr(n))); - // printf(" %d %e %e \n", int(n), - // abs(Pn - this->P(n)), - // abs(dPn - this->dP_dr(n))); - } - } - if (ntests > 0) - printf("Maximum Test error = %e\n", err); - // --------------------------------------------------------------------- - -} - - - - -size_t SHIPsRadPolyBasis::get_maxn() -{ - return this->maxn; -} - - -// Julia code: ((1+r0)/(1+r))^p -void SHIPsRadPolyBasis::transform(const DOUBLE_TYPE r, DOUBLE_TYPE &x_out, DOUBLE_TYPE &dx_out) const { - x_out = pow((1 + r0) / (1 + r), p); // ==pow( (1 + r) / (1 + r0), -p ); - dx_out = -p * pow((1 + r) / (1 + r0), -p - 1) / (1 + r0); -} - -void SHIPsRadPolyBasis::fcut(const DOUBLE_TYPE x, DOUBLE_TYPE &f_out, DOUBLE_TYPE &df_out) const { - if ( ((x < xl) && (pl > 0)) || ((x > xr) && (pr > 0)) ) { - f_out = 0.0; - df_out = 0.0; - } else { - f_out = pow(x - xl, pl) * pow(x - xr, pr); - df_out = pl * pow(x - xl, pl - 1) * pow(x - xr, pr) + pow(x - xl, pl) * pr * pow(x - xr, pr - 1); - } -} - - /* ------------------------------------------------------------------------ -Julia Code -P[1] = J.A[1] * _fcut_(J.pl, J.tl, J.pr, J.tr, t) -if length(J) == 1; return P; end -P[2] = (J.A[2] * t + J.B[2]) * P[1] -@inbounds for n = 3:length(J) - P[n] = (J.A[n] * t + J.B[n]) * P[n-1] + J.C[n] * P[n-2] -end -return P ------------------------------------------------------------------------- */ - -void SHIPsRadPolyBasis::calcP(DOUBLE_TYPE r, size_t maxn, - SPECIES_TYPE z1, SPECIES_TYPE z2) { - if (maxn > this->maxn) - throw invalid_argument("Given maxn couldn't be larger than global maxn"); - - if (maxn > P.get_size()) - throw invalid_argument("Given maxn couldn't be larger than global length of P"); - - DOUBLE_TYPE x, dx_dr; // dx -> dx/dr - transform(r, x, dx_dr); - // printf("r = %f, x = %f, fcut = %f \n", r, x, fcut(x)); - DOUBLE_TYPE f, df_dx; - fcut(x, f, df_dx); // df -> df/dx - - //fill with zeros - P.fill(0); - dP_dr.fill(0); - - P(0) = A(0) * f; - dP_dr(0) = A(0) * df_dx * dx_dr; // dP/dr; chain rule: df_cut/dr = df_cut/dx * dx/dr - if (maxn > 0) { - P(1) = (A(1) * x + B(1)) * P(0); - dP_dr(1) = A(1) * dx_dr * P(0) + (A(1) * x + B(1)) * dP_dr(0); - } - for (size_t n = 2; n < maxn; n++) { - P(n) = (A(n) * x + B(n)) * P(n - 1) + C(n) * P(n - 2); - dP_dr(n) = A(n) * dx_dr * P(n - 1) + (A(n) * x + B(n)) * dP_dr(n - 1) + C(n) * dP_dr(n - 2); - } -} - - -// ==================================================================== - - -bool SHIPsRadialFunctions::has_pair() { - return this->haspair; -} - -void SHIPsRadialFunctions::load(string fname) { - FILE * fptr = fopen(fname.data(), "r"); - size_t res = fscanf(fptr, "radbasename=ACE.jl.Basic\n"); - if (res != 0) - throw("SHIPsRadialFunctions::load : couldnt read radbasename=ACE.jl.Basic"); - this->fread(fptr); - fclose(fptr); -} - -void SHIPsRadialFunctions::fread(FILE *fptr){ - int res; - size_t maxn; - char hasE0, haspair; - DOUBLE_TYPE c; - - // check whether we have a pair potential - res = fscanf(fptr, "haspair: %c\n", &haspair); - if (res != 1) - throw("SHIPsRadialFunctions::load : couldn't read haspair"); - - // read the radial basis - this->radbasis.fread(fptr); - - // read the pair potential - if (haspair == 't') { - this->haspair=true; - fscanf(fptr, "begin repulsive potential\n"); - fscanf(fptr, "begin polypairpot\n"); - // read the basis parameters - pairbasis.fread(fptr); - maxn = pairbasis.get_maxn(); - // read the coefficients - fscanf(fptr, "coefficients\n"); - paircoeffs.resize(maxn); - for (size_t n = 0; n < maxn; n++) { - fscanf(fptr, "%lf\n", &c); - paircoeffs(n) = c; - } - fscanf(fptr, "end polypairpot\n"); - // read the spline parameters - fscanf(fptr, "spline parameters\n"); - fscanf(fptr, " e_0 + B exp(-A*(r/ri-1)) * (ri/r)\n"); - fscanf(fptr, "ri=%lf\n", &(this->ri)); - fscanf(fptr, "e0=%lf\n", &(this->e0)); - fscanf(fptr, "A=%lf\n", &(this->A)); - fscanf(fptr, "B=%lf\n", &(this->B)); - fscanf(fptr, "end repulsive potential\n"); - } -} - - -size_t SHIPsRadialFunctions::get_maxn() -{ - return this->radbasis.get_maxn(); -} - -DOUBLE_TYPE SHIPsRadialFunctions::get_rcut() -{ - return max(radbasis.rcut, pairbasis.rcut); -} - - -void SHIPsRadialFunctions::fill_gk(DOUBLE_TYPE r, NS_TYPE maxn, SPECIES_TYPE z1, SPECIES_TYPE z2) { - radbasis.calcP(r, maxn, z1, z2); - for (NS_TYPE n = 0; n < maxn; n++) { - gr(n) = radbasis.P(n); - dgr(n) = radbasis.dP_dr(n); - } -} - - -void SHIPsRadialFunctions::fill_Rnl(DOUBLE_TYPE r, NS_TYPE maxn, SPECIES_TYPE z1, SPECIES_TYPE z2) { - radbasis.calcP(r, maxn, z1, z2); - for (NS_TYPE n = 0; n < maxn; n++) { - for (LS_TYPE l = 0; l <= lmax; l++) { - fr(n, l) = radbasis.P(n); - dfr(n, l) = radbasis.dP_dr(n); - } - } -} - - -void SHIPsRadialFunctions::setuplookupRadspline() { -} - - -void SHIPsRadialFunctions::init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, - SPECIES_TYPE nelements, - DOUBLE_TYPE cutoff, string radbasename) { - //mimic ACERadialFunctions::init - this->nradbase = nradb; - this->lmax = lmax; - this->nradial = nradial; - this->deltaSplineBins = deltaSplineBins; - this->nelements = nelements; - this->cutoff = cutoff; - this->radbasename = radbasename; - - gr.init(nradbase, "gr"); - dgr.init(nradbase, "dgr"); - - - fr.init(nradial, lmax + 1, "fr"); - dfr.init(nradial, lmax + 1, "dfr"); - - splines_gk.init(nelements, nelements, "splines_gk"); - splines_rnl.init(nelements, nelements, "splines_rnl"); - splines_hc.init(nelements, nelements, "splines_hc"); - - lambda.init(nelements, nelements, "lambda"); - lambda.fill(1.); - - cut.init(nelements, nelements, "cut"); - cut.fill(1.); - - dcut.init(nelements, nelements, "dcut"); - dcut.fill(1.); - - crad.init(nelements, nelements, (lmax + 1), nradial, nradbase, "crad"); - crad.fill(0.); - - //hard-core repulsion - prehc.init(nelements, nelements, "prehc"); - prehc.fill(0.); - - lambdahc.init(nelements, nelements, "lambdahc"); - lambdahc.fill(1.); -} - - -void SHIPsRadialFunctions::evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, - SPECIES_TYPE mu_j, bool calc_second_derivatives) { - if (calc_second_derivatives) - throw invalid_argument("SHIPsRadialFunctions has not `calc_second_derivatives` option"); - - radbasis.calcP(r, nradbase_c, mu_i, mu_j); - for (NS_TYPE nr = 0; nr < nradbase_c; nr++) { - gr(nr) = radbasis.P(nr); - dgr(nr) = radbasis.dP_dr(nr); - } - for (NS_TYPE nr = 0; nr < nradial_c; nr++) { - for (LS_TYPE l = 0; l <= this->lmax; l++) { - fr(nr, l) = radbasis.P(nr); - dfr(nr, l) = radbasis.dP_dr(nr); - } - } - - if (this->has_pair()) - this->evaluate_pair(r, mu_i, mu_j); - else { - cr = 0; - dcr = 0; - } -} - -void SHIPsRadialFunctions::evaluate_pair(DOUBLE_TYPE r, - SPECIES_TYPE mu_i, - SPECIES_TYPE mu_j, - bool calc_second_derivatives) { - // spline_hc.calcSplines(r); - // cr = spline_hc.values(0); - // dcr = spline_hc.derivatives(0); - - // the outer polynomial potential - if (r > ri) { - pairbasis.calcP(r, pairbasis.get_maxn(), mu_i, mu_j); - cr = 0; - dcr = 0; - for (size_t n = 0; n < pairbasis.get_maxn(); n++) { - cr += paircoeffs(n) * pairbasis.P(n); - dcr += paircoeffs(n) * pairbasis.dP_dr(n); - } - } - else { // the repulsive core part - cr = e0 + B * exp(-A * (r/ri - 1)) * (ri/r); - dcr = B * exp( - A * (r/ri-1) ) * ri * ( - A / ri / r - 1/(r*r) ); - } - // fix double-counting - cr *= 0.5; - dcr *= 0.5; -} - - - diff --git a/lib/pace/ships_radial.h b/lib/pace/ships_radial.h deleted file mode 100644 index 60a82448cd..0000000000 --- a/lib/pace/ships_radial.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Performant implementation of atomic cluster expansion and interface to LAMMPS - * - * Copyright 2021 (c) Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, - * Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, - * Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1 - * - * ^1: Ruhr-University Bochum, Bochum, Germany - * ^2: University of Cambridge, Cambridge, United Kingdom - * ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA - * ^4: University of British Columbia, Vancouver, BC, Canada - * - * - * See the LICENSE file. - * This FILENAME is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -// Created by Christoph Ortner on 03.06.2020 - -#ifndef SHIPs_RADIAL_FUNCTIONS_H -#define SHIPs_RADIAL_FUNCTIONS_H - -#include "ace_arraynd.h" -#include "ace_types.h" -#include "ace_radial.h" - -class SHIPsRadPolyBasis { - -public: - - // transform parameters - int p = 0; - DOUBLE_TYPE r0 = 0.0; - - // cutoff parameters - DOUBLE_TYPE rcut = 0.0; - DOUBLE_TYPE xl = 0.0; - DOUBLE_TYPE xr = 0.0; - int pl = 0; - int pr = 0; - - // basis size - size_t maxn = 0; - - // recursion parameters - Array1D A = Array1D("SHIPs radial basis: A"); - Array1D B = Array1D("SHIPs radial basis: B"); - Array1D C = Array1D("SHIPs radial basis: C"); - - // temporary storage for evaluating the basis - Array1D P = Array1D("SHIPs radial basis: P"); - Array1D dP_dr = Array1D("SHIPs radial basis: dP"); - -////////////////////////////////// - - SHIPsRadPolyBasis() = default; - - ~SHIPsRadPolyBasis() = default; - - // distance transform - void transform(const DOUBLE_TYPE r, DOUBLE_TYPE &x_out, DOUBLE_TYPE &dx_out) const; - - // cutoff function - void fcut(const DOUBLE_TYPE x, DOUBLE_TYPE &f_out, DOUBLE_TYPE &df_out) const; - - void fread(FILE *fptr); - - void _init(DOUBLE_TYPE r0, int p, DOUBLE_TYPE rcut, - DOUBLE_TYPE xl, DOUBLE_TYPE xr, - int pl, int pr, size_t maxn); - - void calcP(DOUBLE_TYPE r, size_t maxn, SPECIES_TYPE z1, SPECIES_TYPE z2); - - size_t get_maxn(); - -}; - - - - -class SHIPsRadialFunctions : public AbstractRadialBasis { -public: - - // radial basis - SHIPsRadPolyBasis radbasis; - - // pair potential basis - bool haspair = false; - SHIPsRadPolyBasis pairbasis; - - // pair potential coefficients - Array1D paircoeffs = Array1D("SHIPs pairpot coeffs: paircoeffs"); - - // spline parameters for repulsive core - DOUBLE_TYPE ri = 0.0; - DOUBLE_TYPE e0 = 0.0; - DOUBLE_TYPE A = 0.0; - DOUBLE_TYPE B = 0.0; - -////////////////////////////////// - - SHIPsRadialFunctions() = default; - - ~SHIPsRadialFunctions() override = default; - - - void fread(FILE *fptr); - - void load(string fname); - - size_t get_maxn(); - DOUBLE_TYPE get_rcut(); - - bool has_pair(); - - void init(NS_TYPE nradb, LS_TYPE lmax, NS_TYPE nradial, DOUBLE_TYPE deltaSplineBins, SPECIES_TYPE nelements, - DOUBLE_TYPE cutoff, - string radbasename) override; - - void - evaluate(DOUBLE_TYPE r, NS_TYPE nradbase_c, NS_TYPE nradial_c, SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, - bool calc_second_derivatives = false) override; - - void - evaluate_pair(DOUBLE_TYPE r, SPECIES_TYPE mu_i, SPECIES_TYPE mu_j, - bool calc_second_derivatives = false); - - void setuplookupRadspline() override; - - SHIPsRadialFunctions *clone() const override { - return new SHIPsRadialFunctions(*this); - }; - - /** - * Helper method, that populate `fr` and `dfr` 2D-arrays (n,l) with P(n), dP_dr for given coordinate r - * @param r - * @param maxn - * @param z1 - * @param z2 - */ - void fill_Rnl(DOUBLE_TYPE r, NS_TYPE maxn, SPECIES_TYPE z1, SPECIES_TYPE z2); - - void fill_gk(DOUBLE_TYPE r, NS_TYPE maxn, SPECIES_TYPE z1, SPECIES_TYPE z2); -}; - - -#endif diff --git a/src/USER-PACE/Install.sh b/src/USER-PACE/Install.sh index 4d87b0e3ed..c099ddd2c4 100644 --- a/src/USER-PACE/Install.sh +++ b/src/USER-PACE/Install.sh @@ -1,68 +1,64 @@ -# Install.sh file that integrates the settings from the lib folder into the conventional build process (make build?) +# Install/unInstall package files in LAMMPS +# mode = 0/1/2 for uninstall/install/update -# COPIED FROM src/KIM/Install.sh: +mode=$1 -# # Install/unInstall package files in LAMMPS -# # mode = 0/1/2 for uninstall/install/update +# enforce using portable C locale +LC_ALL=C +export LC_ALL -# mode=$1 +# arg1 = file, arg2 = file it depends on -# # enforce using portable C locale -# LC_ALL=C -# export LC_ALL +action () { + if (test $mode = 0) then + rm -f ../$1 + elif (! cmp -s $1 ../$1) then + if (test -z "$2" || test -e ../$2) then + cp $1 .. + if (test $mode = 2) then + echo " updating src/$1" + fi + fi + elif (test -n "$2") then + if (test ! -e ../$2) then + rm -f ../$1 + fi + fi +} -# # arg1 = file, arg2 = file it depends on +# all package files with no dependencies -# action () { -# if (test $mode = 0) then -# rm -f ../$1 -# elif (! cmp -s $1 ../$1) then -# if (test -z "$2" || test -e ../$2) then -# cp $1 .. -# if (test $mode = 2) then -# echo " updating src/$1" -# fi -# fi -# elif (test -n "$2") then -# if (test ! -e ../$2) then -# rm -f ../$1 -# fi -# fi -# } +for file in *.cpp *.h; do + test -f ${file} && action $file +done -# # all package files with no dependencies +# edit 2 Makefile.package files to include/exclude package info -# for file in *.cpp *.h; do -# test -f ${file} && action $file -# done +if (test $1 = 1) then -# # edit 2 Makefile.package files to include/exclude package info + if (test -e ../Makefile.package) then + sed -i -e 's/[^ \t]*pace[^ \t]* //' ../Makefile.package + sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(pace_SYSINC) |' ../Makefile.package + sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(pace_SYSLIB) |' ../Makefile.package + sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(pace_SYSPATH) |' ../Makefile.package + fi -# if (test $1 = 1) then + if (test -e ../Makefile.package.settings) then + sed -i -e '/^include.*pace.*$/d' ../Makefile.package.settings + # multiline form needed for BSD sed on Macs + sed -i -e '4 i \ +include ..\/..\/lib\/pace\/Makefile.lammps +' ../Makefile.package.settings + fi -# if (test -e ../Makefile.package) then -# sed -i -e 's/[^ \t]*kim[^ \t]* //' ../Makefile.package -# sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(kim_SYSINC) |' ../Makefile.package -# sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(kim_SYSLIB) |' ../Makefile.package -# sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(kim_SYSPATH) |' ../Makefile.package -# fi +elif (test $1 = 0) then -# if (test -e ../Makefile.package.settings) then -# sed -i -e '/^include.*kim.*$/d' ../Makefile.package.settings -# # multiline form needed for BSD sed on Macs -# sed -i -e '4 i \ -# include ..\/..\/lib\/kim\/Makefile.lammps -# ' ../Makefile.package.settings -# fi + if (test -e ../Makefile.package) then + sed -i -e 's/[^ \t]*pace[^ \t]* //' ../Makefile.package + fi -# elif (test $1 = 0) then + if (test -e ../Makefile.package.settings) then + sed -i -e '/^include.*pace.*$/d' ../Makefile.package.settings + fi -# if (test -e ../Makefile.package) then -# sed -i -e 's/[^ \t]*kim[^ \t]* //' ../Makefile.package -# fi - -# if (test -e ../Makefile.package.settings) then -# sed -i -e '/^include.*kim.*$/d' ../Makefile.package.settings -# fi - -# fi +fi From 0d1ccbe1b542fdcfb8259c23c501be756307798c Mon Sep 17 00:00:00 2001 From: Yury Lysogorskiy Date: Wed, 7 Apr 2021 12:43:28 +0200 Subject: [PATCH 03/23] Move A.Thomson's modifications on doc and examples in: - doc/src/.rst - examples/USER/pace - potentials --- doc/src/Commands_pair.rst | 1 + doc/src/Packages_details.rst | 37 + doc/src/pair_pace.rst | 114 + examples/USER/pace/Cu-PBE-core-rep.ace | 1 + examples/USER/pace/in.pace.product | 38 + examples/USER/pace/in.pace.recursive | 38 + .../pace/log.03Feb2021.pace.product.g++.1 | 108 + .../pace/log.03Feb2021.pace.product.g++.4 | 108 + .../pace/log.03Feb2021.pace.recursive.g++.1 | 108 + .../pace/log.03Feb2021.pace.recursive.g++.4 | 108 + potentials/Cu-PBE-core-rep.ace | 8980 +++++++++++++++++ 11 files changed, 9641 insertions(+) create mode 100644 doc/src/pair_pace.rst create mode 120000 examples/USER/pace/Cu-PBE-core-rep.ace create mode 100644 examples/USER/pace/in.pace.product create mode 100644 examples/USER/pace/in.pace.recursive create mode 100644 examples/USER/pace/log.03Feb2021.pace.product.g++.1 create mode 100644 examples/USER/pace/log.03Feb2021.pace.product.g++.4 create mode 100644 examples/USER/pace/log.03Feb2021.pace.recursive.g++.1 create mode 100644 examples/USER/pace/log.03Feb2021.pace.recursive.g++.4 create mode 100644 potentials/Cu-PBE-core-rep.ace diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index 080f3eff20..1d15b93edf 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -215,6 +215,7 @@ OPT. * :doc:`oxrna2/stk ` * :doc:`oxrna2/xstk ` * :doc:`oxrna2/coaxstk ` + * :doc:`pace ` * :doc:`peri/eps ` * :doc:`peri/lps (o) ` * :doc:`peri/pmb (o) ` diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index b662ae73c7..549ab3d8f0 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -90,6 +90,7 @@ page gives those details. * :ref:`USER-MOLFILE ` * :ref:`USER-NETCDF ` * :ref:`USER-OMP ` + * :ref:`USER-PACE ` * :ref:`USER-PHONON ` * :ref:`USER-PLUMED ` * :ref:`USER-PTM ` @@ -1349,6 +1350,42 @@ This package has :ref:`specific installation instructions ` on the ---------- +.. _PKG-USER-PACE: + +USER-PACE package +------------------- + +**Contents:** + +A pair style for the Atomic Cluster Expansion potential (ACE). +ACE is a methodology for deriving a highly accurate classical potential +fit to a large archive of quantum mechanical (DFT) data. The USER-PACE +package provides an efficient implementation for running simulations +with ACE potentials. + +**Authors:** + +This package was written by Yury Lysogorskiy^1, +Cas van der Oord^2, Anton Bochkarev^1, +Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, +Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1. + + ^1: Ruhr-University Bochum, Bochum, Germany + + ^2: University of Cambridge, Cambridge, United Kingdom + + ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA + + ^4: University of British Columbia, Vancouver, BC, Canada + +**Supporting info:** + +* src/USER-PACE: filenames -> commands +* :doc:`pair_style pace ` +* examples/USER/pace + +---------- + .. _PKG-USER-PLUMED: USER-PLUMED package diff --git a/doc/src/pair_pace.rst b/doc/src/pair_pace.rst new file mode 100644 index 0000000000..1ebf6210cd --- /dev/null +++ b/doc/src/pair_pace.rst @@ -0,0 +1,114 @@ +.. index:: pair_style pace + +pair_style pace command +======================== + +Syntax +"""""" + +.. code-block:: LAMMPS + + pair_style pace ... keyword values ... + +* an optional keyword may be appended +* keyword = *product* or *recursive* + + .. parsed-literal:: + + *product* = use product algorithm for basis functions + *recursive* = use recursive algorithm for basis functions + +Examples +"""""""" + +.. code-block:: LAMMPS + + pair_style pace + pair_style pace product + pair_coeff * * Cu-PBE-core-rep.ace Cu + +Description +""""""""""" + +Pair style *pace* computes interactions using the Atomic Cluster +Expansion (ACE), which is a general expansion of the atomic energy in +multi-body basis functions. :ref:`(Drautz) `. +The *pace* pair style +provides an efficient implementation that +is described in this paper :ref:`(Lysogorskiy) `. + +In ACE, the total energy is decomposed into a sum over +atomic energies. The energy of atom *i* is expressed as a +linear or non-linear function of one or more density functions. +By projecting the +density onto a local atomic base, the lowest order contributions +to the energy can be expressed as a set of scalar polynomials in +basis function contributions summed over neighbor atoms. + +Only a single pair_coeff command is used with the *pace* style which +specifies an ACE coefficient file followed by N additional arguments +specifying the mapping of ACE elements to LAMMPS atom types, +where N is the number of LAMMPS atom types: + +* ACE coefficient file +* N element names = mapping of ACE elements to atom types + +Only a single pair_coeff command is used with the *pace* style which +specifies an ACE file that fully defines the potential. +Note that unlike for other potentials, cutoffs are +not set in the pair_style or pair_coeff command; they are specified in +the ACE file. + +The pair_style *mliap* may be followed by an optional keyword +*product* or *recursive*, which determines which of two algorithms + is used for the calculation of basis functions and derivatives. +The default is *recursive*. + +See the :doc:`pair_coeff ` doc page for alternate ways +to specify the path for the ACE coefficient file. + +Mixing, shift, table, tail correction, restart, rRESPA info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +For atom type pairs I,J and I != J, where types I and J correspond to +two different element types, mixing is performed by LAMMPS with +user-specifiable parameters as described above. You never need to +specify a pair_coeff command with I != J arguments for this style. + +This pair style does not support the :doc:`pair_modify ` +shift, table, and tail options. + +This pair style does not write its information to :doc:`binary restart files `, since it is stored in potential files. Thus, you +need to re-specify the pair_style and pair_coeff commands in an input +script that reads a restart file. + +This pair style can only be used via the *pair* keyword of the +:doc:`run_style respa ` command. It does not support the +*inner*\ , *middle*\ , *outer* keywords. + +---------- + +Restrictions +"""""""""""" + +This pair style is part of the USER-PACE package. It is only enabled if LAMMPS +was built with that package. +See the :doc:`Build package ` doc page for more info. + +Related commands +"""""""""""""""" + +:doc:`pair_style snap ` + +Default +""""""" + +recursive + +.. _Drautz20191: + +**(Drautz)** Drautz, Phys Rev B, 99, 014104 (2019). + +.. _Lysogorskiy20211: + +**(Lysogorskiy)** Lysogorskiy, van der Oord, Bochkarev, Menon, Rinaldi, Hammerschmidt, Mrovec, Thompson, Csanyi, Ortner, Drautz, TBD (2021). diff --git a/examples/USER/pace/Cu-PBE-core-rep.ace b/examples/USER/pace/Cu-PBE-core-rep.ace new file mode 120000 index 0000000000..4414592f78 --- /dev/null +++ b/examples/USER/pace/Cu-PBE-core-rep.ace @@ -0,0 +1 @@ +../../../potentials/Cu-PBE-core-rep.ace \ No newline at end of file diff --git a/examples/USER/pace/in.pace.product b/examples/USER/pace/in.pace.product new file mode 100644 index 0000000000..d70bb0f67c --- /dev/null +++ b/examples/USER/pace/in.pace.product @@ -0,0 +1,38 @@ +# simple test of fcc Cu with ACE product + +units metal +atom_style atomic + +neighbor 0.3 bin +neigh_modify every 2 delay 10 check yes + +variable a equal 3.597 +lattice fcc $a +region box block 0 4 0 4 0 4 +create_box 1 box +create_atoms 1 box + +mass 1 26.98 + +group Al type 1 + +pair_style pace product +pair_coeff * * Cu-PBE-core-rep.ace Cu + +velocity all create 300 8728 loop geom +timestep 0.0005 +fix 1 all nve + +compute eatom all pe/atom +compute energy all reduce sum c_eatom +variable delenergy equal c_energy-pe + +compute satom all stress/atom NULL +compute str all reduce sum c_satom[1] c_satom[2] c_satom[3] +variable delpress equal -(c_str[1]+c_str[2]+c_str[3])/(3*vol)-press + +thermo 10 +thermo_style custom step temp epair etotal press v_delenergy v_delpress + +run 100 + diff --git a/examples/USER/pace/in.pace.recursive b/examples/USER/pace/in.pace.recursive new file mode 100644 index 0000000000..dd655eb18d --- /dev/null +++ b/examples/USER/pace/in.pace.recursive @@ -0,0 +1,38 @@ +# simple test of fcc Cu with ACE recursive + +units metal +atom_style atomic + +neighbor 0.3 bin +neigh_modify every 2 delay 10 check yes + +variable a equal 3.597 +lattice fcc $a +region box block 0 4 0 4 0 4 +create_box 1 box +create_atoms 1 box + +mass 1 26.98 + +group Al type 1 + +pair_style pace recursive +pair_coeff * * Cu-PBE-core-rep.ace Cu + +velocity all create 300 8728 loop geom +timestep 0.0005 +fix 1 all nve + +compute eatom all pe/atom +compute energy all reduce sum c_eatom +variable delenergy equal c_energy-pe + +compute satom all stress/atom NULL +compute str all reduce sum c_satom[1] c_satom[2] c_satom[3] +variable delpress equal -(c_str[1]+c_str[2]+c_str[3])/(3*vol)-press + +thermo 10 +thermo_style custom step temp epair etotal press v_delenergy v_delpress + +run 100 + diff --git a/examples/USER/pace/log.03Feb2021.pace.product.g++.1 b/examples/USER/pace/log.03Feb2021.pace.product.g++.1 new file mode 100644 index 0000000000..01ba9c25a4 --- /dev/null +++ b/examples/USER/pace/log.03Feb2021.pace.product.g++.1 @@ -0,0 +1,108 @@ +LAMMPS (24 Dec 2020) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) + using 1 OpenMP thread(s) per MPI task +# simple test of fcc Cu with ACE product + +units metal +atom_style atomic + +neighbor 0.3 bin +neigh_modify every 2 delay 10 check yes + +variable a equal 3.597 +lattice fcc $a +lattice fcc 3.597 +Lattice spacing in x,y,z = 3.5970000 3.5970000 3.5970000 +region box block 0 4 0 4 0 4 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (14.388000 14.388000 14.388000) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 256 atoms + create_atoms CPU = 0.000 seconds + +mass 1 26.98 + +group Al type 1 +256 atoms in group Al + +pair_style pace product +ACE version: 2021.2.3 +Product evaluator is used +pair_coeff * * Cu-PBE-core-rep.ace Cu +Loading Cu-PBE-core-rep.ace +Total number of basis functions + Cu: 16 (r=1) 726 (r>1) +Mapping LAMMPS atom type #1(Cu) -> ACE species type #0 + +velocity all create 300 8728 loop geom +timestep 0.0005 +fix 1 all nve + +compute eatom all pe/atom +compute energy all reduce sum c_eatom +variable delenergy equal c_energy-pe + +compute satom all stress/atom NULL +compute str all reduce sum c_satom[1] c_satom[2] c_satom[3] +variable delpress equal -(c_str[1]+c_str[2]+c_str[3])/(3*vol)-press + +thermo 10 +thermo_style custom step temp epair etotal press v_delenergy v_delpress + +run 100 +Neighbor list info ... + update every 2 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7.7 + ghost atom cutoff = 7.7 + binsize = 3.85, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair pace, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 4.036 | 4.036 | 4.036 Mbytes +Step Temp E_pair TotEng Press v_delenergy v_delpress + 0 300 -945.9873 -936.0989 45359.818 0 2.1827873e-11 + 10 280.68558 -945.35055 -936.09878 46326.919 0 2.910383e-11 + 20 228.73618 -943.63789 -936.09844 48903.598 0 -2.910383e-11 + 30 160.53661 -941.38948 -936.09798 52222.083 0 -2.910383e-11 + 40 97.732944 -939.31899 -936.09758 55176.875 0 2.1827873e-11 + 50 59.165961 -938.04759 -936.0974 56850.103 0 2.910383e-11 + 60 53.124678 -937.84857 -936.09751 56878.948 0 0 + 70 74.623347 -938.5575 -936.09782 55565.237 0 4.3655746e-11 + 80 109.4762 -939.70663 -936.09815 53665.652 0 2.910383e-11 + 90 142.02657 -940.77975 -936.09837 52001.1 0 0 + 100 161.73598 -941.42945 -936.09842 51114.997 0 1.4551915e-11 +Loop time of 11.4718 on 1 procs for 100 steps with 256 atoms + +Performance: 0.377 ns/day, 63.732 hours/ns, 8.717 timesteps/s +99.3% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 11.468 | 11.468 | 11.468 | 0.0 | 99.96 +Neigh | 0.001181 | 0.001181 | 0.001181 | 0.0 | 0.01 +Comm | 0.001207 | 0.001207 | 0.001207 | 0.0 | 0.01 +Output | 0.000876 | 0.000876 | 0.000876 | 0.0 | 0.01 +Modify | 0.000455 | 0.000455 | 0.000455 | 0.0 | 0.00 +Other | | 0.000397 | | | 0.00 + +Nlocal: 256.000 ave 256 max 256 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 2201.00 ave 2201 max 2201 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 43118.0 ave 43118 max 43118 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 43118 +Ave neighs/atom = 168.42969 +Neighbor list builds = 1 +Dangerous builds = 0 + +Total wall time: 0:00:11 diff --git a/examples/USER/pace/log.03Feb2021.pace.product.g++.4 b/examples/USER/pace/log.03Feb2021.pace.product.g++.4 new file mode 100644 index 0000000000..052becb7d6 --- /dev/null +++ b/examples/USER/pace/log.03Feb2021.pace.product.g++.4 @@ -0,0 +1,108 @@ +LAMMPS (24 Dec 2020) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) + using 1 OpenMP thread(s) per MPI task +# simple test of fcc Cu with ACE product + +units metal +atom_style atomic + +neighbor 0.3 bin +neigh_modify every 2 delay 10 check yes + +variable a equal 3.597 +lattice fcc $a +lattice fcc 3.597 +Lattice spacing in x,y,z = 3.5970000 3.5970000 3.5970000 +region box block 0 4 0 4 0 4 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (14.388000 14.388000 14.388000) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 256 atoms + create_atoms CPU = 0.000 seconds + +mass 1 26.98 + +group Al type 1 +256 atoms in group Al + +pair_style pace product +ACE version: 2021.2.3 +Product evaluator is used +pair_coeff * * Cu-PBE-core-rep.ace Cu +Loading Cu-PBE-core-rep.ace +Total number of basis functions + Cu: 16 (r=1) 726 (r>1) +Mapping LAMMPS atom type #1(Cu) -> ACE species type #0 + +velocity all create 300 8728 loop geom +timestep 0.0005 +fix 1 all nve + +compute eatom all pe/atom +compute energy all reduce sum c_eatom +variable delenergy equal c_energy-pe + +compute satom all stress/atom NULL +compute str all reduce sum c_satom[1] c_satom[2] c_satom[3] +variable delpress equal -(c_str[1]+c_str[2]+c_str[3])/(3*vol)-press + +thermo 10 +thermo_style custom step temp epair etotal press v_delenergy v_delpress + +run 100 +Neighbor list info ... + update every 2 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7.7 + ghost atom cutoff = 7.7 + binsize = 3.85, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair pace, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 4.005 | 4.005 | 4.005 Mbytes +Step Temp E_pair TotEng Press v_delenergy v_delpress + 0 300 -945.9873 -936.0989 45359.818 0 -1.4551915e-11 + 10 280.68558 -945.35055 -936.09878 46326.919 0 2.910383e-11 + 20 228.73618 -943.63789 -936.09844 48903.598 0 0 + 30 160.53661 -941.38948 -936.09798 52222.083 0 -2.910383e-11 + 40 97.732944 -939.31899 -936.09758 55176.875 0 2.1827873e-11 + 50 59.165961 -938.04759 -936.0974 56850.103 0 -1.4551915e-11 + 60 53.124678 -937.84857 -936.09751 56878.948 0 7.2759576e-12 + 70 74.623347 -938.5575 -936.09782 55565.237 0 0 + 80 109.4762 -939.70663 -936.09815 53665.652 0 2.1827873e-11 + 90 142.02657 -940.77975 -936.09837 52001.1 0 -1.4551915e-11 + 100 161.73598 -941.42945 -936.09842 51114.997 0 1.4551915e-11 +Loop time of 3.54317 on 4 procs for 100 steps with 256 atoms + +Performance: 1.219 ns/day, 19.684 hours/ns, 28.223 timesteps/s +98.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 3.1375 | 3.3058 | 3.469 | 6.5 | 93.30 +Neigh | 0.000284 | 0.00031975 | 0.000352 | 0.0 | 0.01 +Comm | 0.071607 | 0.23492 | 0.40336 | 24.6 | 6.63 +Output | 0.001189 | 0.0012315 | 0.001347 | 0.2 | 0.03 +Modify | 0.000311 | 0.00032725 | 0.000351 | 0.0 | 0.01 +Other | | 0.0005298 | | | 0.01 + +Nlocal: 64.0000 ave 71 max 57 min +Histogram: 1 0 0 0 1 1 0 0 0 1 +Nghost: 1373.00 ave 1380 max 1366 min +Histogram: 1 0 0 0 1 1 0 0 0 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 10779.5 ave 11978 max 9604 min +Histogram: 1 0 0 0 1 1 0 0 0 1 + +Total # of neighbors = 43118 +Ave neighs/atom = 168.42969 +Neighbor list builds = 1 +Dangerous builds = 0 + +Total wall time: 0:00:03 diff --git a/examples/USER/pace/log.03Feb2021.pace.recursive.g++.1 b/examples/USER/pace/log.03Feb2021.pace.recursive.g++.1 new file mode 100644 index 0000000000..e6de3bd5c6 --- /dev/null +++ b/examples/USER/pace/log.03Feb2021.pace.recursive.g++.1 @@ -0,0 +1,108 @@ +LAMMPS (24 Dec 2020) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) + using 1 OpenMP thread(s) per MPI task +# simple test of fcc Cu with ACE recursive + +units metal +atom_style atomic + +neighbor 0.3 bin +neigh_modify every 2 delay 10 check yes + +variable a equal 3.597 +lattice fcc $a +lattice fcc 3.597 +Lattice spacing in x,y,z = 3.5970000 3.5970000 3.5970000 +region box block 0 4 0 4 0 4 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (14.388000 14.388000 14.388000) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 256 atoms + create_atoms CPU = 0.000 seconds + +mass 1 26.98 + +group Al type 1 +256 atoms in group Al + +pair_style pace recursive +ACE version: 2021.2.3 +Recursive evaluator is used +pair_coeff * * Cu-PBE-core-rep.ace Cu +Loading Cu-PBE-core-rep.ace +Total number of basis functions + Cu: 16 (r=1) 726 (r>1) +Mapping LAMMPS atom type #1(Cu) -> ACE species type #0 + +velocity all create 300 8728 loop geom +timestep 0.0005 +fix 1 all nve + +compute eatom all pe/atom +compute energy all reduce sum c_eatom +variable delenergy equal c_energy-pe + +compute satom all stress/atom NULL +compute str all reduce sum c_satom[1] c_satom[2] c_satom[3] +variable delpress equal -(c_str[1]+c_str[2]+c_str[3])/(3*vol)-press + +thermo 10 +thermo_style custom step temp epair etotal press v_delenergy v_delpress + +run 100 +Neighbor list info ... + update every 2 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7.7 + ghost atom cutoff = 7.7 + binsize = 3.85, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair pace, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 4.036 | 4.036 | 4.036 Mbytes +Step Temp E_pair TotEng Press v_delenergy v_delpress + 0 300 -945.9873 -936.0989 45359.818 0 0 + 10 280.68558 -945.35055 -936.09878 46326.919 0 5.8207661e-11 + 20 228.73618 -943.63789 -936.09844 48903.598 0 1.4551915e-11 + 30 160.53661 -941.38948 -936.09798 52222.083 0 7.2759576e-11 + 40 97.732944 -939.31899 -936.09758 55176.875 0 -5.8207661e-11 + 50 59.165961 -938.04759 -936.0974 56850.103 0 0 + 60 53.124678 -937.84857 -936.09751 56878.948 0 8.7311491e-11 + 70 74.623347 -938.5575 -936.09782 55565.237 0 -1.4551915e-11 + 80 109.4762 -939.70663 -936.09815 53665.652 0 2.1827873e-11 + 90 142.02657 -940.77975 -936.09837 52001.1 0 2.910383e-11 + 100 161.73598 -941.42945 -936.09842 51114.997 0 0 +Loop time of 9.31437 on 1 procs for 100 steps with 256 atoms + +Performance: 0.464 ns/day, 51.746 hours/ns, 10.736 timesteps/s +99.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 9.3103 | 9.3103 | 9.3103 | 0.0 | 99.96 +Neigh | 0.001214 | 0.001214 | 0.001214 | 0.0 | 0.01 +Comm | 0.001176 | 0.001176 | 0.001176 | 0.0 | 0.01 +Output | 0.000827 | 0.000827 | 0.000827 | 0.0 | 0.01 +Modify | 0.000479 | 0.000479 | 0.000479 | 0.0 | 0.01 +Other | | 0.000363 | | | 0.00 + +Nlocal: 256.000 ave 256 max 256 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 2201.00 ave 2201 max 2201 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 43118.0 ave 43118 max 43118 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 43118 +Ave neighs/atom = 168.42969 +Neighbor list builds = 1 +Dangerous builds = 0 + +Total wall time: 0:00:09 diff --git a/examples/USER/pace/log.03Feb2021.pace.recursive.g++.4 b/examples/USER/pace/log.03Feb2021.pace.recursive.g++.4 new file mode 100644 index 0000000000..b816f8e570 --- /dev/null +++ b/examples/USER/pace/log.03Feb2021.pace.recursive.g++.4 @@ -0,0 +1,108 @@ +LAMMPS (24 Dec 2020) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:94) + using 1 OpenMP thread(s) per MPI task +# simple test of fcc Cu with ACE recursive + +units metal +atom_style atomic + +neighbor 0.3 bin +neigh_modify every 2 delay 10 check yes + +variable a equal 3.597 +lattice fcc $a +lattice fcc 3.597 +Lattice spacing in x,y,z = 3.5970000 3.5970000 3.5970000 +region box block 0 4 0 4 0 4 +create_box 1 box +Created orthogonal box = (0.0000000 0.0000000 0.0000000) to (14.388000 14.388000 14.388000) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 256 atoms + create_atoms CPU = 0.000 seconds + +mass 1 26.98 + +group Al type 1 +256 atoms in group Al + +pair_style pace recursive +ACE version: 2021.2.3 +Recursive evaluator is used +pair_coeff * * Cu-PBE-core-rep.ace Cu +Loading Cu-PBE-core-rep.ace +Total number of basis functions + Cu: 16 (r=1) 726 (r>1) +Mapping LAMMPS atom type #1(Cu) -> ACE species type #0 + +velocity all create 300 8728 loop geom +timestep 0.0005 +fix 1 all nve + +compute eatom all pe/atom +compute energy all reduce sum c_eatom +variable delenergy equal c_energy-pe + +compute satom all stress/atom NULL +compute str all reduce sum c_satom[1] c_satom[2] c_satom[3] +variable delpress equal -(c_str[1]+c_str[2]+c_str[3])/(3*vol)-press + +thermo 10 +thermo_style custom step temp epair etotal press v_delenergy v_delpress + +run 100 +Neighbor list info ... + update every 2 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 7.7 + ghost atom cutoff = 7.7 + binsize = 3.85, bins = 4 4 4 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair pace, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 4.005 | 4.005 | 4.005 Mbytes +Step Temp E_pair TotEng Press v_delenergy v_delpress + 0 300 -945.9873 -936.0989 45359.818 0 -5.0931703e-11 + 10 280.68558 -945.35055 -936.09878 46326.919 0 1.4551915e-11 + 20 228.73618 -943.63789 -936.09844 48903.598 0 0 + 30 160.53661 -941.38948 -936.09798 52222.083 0 -2.910383e-11 + 40 97.732944 -939.31899 -936.09758 55176.875 0 0 + 50 59.165961 -938.04759 -936.0974 56850.103 0 -2.910383e-11 + 60 53.124678 -937.84857 -936.09751 56878.948 0 1.4551915e-11 + 70 74.623347 -938.5575 -936.09782 55565.237 0 3.6379788e-11 + 80 109.4762 -939.70663 -936.09815 53665.652 0 -7.2759576e-12 + 90 142.02657 -940.77975 -936.09837 52001.1 0 -2.910383e-11 + 100 161.73598 -941.42945 -936.09842 51114.997 0 7.2759576e-12 +Loop time of 2.91339 on 4 procs for 100 steps with 256 atoms + +Performance: 1.483 ns/day, 16.185 hours/ns, 34.324 timesteps/s +98.9% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.5753 | 2.723 | 2.8656 | 6.3 | 93.46 +Neigh | 0.000308 | 0.000365 | 0.00046 | 0.0 | 0.01 +Comm | 0.045106 | 0.18792 | 0.33552 | 24.1 | 6.45 +Output | 0.001213 | 0.001259 | 0.001388 | 0.2 | 0.04 +Modify | 0.000304 | 0.00033 | 0.00037 | 0.0 | 0.01 +Other | | 0.0005595 | | | 0.02 + +Nlocal: 64.0000 ave 71 max 57 min +Histogram: 1 0 0 0 1 1 0 0 0 1 +Nghost: 1373.00 ave 1380 max 1366 min +Histogram: 1 0 0 0 1 1 0 0 0 1 +Neighs: 0.00000 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 10779.5 ave 11978 max 9604 min +Histogram: 1 0 0 0 1 1 0 0 0 1 + +Total # of neighbors = 43118 +Ave neighs/atom = 168.42969 +Neighbor list builds = 1 +Dangerous builds = 0 + +Total wall time: 0:00:03 diff --git a/potentials/Cu-PBE-core-rep.ace b/potentials/Cu-PBE-core-rep.ace new file mode 100644 index 0000000000..338675f718 --- /dev/null +++ b/potentials/Cu-PBE-core-rep.ace @@ -0,0 +1,8980 @@ +nelements=1 +elements: Cu + +lmax=6 + +embedding-function: FinnisSinclairShiftedScaled +4 FS parameters: 1.000000 1.000000 1.000000 0.500000 +core energy-cutoff parameters: 100000.000000000000000000 250.000000000000000000 +E0: 0.000000000000000000 + +radbasename=ChebPow +nradbase=16 +nradmax=5 +cutoffmax=7.400000 +deltaSplineBins=0.001000 +core repulsion parameters: 400.000000000000000000 7.000000000000000000 +radparameter= 2.000000000000000000 +cutoff= 7.400000000000000355 +dcut= 0.010000000000000000 +crad= 1.620882954168367363 1.226870698977090335 0.999546737553742348 1.448717152469839231 0.789126334259324436 0.990815368777163696 1.019809595831713933 + -0.010015984641177847 0.177152406295798537 -0.099297777289971231 0.173787043169736394 -0.226947223064932313 -0.058969556614429458 0.008323578427593646 + 0.037392073193535026 0.101922365253167557 0.446201407295113706 -0.369069422111282963 -0.101863282196291566 -0.029626931322193999 0.097875222496131745 + 0.002819311425100959 0.000151479194773449 -0.214871024239485592 -0.069350620490777212 0.231426164941363366 -0.026191321598537990 -0.242936254601765322 + 0.186424171366563085 -0.103524085445276359 0.830521273247123437 0.062832162628560284 -0.106558674195482483 -0.060269761337715569 0.046046279743879009 + 1.089304926077264701 0.177165429291873872 0.040767337435711030 0.207716881111047691 -0.085636392006336770 0.046112979588318073 0.078517835329897867 + 1.129288955740465283 1.283253876185540099 1.270328483265826813 1.302687308336752281 0.783473148483047943 1.064176625568968637 1.118800783955553158 + 0.034683824293293135 0.166087484219912207 0.546218802681498805 -0.211429048936371933 -0.108993988729734884 -0.212659494092938856 -0.036191223132020688 + 0.234655107931153573 0.156894718007277223 0.048936621328313876 -0.162183357659622718 0.307926217468614039 -0.083635563001107333 -0.190353036639087092 + 0.329164314982446249 -0.116372429560617760 1.123321061290994516 0.035933724713058841 -0.121370009888348923 -0.109059319819502371 -0.046270850004972844 + 0.108676366969885460 -0.180439291176837630 0.383342539875913824 -0.621209999725314210 0.385861319212343623 0.152252507630111139 0.149457142460434372 + 0.330958073121243090 -0.158282686680629170 0.518958273372971735 0.067226874856217825 0.206572443953436963 0.339537052357791691 0.158596210584529440 + 1.111506419459131090 0.957689150469036465 0.902367027195451810 1.304322975666854845 1.089903020096729014 0.640922035675120738 0.852402336400111094 + 0.311659366422990858 0.407722114498847987 0.545357078699712172 -0.047688798410163040 -0.202317109106842585 -0.073290520019455838 0.228458278553162836 + 0.016478777869119634 0.119519275288016646 -0.105703783821920971 -0.168081439248992437 -0.084202740091545075 -0.057979361619927096 -0.178261149665524310 + -0.614150422523331962 -0.113461629368103653 0.467772160304797735 0.043087231016849081 0.026751930571205659 0.095990676140457337 0.108807286772020978 + 0.194153732515313149 -0.438554540631357515 -0.157353675556007294 -0.196717245341016089 0.051481657072597040 0.246337180836969150 0.081532474873181965 + 0.152006625631538272 -0.052929673773957256 -0.281471510782792256 -0.383762521867106021 0.009965087491552352 -0.211125042490682313 0.219840794494771730 + 0.704490118902931228 1.210078321428047499 0.908865477162489666 0.964021705530207051 0.450293727333551608 1.056627264682903355 1.036709129269184348 + -0.266388684620139204 0.119181785240976085 -0.508517138281119108 -0.105337098339662927 -0.414055390436296855 -0.006568085386914734 -0.008489695366700342 + 0.009311394124494344 -0.099540617340626705 -0.220138090092576039 0.394717776767940565 -0.399661065152255024 -0.054875482424368613 0.087928207583678072 + -0.200476767128879518 0.054334966747964966 -0.215670764334545295 -0.202435906588276288 -0.374669531151026636 0.080145301631041707 0.139272393452873761 + -0.228221777484558963 0.172333233925270862 -0.224387778758770889 -0.564483491180480801 -0.298745938717995319 -0.259629429961615532 0.108686444970415394 + -0.483517031721824420 -0.282846852149469419 -0.625693461166449194 -0.387653192284443615 -0.369381863863073201 0.099516220004199393 -0.162958290590200922 + 0.843113306239999361 0.970201274626998567 0.497935134368538423 1.238080061977394619 0.548287703792778025 1.005350365417147840 0.978841498999161952 + 0.161892884869938802 -0.057335972877138500 -0.287116420859928667 -0.431089456562013029 0.091551903183807848 0.009439015631080828 0.268379617567215512 + -0.313867847114206122 0.243338557259537763 0.109264771609771119 -0.009666213846503660 -0.133516151120714938 0.183542158157167595 0.006005890571908578 + -0.275733732828145839 -0.128502017574031319 -0.073686803430467171 0.308342699434350775 -0.206556802250618482 -0.701080266495170523 -0.286168309771043461 + 0.119676675371723718 -0.265827473160971328 -0.138936457944444508 -0.260613135771113114 -0.122074823420990297 -0.103261598427067697 0.101997949329349455 + -0.157897581669569576 0.350345541041593489 -0.933992118802804527 0.147922763127684820 0.356569853133460291 -0.081578094144895641 -0.338456352936399141 + -0.203760900854131732 0.189503004819520010 0.235745748801731325 0.004064475912380798 0.215067145132773530 0.117105245708646361 0.111489983723870631 + 0.101650818608736676 -0.167934753188295732 -0.139505609630948518 0.100135735837952627 0.207615321477888276 -0.078360547689259985 -0.116477991952193133 + 0.178361429240386588 -0.246847445837075324 0.143897039260075771 0.044934626106912463 0.118578224500244023 -0.719942102233247505 0.073637722061881336 + 0.024025247854341104 0.001534080809538862 0.094065987917264698 0.240346270826002351 0.098969119363074953 -0.244637392429236766 0.096073383164608006 + -0.304219743047226709 0.539609038640176175 -0.132850069068995102 -0.299368028571179834 0.746390925347525602 -0.232536767925996535 -0.108103436794605989 + 0.195979815142720420 -0.040816048069926517 -0.044677154389707881 0.433473455733551616 -0.201417732045534481 -0.109853989934706436 -0.195696892388067839 + 0.252310364976787271 -0.021898887380862420 0.067719939949285227 -0.017567269073639431 0.022537126215898290 -0.529276494508221229 0.272475503821669407 + -0.016626743795124868 0.284841765436517957 -0.079759939497546326 -0.328099876823462200 0.055122957831866798 -0.189781205812279585 0.365248408266040103 + -0.329763357459598394 0.010673557058247799 -0.017801755801789724 -0.039803492471327410 0.249452633918018529 -0.048044948752604191 0.159824465245292396 + -0.131392669230931763 -0.361557435802961957 0.742274013004291744 -0.252379926701268686 -0.110472709032232691 -0.111902522072616598 0.417101605249653729 + 0.067609831656761807 -0.091801646917712573 -0.091634912786787426 -0.434385245328863356 0.024595602536191159 -0.289945821375914847 0.288303924123883670 + -0.222102655505146879 0.197355553496445846 0.119137466964190517 -0.042193758741101241 -0.122199312294347676 -0.128163957018649854 0.282954745760183590 + -0.204869687909700199 0.000000621334072530 0.032919899102939618 0.322373316219983164 -0.077448878302233126 0.132826673866245498 0.151351269017551887 + 0.154359198134425391 0.079067208002472550 0.058020078782584084 -0.232041484505397327 -0.026740685821034973 0.148256901236103134 0.424170596945284806 + 0.076066132728142583 -0.832551883078829325 -0.098299542749259339 0.077287366905066629 -0.744292521475131585 0.211880016794529641 0.170541270652513594 + -0.301235289725240885 0.124854406668055681 0.181148870342708240 0.020790964162366463 0.092737682517404635 0.037519961016909541 0.327465533485634563 + -0.057351161899013424 -0.172723703275453028 -0.191045047691164482 0.064598438230230093 0.038530117310918668 0.367171594126136536 -0.035108818230914815 + 0.222822360258921021 -0.277052912363094761 0.128622927261680037 0.042894401860175763 0.089121765389491847 0.326364329820108379 0.030774994290021802 + 0.111545057922890795 -0.034316594853320039 0.022312383003994508 0.289389743851779624 -0.246524961296611334 0.028561066177931277 -0.070048339030033088 + 0.045575326010860895 0.109780971670271690 -0.338626089720981571 0.024597569064119484 -0.142385603670319966 0.090150826060666198 -0.372899644372851724 + 0.291392634005350593 -0.121181025017044364 -0.167594681733613610 0.418058936918965562 -0.161438428637826009 0.250892543119877354 -0.553531220726090512 + 0.280439932760923050 -0.045161340984994365 0.145378000975044303 -0.032786294274536824 0.054876462308243001 -0.092595253604733418 0.096974220050406124 + -0.037062175032763989 0.281880298116827188 -0.283327757130565294 -0.328329927335834160 0.016267612428127076 0.466711025996532913 -0.136943959907595614 + -0.202699957735178654 -0.155744585760218823 -0.064691184011394204 -0.010011506674438368 0.123909262044762644 -0.157356236508212094 -0.581020771631760469 + -0.013864148398799264 0.589523162717231486 0.210130906014073165 -0.041132265159346544 0.427080437934189927 -0.370839207978565399 -0.228221803399244971 + -0.117316390211942637 0.105828808341833114 0.064732613180985069 -0.570746814954502524 0.173615222749272019 -0.039156497506634864 0.047129546703413218 + -0.296820240442319583 0.215985098466458941 -0.101180811783609007 -0.050727672473374119 -0.062868935459046468 -0.149766104907457120 -0.187737339165467587 + -0.135395947527593125 -0.178526515064528601 0.254279030910830595 0.324458118192411549 -0.131019927336322617 -0.090644759580875284 -0.048175899295618413 + 0.201186098632202576 0.214678921747854301 -0.046817091358603936 -0.311321078952362162 0.141123812750895999 -0.224280305518061496 0.061785358391432607 + -0.039718453214003191 -0.100313138160843709 -0.163755261758446430 0.078958079832196743 0.091597172971250335 -0.246955473616377569 0.210137425898705849 + -0.020928587901441802 -0.073463934758673452 0.040369959448086516 0.438404350385290353 -0.102882684652787021 -0.033081564618892306 0.536459552888738367 + 0.192269484941590685 -0.199849387314510074 0.110717599113859783 0.096893820038588277 0.042154418198533598 0.344356250511964890 0.033227584485695669 + 0.189281310257760876 0.115753002295463162 -0.094886206077761825 -0.184153223554636647 0.144584955795100834 -0.428848345913688311 0.041529544188303000 + -0.145976206197570624 -0.109411578701642934 0.157497794094985794 0.398664417382644687 -0.263204907220635942 -0.039370507864295204 0.666124702411733827 + 0.045657200117720939 -0.388985180138902376 0.209263790100419456 0.009217586427354594 -0.222024958874212308 0.293022315296286473 0.238898724595455747 + 0.062538013377883533 0.043324296533199559 -0.072995962506026496 -0.218020871314228537 0.016363481173287529 -0.008814551087371419 -0.445713189829081147 + -0.073147111207916560 0.097837425665409233 -0.101164665007458840 -0.070972762713574389 -0.023635867292054968 -0.287102674234959554 0.144903701346548480 + -0.138848347980535664 -0.074476951705818389 -0.014043298678579744 0.063802121083298080 -0.044508765572264831 0.346111987264413556 0.209412636105885702 + 0.065988699465650127 0.002844488967674905 -0.158349167897939014 -0.273829200679602536 0.233300763084839324 0.524562168896331227 -0.276941619014999640 + -0.040552715767521105 0.358034042258507434 -0.159809355884827337 -0.055779306211808273 -0.058012898049283036 0.123150329617385132 0.010088304079376876 + -0.038896344296986941 -0.021291676374172713 0.034045094204886668 0.065680845722403555 0.016175406450344553 -0.229426985066826100 0.071928878705798727 + 0.014301163554659121 -0.019742156450417429 0.041229485842464615 0.035107543236686287 0.006577466522553385 -0.028686735753756000 -0.339081583859915991 + 0.063078713153799190 0.047182339952238382 0.019205029655248076 -0.004228530388563512 -0.028004312224389732 0.069422621338731616 -0.331160190510054020 + -0.012659008117644029 0.041636123832886486 0.075120638944337390 0.115783439976586952 -0.123485973005787786 -0.095468155539712010 -0.053812815477012638 + 0.024864000159051606 -0.091130995649244775 0.098067123627009894 0.012070150960164505 0.172024706838292490 0.101558372742640429 -0.100147846163164009 + 0.008829229120333874 0.006405635890914630 -0.000254252635758890 -0.009011737939159836 -0.004752296253587464 0.079792557189286267 0.118552883972912901 + -0.003635605667191180 -0.001002425952287890 -0.000649194473260929 -0.011404466728970108 0.006901342169003619 0.034016193177316904 0.278783128764508614 + -0.017744804165672218 -0.016847357300988471 0.000912070777251806 -0.003869343607930638 0.023830639783322036 -0.127167731719168647 0.285890261660589728 + -0.002679566245452475 -0.022073307923849178 -0.008876564594146853 -0.022914399060255677 0.035103058565932314 0.055453820008897800 0.241028402897824484 + -0.008521518382250752 -0.021652682943862276 -0.028772707427434475 0.007188333511621093 -0.103543186820726829 0.006757566326101306 0.136511555349044217 + +rankmax=6 +ndensitymax=2 + +num_c_tilde_max=742 +num_ms_combinations_max=43 +total_basis_size_rank1: 16 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 1 ) +l=( 0 ) +num_ms=1 +< 0 >: 21.470762535743872945 -13.793209621753947047 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 2 ) +l=( 0 ) +num_ms=1 +< 0 >: 2.104801676125194643 -8.820703455800842363 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 3 ) +l=( 0 ) +num_ms=1 +< 0 >: -19.863946793243037803 14.722042315042330074 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 4 ) +l=( 0 ) +num_ms=1 +< 0 >: 18.431266327113892345 -3.178188891777359526 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 5 ) +l=( 0 ) +num_ms=1 +< 0 >: -2.555646585840716689 -11.500658249153314472 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 6 ) +l=( 0 ) +num_ms=1 +< 0 >: -12.337994092080041497 13.955310823988369862 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 7 ) +l=( 0 ) +num_ms=1 +< 0 >: 16.321023276924805145 -1.316684071539170109 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 8 ) +l=( 0 ) +num_ms=1 +< 0 >: -10.622911593436542788 -12.815946383819756704 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 9 ) +l=( 0 ) +num_ms=1 +< 0 >: 2.405909881352659596 14.563815776076941333 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 10 ) +l=( 0 ) +num_ms=1 +< 0 >: 2.848724496673481266 -3.833614026162156740 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 11 ) +l=( 0 ) +num_ms=1 +< 0 >: -4.037154587884821844 -9.045251135935824749 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 12 ) +l=( 0 ) +num_ms=1 +< 0 >: 2.906894963960199529 14.840216345844389423 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 13 ) +l=( 0 ) +num_ms=1 +< 0 >: -1.442545132794496698 -12.437798929121386848 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 14 ) +l=( 0 ) +num_ms=1 +< 0 >: 0.526838604830681234 6.670020535134621120 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 15 ) +l=( 0 ) +num_ms=1 +< 0 >: -0.138466706086830982 -2.209524140381979862 +ctilde_basis_func: rank=1 ndens=2 mu0=0 mu=( 0 ) +n=( 16 ) +l=( 0 ) +num_ms=1 +< 0 >: 0.021753609992975927 0.347647438597837033 +total_basis_size: 726 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 1 1 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.276073421846033618 0.943638110319304224 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 1 1 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: -0.114991763852642592 -0.163038264609165984 +< 1 -1 >: 0.229983527705285129 0.326076529218331912 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 1 1 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: 0.150603037137131079 0.200814698064905317 +< 1 -1 >: -0.301206074274262214 -0.401629396129810690 +< 2 -2 >: 0.301206074274262270 0.401629396129810801 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 1 1 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: -0.040544295625458825 0.273558633659413464 +< 1 -1 >: 0.081088591250917649 -0.547117267318826928 +< 2 -2 >: -0.081088591250917635 0.547117267318826817 +< 3 -3 >: 0.081088591250917635 -0.547117267318826817 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 1 1 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: 0.007486283689304846 -0.103146896489077697 +< 1 -1 >: -0.014972567378609686 0.206293792978155338 +< 2 -2 >: 0.014972567378609686 -0.206293792978155338 +< 3 -3 >: -0.014972567378609686 0.206293792978155338 +< 4 -4 >: 0.014972567378609688 -0.206293792978155366 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 1 1 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.004496650457917946 -0.071564261184607722 +< 1 -1 >: -0.008993300915835892 0.143128522369215444 +< 2 -2 >: 0.008993300915835894 -0.143128522369215472 +< 3 -3 >: -0.008993300915835896 0.143128522369215500 +< 4 -4 >: 0.008993300915835894 -0.143128522369215472 +< 5 -5 >: -0.008993300915835884 0.143128522369215305 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 1 1 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: -0.018933070506297011 0.044295980593250135 +< 1 -1 >: 0.037866141012594036 -0.088591961186500284 +< 2 -2 >: -0.037866141012594015 0.088591961186500257 +< 3 -3 >: 0.037866141012594036 -0.088591961186500284 +< 4 -4 >: -0.037866141012594008 0.088591961186500243 +< 5 -5 >: 0.037866141012594015 -0.088591961186500257 +< 6 -6 >: -0.037866141012593994 0.088591961186500201 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.009469793779863284 -0.308610971550766999 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.056736899711583730 0.409170451739158947 +< 1 -1 0 >: -0.113473799423167446 -0.818340903478317783 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: 0.167410082246193581 -0.177991034261680253 +< -1 0 1 >: -0.236753608790562287 0.251717334633682455 +< -1 1 0 >: 0.068344879883423221 -0.072664535455225832 +< 0 0 0 >: 0.068344879883423235 -0.072664535455225832 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.032161204572764113 0.105304782790813747 +< 1 -1 0 >: 0.064322409145528225 -0.210609565581627523 +< 2 -2 0 >: -0.064322409145528239 0.210609565581627578 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 2 2 2 ) +num_ms=5 +< -2 0 2 >: 0.135349476741624480 -0.243550057913533124 +< -2 1 1 >: -0.110512384989893159 0.198857789571149440 +< -1 -1 2 >: -0.055256192494946579 0.099428894785574720 +< -1 0 1 >: 0.067674738370812226 -0.121775028956766521 +< 0 0 0 >: -0.022558246123604072 0.040591676318922174 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: 0.175670129498521982 -0.157245599186258633 +< -2 -1 3 >: -0.248435079640647760 0.222378858992690720 +< -2 0 2 >: 0.162638936819378604 -0.145581136327416566 +< -2 1 1 >: -0.093899633953382800 0.084051308247565570 +< -2 2 0 >: 0.020996596458211125 -0.018794443883934534 +< -1 -1 2 >: 0.132794135838743138 -0.118866500058908836 +< -1 0 1 >: -0.230006190219906204 0.205882817419919012 +< -1 1 0 >: 0.083986385832844512 -0.075177775535738151 +< 0 0 0 >: 0.062989789374633370 -0.056383331651803599 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: 0.054516667380390550 0.043115393457091603 +< -2 0 2 >: -0.154196420769462494 -0.121948748348142344 +< -2 1 1 >: 0.084456857941992702 0.066794080329798416 +< -1 -2 3 >: -0.086198419681919602 -0.068171422769365331 +< -1 -1 2 >: 0.066769008779494474 0.052805357014603420 +< -1 0 1 >: -0.048761189667719473 -0.038563580258682603 +< 0 -3 3 >: 0.086198419681919589 0.068171422769365317 +< 0 -1 1 >: -0.051719051809151741 -0.040902853661619186 +< 0 0 0 >: 0.034479367872767841 0.027268569107746131 +< 1 -3 2 >: -0.086198419681919602 -0.068171422769365331 +< 1 -2 1 >: 0.066769008779494474 0.052805357014603420 +< 2 -3 1 >: 0.054516667380390550 0.043115393457091603 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: -0.015736892091809770 -0.086212663677825471 +< -2 -1 3 >: 0.023605338137714659 0.129318995516738228 +< -2 0 2 >: -0.056427550950417620 -0.309131526343983332 +< -2 1 1 >: 0.029739930631419775 0.162926619968555231 +< -1 -3 4 >: 0.029441029270092230 0.161289124941796591 +< -1 -2 3 >: -0.027819157782299098 -0.152403897776863834 +< -1 -1 2 >: 0.018926375959344998 0.103685866034012072 +< -1 0 1 >: -0.013300101307596568 -0.072862999518792812 +< 0 -4 4 >: -0.033995572348614785 -0.186240639405010788 +< 0 -3 3 >: 0.008498893087153693 0.046560159851252683 +< 0 -2 2 >: 0.009713020671032798 0.053211611258574529 +< 0 -1 1 >: -0.020640168925944686 -0.113074673924470834 +< 0 0 0 >: 0.012141275838790995 0.066514514073218151 +< 1 -4 3 >: 0.029441029270092230 0.161289124941796591 +< 1 -3 2 >: -0.027819157782299098 -0.152403897776863834 +< 1 -2 1 >: 0.018926375959344998 0.103685866034012072 +< 2 -4 2 >: -0.015736892091809770 -0.086212663677825471 +< 2 -3 1 >: 0.023605338137714659 0.129318995516738228 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.044004529005274344 -0.043258843809945630 +< 0 1 -1 >: 0.050812053333515649 -0.049951010237008146 +< 1 -2 1 >: -0.029336352670182884 0.028839229206630408 +< 1 -1 0 >: -0.082975735633465622 0.081569658144806031 +< 1 0 -1 >: -0.071859094956282871 0.070641396131414236 +< 2 -2 0 >: 0.065598078782436411 -0.064486476924722938 +< 2 -1 -1 >: 0.092769692679740334 -0.091197650256602814 +< 3 -2 -1 >: -0.113619205330085807 0.111693854434738116 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.016229403465369892 -0.004224252258146830 +< 1 -1 0 >: 0.032458806930739784 0.008448504516293660 +< 2 -2 0 >: -0.032458806930739784 -0.008448504516293658 +< 3 -3 0 >: 0.032458806930739784 0.008448504516293658 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: -0.025466777895254464 -0.021246082021809758 +< -3 0 3 >: 0.031190305618081587 0.026021029993376542 +< -3 1 2 >: -0.028876611859268674 -0.024090792584652430 +< -3 2 1 >: 0.021523355692400440 0.017956216617043556 +< -3 3 0 >: -0.005894413712967474 -0.004917512444301930 +< -2 -2 4 >: 0.016438734444980615 0.013714286973770995 +< -2 -1 3 >: -0.014703251073217575 -0.012266431174516730 +< -2 0 2 >: -0.006806282687793583 -0.005678254266922107 +< -2 1 1 >: 0.022229226173644138 0.018545100778320688 +< -2 2 0 >: -0.013753631996924105 -0.011474195703371170 +< -1 -1 2 >: 0.012426515202871462 0.010367026497477330 +< -1 0 1 >: -0.015219310763986433 -0.012696962534366068 +< -1 1 0 >: -0.001964804570989159 -0.001639170814767311 +< 0 0 0 >: 0.005894413712967474 0.004917512444301930 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.006148466217365900 -0.087978083276143981 +< 0 1 -1 >: -0.007530302466643330 -0.107750706287319475 +< 1 -2 1 >: 0.005324727938549284 0.076191255093403562 +< 1 -1 0 >: 0.011906453632288523 0.170368825679877489 +< 1 0 -1 >: 0.009721578681738081 0.139105563664291693 +< 2 -3 1 >: -0.003074233108682951 -0.043989041638071998 +< 2 -2 0 >: -0.010649455877098571 -0.152382510186807180 +< 2 -1 -1 >: -0.011906453632288524 -0.170368825679877489 +< 3 -3 0 >: 0.008133656277816087 0.116384064586403838 +< 3 -2 -1 >: 0.014087905924479028 0.201583113055029212 +< 4 -3 -1 >: -0.016267312555632178 -0.232768129172807758 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.004198863556308038 0.004005914088795745 +< 1 -1 0 >: -0.008397727112616072 -0.008011828177591487 +< 2 -2 0 >: 0.008397727112616072 0.008011828177591487 +< 3 -3 0 >: -0.008397727112616072 -0.008011828177591487 +< 4 -4 0 >: 0.008397727112616073 0.008011828177591489 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 1 ) +l=( 4 4 4 ) +num_ms=13 +< -4 0 4 >: 0.028164648121169828 -0.080250909154112107 +< -4 1 3 >: -0.059376291706719105 0.169183771484167189 +< -4 2 2 >: 0.033663193206258352 -0.095918182546090164 +< -3 -1 4 >: -0.029688145853359542 0.084591885742083567 +< -3 0 3 >: 0.042246972181754744 -0.120376363731168168 +< -3 1 2 >: -0.022442128804172231 0.063945455030726767 +< -2 -2 4 >: 0.016831596603129172 -0.047959091273045075 +< -2 -1 3 >: -0.011221064402086115 0.031972727515363383 +< -2 0 2 >: -0.022129366380919148 0.063054285763945214 +< -2 1 1 >: 0.025446982160022474 -0.072507330636071662 +< -1 -1 2 >: 0.012723491080011237 -0.036253665318035831 +< -1 0 1 >: -0.018105845220752034 0.051589870170500644 +< 0 0 0 >: 0.006035281740250679 -0.017196623390166886 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 1 ) +l=( 0 0 0 0 ) +num_ms=1 +< 0 0 0 0 >: 0.000138481844165009 0.013689058093833308 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 1 ) +l=( 0 1 1 2 ) +num_ms=4 +< 0 -1 -1 2 >: -0.002584242887631366 -0.243495540854912540 +< 0 -1 0 1 >: 0.003654671340154488 0.344354696254389359 +< 0 -1 1 0 >: -0.001055012741018902 -0.099406638289591731 +< 0 0 0 0 >: -0.001055012741018902 -0.099406638289591745 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 1 ) +l=( 0 2 2 2 ) +num_ms=5 +< 0 -2 0 2 >: 0.002987041467627661 -0.272724527006854289 +< 0 -2 1 1 >: -0.002438909145407322 0.222678643836227763 +< 0 -1 -1 2 >: -0.001219454572703661 0.111339321918113882 +< 0 -1 0 1 >: 0.001493520733813830 -0.136362263503427089 +< 0 0 0 0 >: -0.000497840244604610 0.045454087834475694 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 1 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: -0.001037016851645970 -0.059980506805764756 +< 1 -1 0 0 >: 0.002074033703291940 0.119961013611529499 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 1 ) +l=( 1 1 1 1 ) +num_ms=3 +< -1 -1 1 1 >: 0.008589960551968066 0.137705095105858571 +< -1 0 0 1 >: -0.008589960551968067 -0.137705095105858599 +< 0 0 0 0 >: 0.002147490137992017 0.034426273776464664 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 1 ) +l=( 1 1 2 2 ) +num_ms=11 +< -1 -1 0 2 >: -0.005958717238765831 0.150281030317797659 +< -1 -1 1 1 >: 0.003648954189125550 -0.092027960574583262 +< -1 0 -1 2 >: 0.005160400502739472 -0.130147189962112136 +< -1 0 0 1 >: -0.004213449366704498 0.106264735621415807 +< -1 1 -2 2 >: -0.002023210051568463 -0.170081554018195052 +< -1 1 -1 1 >: -0.001625744137557086 0.262109514592778259 +< -1 1 0 0 >: 0.001421031100299468 -0.146392750725486326 +< 0 0 -2 2 >: -0.002637349163341318 0.177068737583680802 +< 0 0 -1 1 >: -0.001011605025784232 -0.085040777009097540 +< 0 0 0 0 >: 0.001113961544413041 0.027182395075451553 +< 0 1 -2 1 >: 0.005160400502739472 -0.130147189962112136 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 1 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: -0.000252427805362054 -0.010361628612788434 +< 1 -1 0 0 >: 0.000504855610724107 0.020723257225576868 +< 2 -2 0 0 >: -0.000504855610724107 -0.020723257225576875 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 1 ) +l=( 2 2 2 2 ) +num_ms=6 +< -2 -2 2 2 >: 0.001241037853319114 0.015089372462838339 +< -2 -1 1 2 >: -0.002482075706638228 -0.030178744925676668 +< -2 0 0 2 >: 0.001241037853319114 0.015089372462838332 +< -1 -1 1 1 >: 0.001241037853319114 0.015089372462838330 +< -1 0 0 1 >: -0.001241037853319113 -0.015089372462838327 +< 0 0 0 0 >: 0.000310259463329778 0.003772343115709581 +ctilde_basis_func: rank=5 ndens=2 mu0=0 mu=( 0 0 0 0 0 ) +n=( 1 1 1 1 1 ) +l=( 0 0 0 0 0 ) +num_ms=1 +< 0 0 0 0 0 >: -0.000000935020536080 -0.000007019453681854 +ctilde_basis_func: rank=5 ndens=2 mu0=0 mu=( 0 0 0 0 0 ) +n=( 1 1 1 1 1 ) +l=( 0 1 1 1 1 ) +num_ms=3 +< 0 -1 -1 1 1 >: 0.000022811031369710 -0.032258483849424084 +< 0 -1 0 0 1 >: -0.000022811031369710 0.032258483849424091 +< 0 0 0 0 0 >: 0.000005702757842428 -0.008064620962356025 +ctilde_basis_func: rank=5 ndens=2 mu0=0 mu=( 0 0 0 0 0 ) +n=( 1 1 1 1 1 ) +l=( 1 1 0 0 0 ) +num_ms=2 +< 0 0 0 0 0 >: 0.000024850300450537 0.001653066345334017 +< 1 -1 0 0 0 >: -0.000049700600901074 -0.003306132690668033 +ctilde_basis_func: rank=6 ndens=2 mu0=0 mu=( 0 0 0 0 0 0 ) +n=( 1 1 1 1 1 1 ) +l=( 0 0 0 0 0 0 ) +num_ms=1 +< 0 0 0 0 0 0 >: 0.000000003348866130 -0.000000862948625992 +ctilde_basis_func: rank=6 ndens=2 mu0=0 mu=( 0 0 0 0 0 0 ) +n=( 1 1 1 1 1 1 ) +l=( 0 0 1 1 1 1 ) +num_ms=3 +< 0 0 -1 -1 1 1 >: -0.000002459754467278 0.000454149082932992 +< 0 0 -1 0 0 1 >: 0.000002459754467278 -0.000454149082932992 +< 0 0 0 0 0 0 >: -0.000000614938616820 0.000113537270733248 +ctilde_basis_func: rank=6 ndens=2 mu0=0 mu=( 0 0 0 0 0 0 ) +n=( 1 1 1 1 1 1 ) +l=( 1 1 0 0 0 0 ) +num_ms=2 +< 0 0 0 0 0 0 >: -0.000000129541495748 -0.000009835136249784 +< 1 -1 0 0 0 0 >: 0.000000259082991496 0.000019670272499569 +ctilde_basis_func: rank=6 ndens=2 mu0=0 mu=( 0 0 0 0 0 0 ) +n=( 1 1 1 1 1 1 ) +l=( 1 1 1 1 1 1 ) +num_ms=4 +< -1 -1 -1 1 1 1 >: -0.000016778677138455 0.001507157658533400 +< -1 -1 0 0 1 1 >: 0.000025168015707683 -0.002260736487800101 +< -1 0 0 0 0 1 >: -0.000012584007853841 0.001130368243900051 +< 0 0 0 0 0 0 >: 0.000002097334642307 -0.000188394707316675 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 2 ) +l=( 0 1 1 2 ) +num_ms=4 +< 0 -1 -1 2 >: 0.002606633917492742 0.166454618525816056 +< 0 -1 0 1 >: -0.003686337038259946 -0.235402379038848891 +< 0 -1 1 0 >: 0.001064153840681534 0.067954813452978852 +< 0 0 0 0 >: 0.001064153840681534 0.067954813452978852 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 2 ) +l=( 0 2 2 2 ) +num_ms=7 +< 0 -2 0 2 >: -0.004460727294756203 0.344570699240051515 +< 0 -2 1 1 >: 0.005463252876929137 -0.422011196726066795 +< 0 -2 2 0 >: -0.002230363647378102 0.172285349620025813 +< 0 -1 -1 2 >: 0.002731626438464568 -0.211005598363033398 +< 0 -1 0 1 >: -0.002230363647378101 0.172285349620025702 +< 0 -1 1 0 >: -0.001115181823689050 0.086142674810012851 +< 0 0 0 0 >: 0.001115181823689050 -0.086142674810012851 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 2 ) +l=( 1 1 1 1 ) +num_ms=4 +< -1 -1 1 1 >: -0.001800118773298505 0.041745806620423383 +< -1 0 0 1 >: 0.000900059386649252 -0.020872903310211695 +< -1 0 1 0 >: 0.000900059386649252 -0.020872903310211695 +< 0 0 0 0 >: -0.000450029693324626 0.010436451655105851 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 2 ) +l=( 1 1 2 0 ) +num_ms=4 +< -1 -1 2 0 >: 0.000708205678384126 0.033448205200141384 +< -1 0 1 0 >: -0.001001554075320470 -0.047302905431078221 +< -1 1 0 0 >: 0.000289123757497120 0.013655172592042209 +< 0 0 0 0 >: 0.000289123757497120 0.013655172592042211 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 2 ) +l=( 1 1 2 2 ) +num_ms=13 +< -1 -1 0 2 >: 0.004998045503574758 -0.131890838605257354 +< -1 -1 1 1 >: -0.006121330597484975 0.161532628165324682 +< -1 -1 2 0 >: 0.004998045503574758 -0.131890838605257354 +< -1 0 -1 2 >: -0.008656868750732653 0.228441633517172366 +< -1 0 0 1 >: 0.003534151868256642 -0.093260906354157916 +< -1 0 1 0 >: 0.003534151868256642 -0.093260906354157916 +< -1 1 -2 2 >: 0.004214437589129390 0.213954236196574943 +< -1 1 -1 1 >: 0.001906893008355585 -0.375486864361899542 +< -1 1 0 0 >: -0.001973668270425288 0.214665536875170537 +< 0 0 -2 2 >: 0.004014111802920279 -0.268509746263612126 +< 0 0 -1 1 >: 0.002107218794564695 0.106977118098287485 +< 0 0 0 0 >: -0.002073831163529843 -0.026566454354922955 +< 0 1 -2 1 >: -0.008656868750732653 0.228441633517172366 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 2 ) +l=( 1 2 2 1 ) +num_ms=16 +< -1 -2 2 1 >: 0.000043196748971934 0.004624812988269349 +< -1 -1 1 1 >: 0.000021598374479169 0.002312406494125256 +< -1 -1 2 0 >: -0.000091634142360189 -0.009810709877161313 +< -1 0 0 1 >: -0.000043196748965136 -0.004624812988259930 +< -1 0 1 0 >: 0.000074818963929414 0.008010411071170644 +< -1 0 2 -1 >: 0.000211619987023362 0.022656863954066245 +< -1 1 1 -1 >: -0.000129590246895409 -0.013874438964779794 +< 0 -2 1 1 >: -0.000091634142360189 -0.009810709877161313 +< 0 -2 2 0 >: 0.000086393497930272 0.009249625976519859 +< 0 -1 1 0 >: 0.000043196748965136 0.004624812988259929 +< 0 -1 2 -1 >: -0.000091634142350575 -0.009810709877147994 +< 0 0 0 0 >: -0.000043196748965136 -0.004624812988259929 +< 0 0 1 -1 >: 0.000074818963929414 0.008010411071170644 +< 1 -2 1 0 >: -0.000091634142350575 -0.009810709877147994 +< 1 -2 2 -1 >: 0.000043196748958338 0.004624812988250512 +< 1 -1 1 -1 >: 0.000021598374485967 0.002312406494134675 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 2 ) +l=( 2 2 2 0 ) +num_ms=5 +< -2 0 2 0 >: -0.002711275102736040 0.118067964076814316 +< -2 1 1 0 >: 0.002213746851338445 -0.096402088985816467 +< -1 -1 2 0 >: 0.001106873425669223 -0.048201044492908234 +< -1 0 1 0 >: -0.001355637551368019 0.059033982038407144 +< 0 0 0 0 >: 0.000451879183789340 -0.019677994012802378 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 1 2 ) +l=( 2 2 2 2 ) +num_ms=9 +< -2 -2 2 2 >: -0.004288317671950520 -0.028719268605867147 +< -2 -1 1 2 >: 0.004288317671950519 0.028719268605867140 +< -2 -1 2 1 >: 0.004288317671950519 0.028719268605867140 +< -2 0 0 2 >: -0.002144158835975259 -0.014359634302933568 +< -2 0 2 0 >: -0.002144158835975259 -0.014359634302933568 +< -1 -1 1 1 >: -0.004288317671950518 -0.028719268605867133 +< -1 0 0 1 >: 0.002144158835975259 0.014359634302933563 +< -1 0 1 0 >: 0.002144158835975259 0.014359634302933563 +< 0 0 0 0 >: -0.001072079417987629 -0.007179817151466781 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.054583050684663452 0.037778832951642007 +< 1 -1 0 >: -0.109166101369326876 -0.075557665903283999 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: -0.184430989327066336 -0.154125006937149200 +< -1 0 1 >: 0.260824806428224809 0.217965675111363805 +< -1 1 0 >: -0.075293636101333786 -0.062921270599822179 +< 0 0 0 >: -0.075293636101333800 -0.062921270599822193 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.038448246681710971 0.140449177313778123 +< 1 -1 0 >: -0.076896493363421956 -0.280898354627556246 +< 2 -2 0 >: 0.076896493363421969 0.280898354627556357 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 2 2 2 ) +num_ms=7 +< -2 0 2 >: -0.108690908618374091 -0.016097050258906159 +< -2 1 1 >: 0.133118632897245542 0.019714779749127966 +< -2 2 0 >: -0.054345454309187059 -0.008048525129453081 +< -1 -1 2 >: 0.066559316448622771 0.009857389874563983 +< -1 0 1 >: -0.054345454309187032 -0.008048525129453078 +< -1 1 0 >: -0.027172727154593516 -0.004024262564726539 +< 0 0 0 >: 0.027172727154593516 0.004024262564726539 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: -0.176338912536312509 -0.091213992615658768 +< -2 -1 3 >: 0.249380881682976202 0.128996065435264012 +< -2 0 2 >: -0.163258109598152040 -0.084447747744081952 +< -2 1 1 >: 0.094257113523882524 0.048755929892503339 +< -2 2 0 >: -0.021076531320231608 -0.010902157354585147 +< -1 -1 2 >: -0.133299688295615143 -0.068951297300090031 +< -1 0 1 >: 0.230881832761099803 0.119427150171542665 +< -1 1 0 >: -0.084306125280926444 -0.043608629418340594 +< 0 0 0 >: -0.063229593960694802 -0.032706472063755439 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: -0.024945478185600632 0.000607322378003120 +< -2 0 2 >: 0.035278233569958614 -0.000858883543704693 +< -2 1 1 >: -0.038645368630404672 0.000940859782314069 +< -2 2 0 >: 0.035278233569958614 -0.000858883543704693 +< -1 -2 3 >: 0.039442264194271250 -0.000960260994239802 +< -1 -1 2 >: -0.030551846472225141 0.000743814967740666 +< -1 0 1 >: 0.011155956990848228 -0.000271602824294360 +< -1 1 0 >: 0.011155956990848228 -0.000271602824294360 +< 0 -3 3 >: -0.039442264194271250 0.000960260994239802 +< 0 -1 1 >: 0.023665358516562741 -0.000576156596543881 +< 0 0 0 >: -0.015776905677708501 0.000384104397695921 +< 1 -3 2 >: 0.039442264194271250 -0.000960260994239802 +< 1 -2 1 >: -0.030551846472225141 0.000743814967740666 +< 2 -3 1 >: -0.024945478185600632 0.000607322378003120 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.045315983906195470 -0.042800229133881873 +< 0 1 -1 >: -0.052326391013669385 -0.049421447623648702 +< 1 -2 1 >: 0.030210655937463634 0.028533486089254569 +< 1 -1 0 >: 0.085448638709896718 0.080704886018415745 +< 1 0 -1 >: 0.074000691841568891 0.069892481501475562 +< 2 -2 0 >: -0.067553080321026346 -0.063802814530617868 +< 2 -1 -1 >: -0.095534482370074475 -0.090230805626774949 +< 3 -2 -1 >: 0.117005367323798889 0.110509716432923955 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.029791319964388840 -0.036280069387636865 +< 1 -1 0 >: -0.059582639928777680 0.072560138775273730 +< 2 -2 0 >: 0.059582639928777673 -0.072560138775273716 +< 3 -3 0 >: -0.059582639928777673 0.072560138775273716 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 3 3 2 ) +num_ms=12 +< -3 1 2 >: -0.062403229056392263 0.114592988417411126 +< -3 2 1 >: 0.098668168583699756 -0.181187423642156509 +< -3 3 0 >: -0.098668168583699756 0.181187423642156481 +< -2 1 1 >: -0.076428034745091036 0.140347174861660068 +< -2 3 -1 >: 0.098668168583699756 -0.181187423642156509 +< -1 1 0 >: 0.059200901150219837 -0.108712454185293864 +< -1 2 -1 >: -0.076428034745091036 0.140347174861660068 +< -1 3 -2 >: -0.062403229056392263 0.114592988417411126 +< 0 0 0 >: -0.039467267433479905 0.072474969456862590 +< 0 1 -1 >: 0.055815144874233280 -0.102495084738470951 +< 0 2 -2 >: 0.176502985734849543 -0.324117916745531753 +< 1 1 -2 >: -0.096674666753989627 0.177526694293109133 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: 0.012326585138872454 -0.178995877105088769 +< -3 0 3 >: -0.015096921930605817 0.219224282484696609 +< -3 1 2 >: 0.013977033768051901 -0.202962247082547842 +< -3 2 1 >: -0.010417865876391355 0.151279127114228390 +< -3 3 0 >: 0.002853050070781436 -0.041429495200077153 +< -2 -2 4 >: -0.007956776493076807 0.115541341844633008 +< -2 -1 3 >: 0.007116757248116852 -0.103343317830456152 +< -2 0 2 >: 0.003294418452754285 -0.047838660412309698 +< -2 1 1 >: -0.010759525611276336 0.156240410651253742 +< -2 2 0 >: 0.006657116831823352 -0.096668822133513355 +< -1 -1 2 >: -0.006014757668115967 0.087341044762171402 +< -1 0 1 >: 0.007366543606688264 -0.106970496634452614 +< -1 1 0 >: 0.000951016690260480 -0.013809831733359063 +< 0 0 0 >: -0.002853050070781436 0.041429495200077153 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.017947273004863901 -0.042559306577471916 +< 0 1 -1 >: 0.021980830568171777 -0.052124292460741052 +< 1 -2 1 >: -0.015542794350866815 0.036857440663540832 +< 1 -1 0 >: -0.034754744728837925 0.082415742800342265 +< 1 0 -1 >: -0.028377130242112060 0.067292172211098289 +< 2 -3 1 >: 0.008973636502431952 -0.021279653288735965 +< 2 -2 0 >: 0.031085588701733641 -0.073714881327081691 +< 2 -1 -1 >: 0.034754744728837925 -0.082415742800342279 +< 3 -3 0 >: -0.023742010541326398 0.056300670587673088 +< 3 -2 -1 >: -0.041122368531413198 0.097515621958048540 +< 4 -3 -1 >: 0.047484021082652816 -0.112601341175346217 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.007714119228406039 0.044611919281672956 +< 1 -1 0 >: 0.015428238456812073 -0.089223838563345884 +< 2 -2 0 >: -0.015428238456812073 0.089223838563345884 +< 3 -3 0 >: 0.015428238456812073 -0.089223838563345884 +< 4 -4 0 >: -0.015428238456812075 0.089223838563345897 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 4 4 2 ) +num_ms=18 +< -4 2 2 >: 0.010597679068320204 0.043734705711118302 +< -4 3 1 >: -0.019826442084319936 -0.081820142341195140 +< -4 4 0 >: 0.022893603348909268 0.094477762411644975 +< -3 1 2 >: -0.015896518602480307 -0.065602058566677460 +< -3 2 1 >: 0.018734226835119869 0.077312767453824427 +< -3 3 0 >: -0.005723400837227315 -0.023619440602911237 +< -3 4 -1 >: -0.019826442084319936 -0.081820142341195140 +< -2 1 1 >: -0.012745569911348526 -0.052598662933625431 +< -2 2 0 >: -0.006541029528259793 -0.026993646403327146 +< -2 3 -1 >: 0.018734226835119869 0.077312767453824427 +< -2 4 -2 >: 0.010597679068320204 0.043734705711118302 +< -1 1 0 >: 0.013899687747552054 0.057361498607070162 +< -1 2 -1 >: -0.012745569911348526 -0.052598662933625431 +< -1 3 -2 >: -0.015896518602480307 -0.065602058566677460 +< 0 0 0 >: -0.008176286910324739 -0.033742058004158922 +< 0 1 -1 >: 0.008956673554838158 0.036962572611051174 +< 0 2 -2 >: 0.037999947645001697 0.156818914460246650 +< 1 1 -2 >: -0.020027730920892814 -0.082650824981582327 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 2 ) +l=( 4 4 4 ) +num_ms=19 +< -4 0 4 >: -0.045458003399570290 0.049647232216497236 +< -4 1 3 >: 0.071875414313159663 -0.078499166663710512 +< -4 2 2 >: -0.081499059279579789 0.089009688479138524 +< -4 3 1 >: 0.071875414313159663 -0.078499166663710526 +< -4 4 0 >: -0.022729001699785145 0.024823616108248618 +< -3 -1 4 >: 0.071875414313159650 -0.078499166663710498 +< -3 0 3 >: -0.068187005099355422 0.074470848324745847 +< -3 1 2 >: 0.027166353093193256 -0.029669896159712838 +< -3 2 1 >: 0.027166353093193259 -0.029669896159712841 +< -3 3 0 >: -0.034093502549677704 0.037235424162372917 +< -2 -2 4 >: -0.040749529639789887 0.044504844239569255 +< -2 -1 3 >: 0.027166353093193256 -0.029669896159712838 +< -2 0 2 >: 0.035717002671090937 -0.039008539598676402 +< -2 1 1 >: -0.061607497982708294 0.067284999997466163 +< -2 2 0 >: 0.017858501335545462 -0.019504269799338191 +< -1 -1 2 >: -0.030803748991354147 0.033642499998733082 +< -1 0 1 >: 0.029223002185438045 -0.031916077853462510 +< -1 1 0 >: 0.014611501092719019 -0.015958038926731252 +< 0 0 0 >: -0.014611501092719026 0.015958038926731258 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 1 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: -0.000865763010737041 0.017336339429338609 +< 1 -1 0 0 >: 0.001731526021474082 -0.034672678858677211 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 1 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: 0.000399163511050922 0.014268554496454817 +< 1 -1 0 0 >: -0.000798327022101844 -0.028537108992909638 +< 2 -2 0 0 >: 0.000798327022101844 0.028537108992909649 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 1 ) +l=( 2 2 1 1 ) +num_ms=8 +< 0 0 0 0 >: 0.000076214838495211 -0.025166557601403610 +< 0 0 1 -1 >: -0.000152429676990421 0.050333115202807206 +< 1 -1 -1 1 >: 0.000152429676990421 -0.050333115202807220 +< 1 -1 0 0 >: -0.000152429676990421 0.050333115202807227 +< 1 -1 1 -1 >: 0.000152429676990421 -0.050333115202807220 +< 2 -2 -1 1 >: -0.000152429676990421 0.050333115202807227 +< 2 -2 0 0 >: 0.000152429676990421 -0.050333115202807241 +< 2 -2 1 -1 >: -0.000152429676990421 0.050333115202807227 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 0 2 1 1 ) +num_ms=4 +< 0 0 -1 1 >: -0.000115575459848796 0.008854089271594225 +< 0 0 0 0 >: -0.000115575459848796 0.008854089271594225 +< 0 1 -1 0 >: 0.000400365137132502 -0.030671464946303427 +< 0 2 -1 -1 >: -0.000283100903417075 0.021688000852456642 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 0 2 2 2 ) +num_ms=8 +< 0 -2 0 2 >: 0.003219841324988002 -0.222372484414000454 +< 0 -2 1 1 >: -0.001971742074736877 0.136174779912326516 +< 0 -1 -1 2 >: -0.001971742074736877 0.136174779912326516 +< 0 -1 0 1 >: 0.001609920662494000 -0.111186242207000158 +< 0 0 -2 2 >: 0.001609920662494000 -0.111186242207000158 +< 0 0 -1 1 >: 0.000804960331247000 -0.055593121103500079 +< 0 0 0 0 >: -0.000804960331247000 0.055593121103500079 +< 0 1 -2 1 >: -0.001971742074736877 0.136174779912326516 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: 0.000361033295246299 -0.003372423802545437 +< 1 -1 0 0 >: -0.000722066590492599 0.006744847605090873 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 1 1 0 2 ) +num_ms=4 +< -1 -1 0 2 >: -0.000852279449019880 0.003079773563530716 +< -1 0 0 1 >: 0.001205305155735783 -0.004355457542583255 +< -1 1 0 0 >: -0.000347941628059849 0.001257312292327214 +< 0 0 0 0 >: -0.000347941628059849 0.001257312292327214 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 1 1 1 1 ) +num_ms=6 +< -1 -1 1 1 >: 0.000146116709268971 -0.009867113533806938 +< -1 0 0 1 >: -0.000292233418537943 0.019734227067613876 +< -1 1 -1 1 >: -0.000053920014922944 0.013645083117420780 +< -1 1 0 0 >: 0.000100018362095957 -0.011756098325613858 +< 0 0 -1 1 >: 0.000100018362095957 -0.011756098325613858 +< 0 0 0 0 >: 0.000023049173586507 0.000944492395903464 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 1 1 2 2 ) +num_ms=11 +< -1 -1 0 2 >: -0.004364184410262559 0.116902449375929834 +< -1 -1 1 1 >: 0.002672506237138097 -0.071587837663142445 +< -1 0 -1 2 >: 0.003779494566087384 -0.101240490924179499 +< -1 0 0 1 >: -0.003085944390845268 0.082662514691037026 +< -1 1 -2 2 >: -0.001922680468440096 -0.070387973408986615 +< -1 1 -1 1 >: -0.000749825768698001 0.141975811072129032 +< -1 1 0 0 >: 0.000820330590538683 -0.082919211813254901 +< 0 0 -2 2 >: -0.001711166002918049 0.106781824367635753 +< 0 0 -1 1 >: -0.000961340234220048 -0.035193986704493307 +< 0 0 0 0 >: 0.000926087823299707 0.005665687075056245 +< 0 1 -2 1 >: 0.003779494566087384 -0.101240490924179499 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: -0.000138889360550470 0.000147685181843324 +< 1 -1 0 0 >: 0.000277778721100941 -0.000295370363686649 +< 2 -2 0 0 >: -0.000277778721100941 0.000295370363686649 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 2 2 0 2 ) +num_ms=7 +< -2 0 0 2 >: 0.003679465688564987 -0.157830328449144713 +< -2 1 0 1 >: -0.004506406731531289 0.193301885318140021 +< -2 2 0 0 >: 0.001839732844282494 -0.078915164224572384 +< -1 -1 0 2 >: -0.002253203365765644 0.096650942659070010 +< -1 0 0 1 >: 0.001839732844282493 -0.078915164224572343 +< -1 1 0 0 >: 0.000919866422141246 -0.039457582112286171 +< 0 0 0 0 >: -0.000919866422141246 0.039457582112286171 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 2 2 1 1 ) +num_ms=11 +< -2 1 0 1 >: 0.000183464638503149 -0.007191830649866146 +< -2 2 -1 1 >: 0.000172733037519855 -0.004317936006064334 +< -2 2 0 0 >: -0.000216095608753443 0.007244360224697774 +< -1 1 -1 1 >: -0.000302462127513371 0.009403328227729940 +< -1 1 0 0 >: 0.000086366518759928 -0.002158968003032168 +< -1 2 -1 0 >: 0.000183464638503149 -0.007191830649866146 +< 0 0 -1 1 >: 0.000172852578755604 -0.005549229484142570 +< 0 0 0 0 >: -0.000021561744381045 0.000231918631238483 +< 0 1 -1 0 >: -0.000149798250058962 0.005872105136226933 +< 0 2 -1 -1 >: -0.000211846716853141 0.008304410723332845 +< 1 1 -1 -1 >: 0.000129729089993515 -0.005085392221665607 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 1 2 2 ) +l=( 2 2 2 2 ) +num_ms=21 +< -2 -2 2 2 >: 0.001642650748657122 0.011687034584406454 +< -2 -1 1 2 >: -0.003285301497314243 -0.023374069168812905 +< -2 0 0 2 >: 0.003752712720853359 0.010171505506617327 +< -2 0 1 1 >: -0.000286229749430199 0.008084886067247495 +< -2 1 -1 2 >: -0.001993209166311457 -0.001785111837759770 +< -2 1 0 1 >: 0.000286229749430198 -0.008084886067247495 +< -2 2 -2 2 >: 0.003704563252236249 0.009294746160439746 +< -2 2 -1 1 >: -0.001711354085924791 -0.007509634322679977 +< -2 2 0 0 >: 0.000797250640020006 0.005405137619114435 +< -1 -1 0 2 >: -0.000286229749430199 0.008084886067247493 +< -1 -1 1 1 >: 0.001817929957484289 0.006736073211083109 +< -1 0 -1 2 >: 0.000143114874715099 -0.004042443033623748 +< -1 0 0 1 >: -0.003402154303199022 -0.020073428253264015 +< -1 1 -2 2 >: -0.001711354085924791 -0.007509634322679977 +< -1 1 -1 1 >: 0.003529284043409080 0.014245707533763086 +< -1 1 0 0 >: -0.000972529848847173 -0.000454176245791089 +< -1 2 -2 1 >: -0.001993209166311457 -0.001785111837759770 +< 0 0 -2 2 >: 0.000797250640020006 0.005405137619114435 +< 0 0 -1 1 >: -0.000972529848847173 -0.000454176245791089 +< 0 0 0 0 >: 0.001336803500223342 0.005245445186211549 +< 0 1 -2 1 >: 0.000143114874715099 -0.004042443033623748 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.077831243654351678 0.087134761468995028 +< 1 -1 0 >: 0.155662487308703329 -0.174269522937990001 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: 0.093879741204974443 -0.354998956968941126 +< -1 0 1 >: -0.132766003244151165 0.502044339573779363 +< -1 1 0 >: 0.038326243856120691 -0.144927717299024678 +< 0 0 0 >: 0.038326243856120698 -0.144927717299024705 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.042645803866773122 0.041017325383404461 +< 1 -1 0 >: 0.085291607733546243 -0.082034650766808936 +< 2 -2 0 >: -0.085291607733546271 0.082034650766808950 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 2 2 2 ) +num_ms=7 +< -2 0 2 >: 0.013535447720539140 -0.138163269103870084 +< -2 1 1 >: -0.016577470177719288 0.169214755249660870 +< -2 2 0 >: 0.006767723860269572 -0.069081634551935070 +< -1 -1 2 >: -0.008288735088859644 0.084607377624830435 +< -1 0 1 >: 0.006767723860269569 -0.069081634551935028 +< -1 1 0 >: 0.003383861930134784 -0.034540817275967514 +< 0 0 0 >: -0.003383861930134784 0.034540817275967514 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: 0.004053776574595621 0.024663695904383425 +< -2 -1 3 >: -0.005732905810623477 -0.034879733246224807 +< -2 0 2 >: 0.003753067832747749 0.022834145402956127 +< -2 1 1 >: -0.002166834723523838 -0.013183299995111777 +< -2 2 0 >: 0.000484518973780627 0.002947875495684258 +< -1 -1 2 >: 0.003064367053428369 0.018644001649920236 +< -1 0 1 >: -0.005307639429578066 -0.032292358114059817 +< -1 1 0 >: 0.001938075895122507 0.011791501982737033 +< 0 0 0 >: 0.001453556921341879 0.008843626487052772 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: -0.072008818150769691 -0.077610763262163152 +< -2 0 2 >: 0.101835847239276439 0.109758193991478722 +< -2 1 1 >: -0.111555581391203792 -0.120234077440321746 +< -2 2 0 >: 0.101835847239276439 0.109758193991478722 +< -1 -2 3 >: 0.113855938486653138 0.122713391426277629 +< -1 -1 2 >: -0.088192430725124768 -0.095053384270121083 +< -1 0 1 >: 0.032203322472908358 0.034708588487968033 +< -1 1 0 >: 0.032203322472908358 0.034708588487968033 +< 0 -3 3 >: -0.113855938486653124 -0.122713391426277615 +< 0 -1 1 >: 0.068313563091991866 0.073628034855766550 +< 0 0 0 >: -0.045542375394661251 -0.049085356570511045 +< 1 -3 2 >: 0.113855938486653138 0.122713391426277629 +< 1 -2 1 >: -0.088192430725124768 -0.095053384270121083 +< 2 -3 1 >: -0.072008818150769691 -0.077610763262163152 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.041628574037905194 -0.115819866613139630 +< 0 1 -1 >: 0.048068536853529645 -0.133737262333205376 +< 1 -2 1 >: -0.027752382691936788 0.077213244408759735 +< 1 -1 0 >: -0.078495591982210719 0.218392034875393187 +< 1 0 -1 >: -0.067979176741692557 0.189133050186267526 +< 2 -2 0 >: 0.062056214236759277 -0.172654063261292345 +< 2 -1 -1 >: 0.087760739803155310 -0.244169717862941948 +< 3 -2 -1 >: -0.107484515983446147 0.299045609701769410 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.019647915926264872 0.006553058011735113 +< 1 -1 0 >: 0.039295831852529745 -0.013106116023470227 +< 2 -2 0 >: -0.039295831852529745 0.013106116023470225 +< 3 -3 0 >: 0.039295831852529745 -0.013106116023470225 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 3 3 2 ) +num_ms=12 +< -3 1 2 >: 0.057340467918147182 -0.045385362560376334 +< -3 2 1 >: -0.090663240360579225 0.071760559061660206 +< -3 3 0 >: 0.090663240360579225 -0.071760559061660206 +< -2 1 1 >: 0.070227444005944717 -0.055585490032068766 +< -2 3 -1 >: -0.090663240360579225 0.071760559061660206 +< -1 1 0 >: -0.054397944216347520 0.043056335436996107 +< -1 2 -1 >: 0.070227444005944717 -0.055585490032068766 +< -1 3 -2 >: 0.057340467918147182 -0.045385362560376334 +< 0 0 0 >: 0.036265296144231692 -0.028704223624664082 +< 0 1 -1 >: -0.051286873650649191 0.040593902347390166 +< 0 2 -2 >: -0.162183334805326235 0.128369190532208660 +< 1 1 -2 >: 0.088831470924289904 -0.070310701343169274 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: 0.003922008927877927 0.243957419704823208 +< -3 0 3 >: -0.004803460319970515 -0.298785598621407578 +< -3 1 2 >: 0.004447140112688595 0.276621712726273117 +< -3 2 1 >: -0.003314702532479257 -0.206181651236121727 +< -3 3 0 >: 0.000907768674229195 0.056465170662843400 +< -2 -2 4 >: -0.002531645876891335 -0.157473837283418849 +< -2 -1 3 >: 0.002264372910274436 0.140848881937386178 +< -2 0 2 >: 0.001048200976856270 0.065200362964061578 +< -2 1 1 >: -0.003423410054912990 -0.212943493741612117 +< -2 2 0 >: 0.002118126906534788 0.131752064879967934 +< -1 -1 2 >: -0.001913744399410434 -0.119039031843136439 +< -1 0 1 >: 0.002343848638332305 0.145792443745301398 +< -1 1 0 >: 0.000302589558076398 0.018821723554281147 +< 0 0 0 >: -0.000907768674229195 -0.056465170662843400 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.016568155728426164 -0.040824130388153267 +< 0 1 -1 >: -0.020291763756807121 -0.049999144321912242 +< 1 -2 1 >: 0.014348443754673729 0.035354734003549007 +< 1 -1 0 >: 0.032084095606782777 0.079055588558358883 +< 1 0 -1 >: 0.026196554365096405 0.064548617761129065 +< 2 -3 1 >: -0.008284077864213084 -0.020412065194076640 +< 2 -2 0 >: -0.028696887509347471 -0.070709468007098042 +< 2 -1 -1 >: -0.032084095606782784 -0.079055588558358897 +< 3 -3 0 >: 0.021917609870202914 0.054005248248764154 +< 3 -2 -1 >: 0.037962413875664569 0.093539833842229678 +< 4 -3 -1 >: -0.043835219740405842 -0.108010496497528335 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.009257965839577923 0.060925918811764297 +< 1 -1 0 >: -0.018515931679155839 -0.121851837623528553 +< 2 -2 0 >: 0.018515931679155839 0.121851837623528553 +< 3 -3 0 >: -0.018515931679155839 -0.121851837623528553 +< 4 -4 0 >: 0.018515931679155842 0.121851837623528581 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 4 4 2 ) +num_ms=18 +< -4 2 2 >: -0.005929546252978678 -0.014690098804514934 +< -4 3 1 >: 0.011093165268837708 0.027482658352176177 +< -4 4 0 >: -0.012809283908256910 -0.031734240395350853 +< -3 1 2 >: 0.008894319379468017 0.022035148206772402 +< -3 2 1 >: -0.010482055912101265 -0.025968671202432257 +< -3 3 0 >: 0.003202320977064227 0.007933560098837710 +< -3 4 -1 >: 0.011093165268837708 0.027482658352176177 +< -2 1 1 >: 0.007131320529967096 0.017667423226398967 +< -2 2 0 >: 0.003659795402359118 0.009066925827243102 +< -2 3 -1 >: -0.010482055912101265 -0.025968671202432257 +< -2 4 -2 >: -0.005929546252978678 -0.014690098804514934 +< -1 1 0 >: -0.007777065230013124 -0.019267217382891586 +< -1 2 -1 >: 0.007131320529967096 0.017667423226398967 +< -1 3 -2 >: 0.008894319379468017 0.022035148206772402 +< 0 0 0 >: 0.004574744252948897 0.011333657284053876 +< 0 1 -1 >: -0.005011381244314461 -0.012415399507018088 +< 0 2 -2 >: -0.021261489965795004 -0.052674079095315664 +< 1 1 -2 >: 0.011205789123454617 0.027761677265509824 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 3 ) +l=( 4 4 4 ) +num_ms=19 +< -4 0 4 >: 0.011896638246535272 0.030366334707953697 +< -4 1 3 >: -0.018810236679061600 -0.048013390934078817 +< -4 2 2 >: 0.021328803580741063 0.054442068005355330 +< -4 3 1 >: -0.018810236679061603 -0.048013390934078824 +< -4 4 0 >: 0.005948319123267636 0.015183167353976849 +< -3 -1 4 >: -0.018810236679061596 -0.048013390934078810 +< -3 0 3 >: 0.017844957369802905 0.045549502061930543 +< -3 1 2 >: -0.007109601193580354 -0.018147356001785107 +< -3 2 1 >: -0.007109601193580355 -0.018147356001785110 +< -3 3 0 >: 0.008922478684901453 0.022774751030965268 +< -2 -2 4 >: 0.010664401790370530 0.027221034002677662 +< -2 -1 3 >: -0.007109601193580354 -0.018147356001785107 +< -2 0 2 >: -0.009347358622277714 -0.023859262984820762 +< -2 1 1 >: 0.016123060010624232 0.041154335086353279 +< -2 2 0 >: -0.004673679311138854 -0.011929631492410376 +< -1 -1 2 >: 0.008061530005312116 0.020577167543176639 +< -1 0 1 >: -0.007647838872772676 -0.019521215169398809 +< -1 1 0 >: -0.003823919436386337 -0.009760607584699401 +< 0 0 0 >: 0.003823919436386339 0.009760607584699406 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.003525841278372580 -0.076227387034227184 +< 1 -1 0 >: -0.007051682556745160 0.152454774068454341 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: -0.072040489156466325 0.465077453888616987 +< -1 0 1 >: 0.101880636805066579 -0.657718842843229901 +< -1 1 0 >: -0.029410406542307834 0.189867075483313941 +< 0 0 0 >: -0.029410406542307841 0.189867075483313968 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.030857467694981530 -0.079339768964250545 +< 1 -1 0 >: -0.061714935389963067 0.158679537928501119 +< 2 -2 0 >: 0.061714935389963081 -0.158679537928501146 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 2 2 2 ) +num_ms=7 +< -2 0 2 >: -0.103034978895394994 0.051697655988502171 +< -2 1 1 >: 0.126191561976075645 -0.063316439034884708 +< -2 2 0 >: -0.051517489447697511 0.025848827994251092 +< -1 -1 2 >: 0.063095780988037822 -0.031658219517442354 +< -1 0 1 >: -0.051517489447697483 0.025848827994251079 +< -1 1 0 >: -0.025758744723848741 0.012924413997125539 +< 0 0 0 >: 0.025758744723848741 -0.012924413997125539 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: 0.007561865329007393 -0.122486068160255923 +< -2 -1 3 >: -0.010694092505121145 0.173221458793989286 +< -2 0 2 >: 0.007000926913368222 -0.113400063844875651 +< -2 1 1 >: -0.004041987038010039 0.065471557386959714 +< -2 2 0 >: 0.000903815778116347 -0.014639885291002042 +< -1 -1 2 >: 0.005716232888090053 -0.092590764406326825 +< -1 0 1 >: -0.009900805790068150 0.160371908263398033 +< -1 1 0 >: 0.003615263112465390 -0.058559541164008175 +< 0 0 0 >: 0.002711447334349042 -0.043919655873006121 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: 0.057490550234226612 0.046711134765060294 +< -2 0 2 >: -0.081303915849535016 -0.066059520298585667 +< -2 1 1 >: 0.089063977448584256 0.072364578811011548 +< -2 2 0 >: -0.081303915849535016 -0.066059520298585667 +< -1 -2 3 >: -0.090900541338241381 -0.073856788974332344 +< -1 -1 2 >: 0.070411256552849577 0.057209222740388962 +< -1 0 1 >: -0.025710555677519436 -0.020889854528165702 +< -1 1 0 >: -0.025710555677519436 -0.020889854528165702 +< 0 -3 3 >: 0.090900541338241367 0.073856788974332330 +< 0 -1 1 >: -0.054540324802944809 -0.044314073384599389 +< 0 0 0 >: 0.036360216535296551 0.029542715589732933 +< 1 -3 2 >: -0.090900541338241381 -0.073856788974332344 +< 1 -2 1 >: 0.070411256552849577 0.057209222740388962 +< 2 -3 1 >: 0.057490550234226612 0.046711134765060294 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.033474215179731516 0.073809035014022292 +< 0 1 -1 >: -0.038652694289858874 0.085227332467944533 +< 1 -2 1 >: 0.022316143453154337 -0.049206023342681510 +< 1 -1 0 >: 0.063119585462628858 -0.139175651123334632 +< 1 0 -1 >: 0.054663164486979512 -0.120529649461047994 +< 2 -2 0 >: -0.049900413756890000 0.110028013096677313 +< 2 -1 -1 >: -0.070569841903022804 0.155603108362285580 +< 3 -2 -1 >: 0.086430051945642419 -0.190574108939298936 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.000004075443895903 0.116698363421342946 +< 1 -1 0 >: 0.000008150887791805 -0.233396726842685892 +< 2 -2 0 >: -0.000008150887791805 0.233396726842685864 +< 3 -3 0 >: 0.000008150887791805 -0.233396726842685864 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 3 3 2 ) +num_ms=12 +< -3 1 2 >: -0.036048849696384208 0.009668486778914418 +< -3 2 1 >: 0.056998236034821709 -0.015287219874297195 +< -3 3 0 >: -0.056998236034821702 0.015287219874297193 +< -2 1 1 >: -0.044150643785212808 0.011841429596592819 +< -2 3 -1 >: 0.056998236034821709 -0.015287219874297195 +< -1 1 0 >: 0.034198941620893014 -0.009172331924578314 +< -1 2 -1 >: -0.044150643785212808 0.011841429596592819 +< -1 3 -2 >: -0.036048849696384208 0.009668486778914418 +< 0 0 0 >: -0.022799294413928681 0.006114887949718878 +< 0 1 -1 >: 0.032243071372715100 -0.008647757470884249 +< 0 2 -2 >: 0.101961544297151582 -0.027346610260731471 +< 1 1 -2 >: -0.055846637809612146 0.014978355311104856 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: -0.013488971010532948 0.206467696043667576 +< -3 0 3 >: 0.016520548065500046 -0.252870251837519322 +< -3 1 2 >: -0.015295055458298488 0.234112361785722423 +< -3 2 1 >: 0.011400261241461535 -0.174497051775299727 +< -3 3 0 >: -0.003122090121700167 0.047787985737739284 +< -2 -2 4 >: 0.008707093346878121 -0.133274324717823217 +< -2 -1 3 >: -0.007787861044022256 0.119204179889773304 +< -2 0 2 >: -0.003605079144395725 0.055180812859427532 +< -2 1 1 >: 0.011774139181491847 -0.180219780130141144 +< -2 2 0 >: -0.007284876950633722 0.111505300054724990 +< -1 -1 2 >: 0.006581943896589877 -0.100745919815265386 +< -1 0 1 >: -0.008061202031135622 0.123388048607374540 +< -1 1 0 >: -0.001040696707233390 0.015929328579246439 +< 0 0 0 >: 0.003122090121700167 -0.047787985737739284 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.008380141684403685 -0.023364893579381544 +< 0 1 -1 >: 0.010263535549508285 -0.028616033581957814 +< 1 -2 1 >: -0.007257415586006507 0.020234591396464340 +< 1 -1 0 >: -0.016228074591277022 0.045245921859426670 +< 1 0 -1 >: -0.013250167418817790 0.036943140499144919 +< 2 -3 1 >: 0.004190070842201844 -0.011682446789690774 +< 2 -2 0 >: 0.014514831172013019 -0.040469182792928694 +< 2 -1 -1 >: 0.016228074591277026 -0.045245921859426677 +< 3 -3 0 >: -0.011085885424209038 0.030908848910266677 +< 3 -2 -1 >: -0.019201316801617317 0.053535696716051830 +< 4 -3 -1 >: 0.022171770848418083 -0.061817697820533375 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.003663090143367874 -0.072164658886293587 +< 1 -1 0 >: 0.007326180286735746 0.144329317772587118 +< 2 -2 0 >: -0.007326180286735746 -0.144329317772587118 +< 3 -3 0 >: 0.007326180286735746 0.144329317772587118 +< 4 -4 0 >: -0.007326180286735748 -0.144329317772587146 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 4 4 2 ) +num_ms=18 +< -4 2 2 >: 0.008588732417776062 0.018271910908865912 +< -4 3 1 >: -0.016068047046998310 -0.034183615211316749 +< -4 4 0 >: 0.018553782575872080 0.039471838888256609 +< -3 1 2 >: -0.012883098626664095 -0.027407866363298870 +< -3 2 1 >: 0.015182877336015459 0.032300480272238842 +< -3 3 0 >: -0.004638445643968018 -0.009867959722064149 +< -3 4 -1 >: -0.016068047046998310 -0.034183615211316749 +< -2 1 1 >: -0.010329458815927482 -0.021975181207275048 +< -2 2 0 >: -0.005301080735963453 -0.011277668253787605 +< -2 3 -1 >: 0.015182877336015459 0.032300480272238842 +< -2 4 -2 >: 0.008588732417776062 0.018271910908865912 +< -1 1 0 >: 0.011264796563922333 0.023965045039298652 +< -1 2 -1 >: -0.010329458815927482 -0.021975181207275048 +< -1 3 -2 >: -0.012883098626664095 -0.027407866363298870 +< 0 0 0 >: -0.006626350919954315 -0.014097085317234503 +< 0 1 -1 >: 0.007258803745608175 0.015442583246648416 +< 0 2 -2 >: 0.030796496110931115 0.065517331996457207 +< 1 1 -2 >: -0.016231178610509975 -0.034530665887705266 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 1 4 ) +l=( 4 4 4 ) +num_ms=19 +< -4 0 4 >: -0.000865745293242400 0.004697279271587992 +< -4 1 3 >: 0.001368863500108181 -0.007427050652057349 +< -4 2 2 >: -0.001552145314319865 0.008421483857153082 +< -4 3 1 >: 0.001368863500108181 -0.007427050652057350 +< -4 4 0 >: -0.000432872646621200 0.002348639635793996 +< -3 -1 4 >: 0.001368863500108181 -0.007427050652057348 +< -3 0 3 >: -0.001298617939863599 0.007045918907381987 +< -3 1 2 >: 0.000517381771439955 -0.002807161285717693 +< -3 2 1 >: 0.000517381771439955 -0.002807161285717694 +< -3 3 0 >: -0.000649308969931800 0.003522959453690993 +< -2 -2 4 >: -0.000776072657159932 0.004210741928576540 +< -2 -1 3 >: 0.000517381771439955 -0.002807161285717693 +< -2 0 2 >: 0.000680228444690457 -0.003690719427676279 +< -2 1 1 >: -0.001173311571521298 0.006366043416049158 +< -2 2 0 >: 0.000340114222345228 -0.001845359713838139 +< -1 -1 2 >: -0.000586655785760649 0.003183021708024579 +< -1 0 1 >: 0.000556550545655828 -0.003019679531735138 +< -1 1 0 >: 0.000278275272827914 -0.001509839765867569 +< 0 0 0 >: -0.000278275272827914 0.001509839765867569 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.006032080931175211 0.151129350255267830 +< 0 1 -1 >: -0.006032080931175210 0.151129350255267803 +< 1 -1 0 >: 0.010447870648162851 -0.261763713156996369 +< 1 0 -1 >: 0.010447870648162851 -0.261763713156996369 +< 2 -1 -1 >: -0.014775520368551681 0.370189793283764779 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.046178334643545510 0.143247010414325082 +< 0 1 -1 >: -0.053322147874359217 0.165407400046639341 +< 1 -2 1 >: 0.030785556429030327 -0.095498006942883351 +< 1 -1 0 >: 0.087074702854273864 -0.270109153196451346 +< 1 0 -1 >: 0.075408904698782503 -0.233921388462829477 +< 2 -2 0 >: -0.068838596900467508 0.213540035240034093 +< 2 -1 -1 >: -0.097352477351375644 0.301991213946084858 +< 3 -2 -1 >: 0.119231947353363149 -0.369862190485787501 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.060874691017562065 -0.029595270771200832 +< 0 1 -1 >: -0.081166254690082776 -0.039460361028267790 +< 0 2 -2 >: -0.020291563672520690 -0.009865090257066946 +< 1 -2 1 >: 0.045373315741521550 0.022059012418972568 +< 1 -1 0 >: 0.111141471504919542 0.054033324656200046 +< 1 0 -1 >: 0.111141471504919556 0.054033324656200053 +< 1 1 -2 >: 0.045373315741521550 0.022059012418972568 +< 2 -2 0 >: -0.078588888172180016 -0.038207330274453312 +< 2 -1 -1 >: -0.128335116982992853 -0.062392309070935084 +< 2 0 -2 >: -0.078588888172180058 -0.038207330274453326 +< 3 -2 -1 >: 0.120046509610478316 0.058362661028286779 +< 3 -1 -2 >: 0.120046509610478302 0.058362661028286772 +< 4 -2 -2 >: -0.169771402006690469 -0.082537266762386818 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.004809322860405252 -0.017106067831302731 +< 0 1 -1 >: -0.005890193508147660 -0.020950568846064662 +< 1 -2 1 >: 0.004164995772112190 0.014814289300767945 +< 1 -1 0 >: 0.009313213672442080 0.033125757914864960 +< 1 0 -1 >: 0.007604207120998307 0.027047068078126787 +< 2 -3 1 >: -0.002404661430202626 -0.008553033915651367 +< 2 -2 0 >: -0.008329991544224383 -0.029628578601535900 +< 2 -1 -1 >: -0.009313213672442082 -0.033125757914864960 +< 3 -3 0 >: 0.006362136131625050 0.022629200695914509 +< 3 -2 -1 >: 0.011019543024644305 0.039194925339996939 +< 4 -3 -1 >: -0.012724272263250106 -0.045258401391829031 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.001820359505609305 -0.038114414676048626 +< 0 1 -1 >: -0.000606786501869769 0.012704804892016220 +< 0 2 -2 >: -0.004247505513088378 0.088933634244113463 +< 0 3 -3 >: -0.001820359505609305 0.038114414676048626 +< 1 -3 2 >: 0.003323506546637227 -0.069587082280592627 +< 1 -2 1 >: 0.003432502801636616 -0.071869229542373486 +< 1 -1 0 >: -0.002350074016445069 0.049205497763593307 +< 1 0 -1 >: -0.002350074016445068 0.049205497763593294 +< 1 1 -2 >: 0.003432502801636615 -0.071869229542373472 +< 1 2 -3 >: 0.003323506546637228 -0.069587082280592641 +< 2 -3 1 >: -0.004458951937167850 0.093360867801165759 +< 2 -2 0 >: -0.001050985050585426 0.022005367573221690 +< 2 -1 -1 >: 0.003837654798708974 -0.080352241373641595 +< 2 0 -2 >: -0.001050985050585426 0.022005367573221694 +< 2 1 -3 >: -0.004458951937167850 0.093360867801165745 +< 3 -3 0 >: 0.004816218548574709 -0.100841262599615136 +< 3 -2 -1 >: -0.002270387196915739 0.047537027071734163 +< 3 -1 -2 >: -0.002270387196915739 0.047537027071734156 +< 3 0 -3 >: 0.004816218548574710 -0.100841262599615150 +< 4 -3 -1 >: -0.003932425977911945 0.082336546129020735 +< 4 -2 -2 >: 0.005076740107548792 -0.106296023980645332 +< 4 -1 -3 >: -0.003932425977911945 0.082336546129020735 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 1 1 ) +l=( 2 1 1 0 ) +num_ms=5 +< 0 0 0 0 >: -0.000065408670341292 -0.004809311015566168 +< 0 1 -1 0 >: -0.000065408670341292 -0.004809311015566167 +< 1 -1 0 0 >: 0.000113291140286642 0.008329971028361279 +< 1 0 -1 0 >: 0.000113291140286642 0.008329971028361279 +< 2 -1 -1 0 >: -0.000160217867090082 -0.011780358002483480 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 1 2 ) +l=( 2 1 1 0 ) +num_ms=5 +< 0 0 0 0 >: -0.000023351324155048 -0.011751894790749902 +< 0 1 -1 0 >: -0.000023351324155048 -0.011751894790749900 +< 1 -1 0 0 >: 0.000040445679860554 0.020354878862782852 +< 1 0 -1 0 >: 0.000040445679860554 0.020354878862782852 +< 2 -1 -1 0 >: -0.000057198828998196 -0.028786145748208952 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 2 1 1 ) +num_ms=4 +< 0 -1 1 >: 0.017629754203650469 -0.090933532602500491 +< 0 0 0 >: 0.017629754203650472 -0.090933532602500505 +< 1 -1 0 >: -0.061071260011347224 0.315002997158503717 +< 2 -1 -1 >: 0.043183902089630445 -0.222740755384864708 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 2 2 2 ) +num_ms=8 +< -2 0 2 >: 0.120496386283590121 0.154444853460479925 +< -2 1 1 >: -0.073788665561023384 -0.094577771094274135 +< -1 -1 2 >: -0.073788665561023384 -0.094577771094274135 +< -1 0 1 >: 0.060248193141795026 0.077222426730239921 +< 0 -2 2 >: 0.060248193141795026 0.077222426730239921 +< 0 -1 1 >: 0.030124096570897513 0.038611213365119960 +< 0 0 0 >: -0.030124096570897513 -0.038611213365119960 +< 1 -2 1 >: -0.073788665561023384 -0.094577771094274135 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: 0.002020661438639850 -0.038631160094535065 +< -2 0 2 >: -0.005715293622977614 0.109265421071795613 +< -2 1 1 >: 0.003130395240070265 -0.059847135876322753 +< -1 -2 3 >: -0.003194946263087248 0.061081227276668197 +< -1 -1 2 >: 0.002474794733792907 -0.047313315201689243 +< -1 0 1 >: -0.001807334534524490 0.034552760008423049 +< 0 -3 3 >: 0.003194946263087247 -0.061081227276668190 +< 0 -1 1 >: -0.001916967757852348 0.036648736366000904 +< 0 0 0 >: 0.001277978505234899 -0.024432490910667279 +< 1 -3 2 >: -0.003194946263087248 0.061081227276668197 +< 1 -2 1 >: 0.002474794733792907 -0.047313315201689243 +< 2 -3 1 >: 0.002020661438639850 -0.038631160094535065 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: -0.021795450007540320 0.034414313308814622 +< -2 -1 3 >: 0.032693175011310478 -0.051621469963221929 +< -2 0 2 >: -0.078151636206989131 0.123398915511877802 +< -2 1 1 >: 0.041189528880494666 -0.065036938968702745 +< -1 -3 4 >: 0.040775553259387698 -0.064383284801339494 +< -1 -2 3 >: -0.038529276248360361 0.060836485776353151 +< -1 -1 2 >: 0.026212855666749229 -0.041389254515146807 +< -1 0 1 >: -0.018420517307595374 0.029085403316504877 +< 0 -4 4 >: -0.047083553301326797 0.074343413622731364 +< 0 -3 3 >: 0.011770888325331696 -0.018585853405682834 +< 0 -2 2 >: 0.013452443800379089 -0.021240975320780394 +< 0 -1 1 >: -0.028586443075805552 0.045137072556658317 +< 0 0 0 >: 0.016815554750473857 -0.026551219150975486 +< 1 -4 3 >: 0.040775553259387698 -0.064383284801339494 +< 1 -3 2 >: -0.038529276248360361 0.060836485776353151 +< 1 -2 1 >: 0.026212855666749229 -0.041389254515146807 +< 2 -4 2 >: -0.021795450007540320 0.034414313308814622 +< 2 -3 1 >: 0.032693175011310478 -0.051621469963221929 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.039354261819319843 -0.073096770197199665 +< 0 1 -1 >: 0.045442387310286624 -0.084404879900490851 +< 1 -2 1 >: -0.026236174546213218 0.048731180131466427 +< 1 -1 0 >: -0.074207107736085048 0.137832591704732305 +< 1 0 -1 >: -0.064265240440818369 0.119366525885746422 +< 2 -2 0 >: 0.058665869754882465 -0.108966231397746097 +< 2 -1 -1 >: 0.082966068655768332 -0.154101522283377507 +< 3 -2 -1 >: -0.101612267085674737 0.188735049090203250 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: 0.035522450263794123 -0.065388831263795730 +< -3 1 2 >: -0.035522450263794123 0.065388831263795730 +< -3 2 1 >: 0.022466370180727707 -0.041355528066004198 +< -2 -1 3 >: -0.035522450263794123 0.065388831263795730 +< -2 1 1 >: 0.027515571657631192 -0.050649970902529567 +< -1 -2 3 >: 0.022466370180727707 -0.041355528066004198 +< -1 -1 2 >: 0.027515571657631192 -0.050649970902529567 +< -1 0 1 >: -0.021313470158276469 0.039233298758277427 +< 0 -2 2 >: -0.031772245406879618 0.058485548670044331 +< 0 -1 1 >: -0.010047266186356280 0.018494754400197162 +< 0 0 0 >: 0.014208980105517650 -0.026155532505518293 +< 1 -2 1 >: 0.034804751023875737 -0.064067708589299083 +< 1 -1 0 >: -0.010047266186356280 0.018494754400197162 +< 2 -2 0 >: -0.031772245406879618 0.058485548670044331 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 4 2 2 ) +num_ms=9 +< 0 -2 2 >: 0.001098074194541128 0.019308485265777532 +< 0 -1 1 >: 0.004392296778164512 0.077233941063110143 +< 0 0 0 >: 0.003294222583623383 0.057925455797332583 +< 1 -2 1 >: -0.004910737086664580 -0.086350171193663311 +< 1 -1 0 >: -0.012028800123289836 -0.211513858626449752 +< 2 -2 0 >: 0.008505646136715820 0.149562883749695313 +< 2 -1 -1 >: 0.006944830989209591 0.122117583215317224 +< 3 -2 -1 >: -0.012992589085336324 -0.228461078646286619 +< 4 -2 -2 >: 0.009187147847411635 0.161546377947982378 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.003364811381474099 -0.039670949390755453 +< 0 1 -1 >: -0.004121035482660451 -0.048586791809563025 +< 1 -2 1 >: 0.002914012135299582 0.034356049964641026 +< 1 -1 0 >: 0.006515929221789180 0.076822463159316581 +< 1 0 -1 >: 0.005320233931157922 0.062725278508028157 +< 2 -3 1 >: -0.001682405690737050 -0.019835474695377730 +< 2 -2 0 >: -0.005828024270599166 -0.068712099929282067 +< 2 -1 -1 >: -0.006515929221789181 -0.076822463159316595 +< 3 -3 0 >: 0.004451227062010077 0.052479733180884128 +< 3 -2 -1 >: 0.007709751427426998 0.090897564236949599 +< 4 -3 -1 >: -0.008902454124020158 -0.104959466361768297 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 4 3 3 ) +num_ms=14 +< 0 -3 3 >: 0.000225437443465702 0.004175983593506603 +< 0 -2 2 >: 0.000526020701419971 0.009743961718182073 +< 0 -1 1 >: 0.000075145814488567 0.001391994531168869 +< 0 0 0 >: -0.000225437443465702 -0.004175983593506603 +< 1 -3 2 >: -0.000823181153949737 -0.015248536092900333 +< 1 -2 1 >: -0.000850177840042436 -0.015748620357825524 +< 1 -1 0 >: 0.000582076976102827 0.010782343274457651 +< 2 -3 1 >: 0.001104413410816999 0.020458057956650524 +< 2 -2 0 >: 0.000260312737340688 0.004822010503684995 +< 2 -1 -1 >: -0.000475263860824708 -0.008803746417983734 +< 3 -3 0 >: -0.001192902823224861 -0.022097228135008629 +< 3 -2 -1 >: 0.000562339783732584 0.010416733239793845 +< 4 -3 -1 >: 0.000974001076542131 0.018042311220214498 +< 4 -2 -2 >: -0.000628714991439295 -0.011646261813830326 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 2 ) +l=( 4 4 4 ) +num_ms=25 +< -4 0 4 >: 0.037780855057295837 -0.000045677834222940 +< -4 1 3 >: -0.059736776964873076 0.000072222997364039 +< -4 2 2 >: 0.033867569137196990 -0.000040946590706769 +< -3 -1 4 >: -0.029868388482436531 0.000036111498682019 +< -3 0 3 >: 0.056671282585943734 -0.000068516751334410 +< -3 1 2 >: -0.022578379424797991 0.000027297727137846 +< -2 -2 4 >: 0.033867569137196983 -0.000040946590706769 +< -2 -1 3 >: -0.011289189712398996 0.000013648863568923 +< -2 0 2 >: -0.029684957545018140 0.000035889726889453 +< -2 1 1 >: 0.025601475842088453 -0.000030952713156017 +< -1 -3 4 >: -0.029868388482436517 0.000036111498682019 +< -1 -2 3 >: -0.011289189712398992 0.000013648863568923 +< -1 -1 2 >: 0.025601475842088457 -0.000030952713156017 +< -1 0 1 >: -0.024287692536833033 0.000029364322000461 +< 0 -4 4 >: 0.018890427528647915 -0.000022838917111470 +< 0 -3 3 >: 0.028335641292971878 -0.000034258375667205 +< 0 -2 2 >: -0.014842478772509082 0.000017944863444726 +< 0 -1 1 >: -0.012143846268416520 0.000014682161000231 +< 0 0 0 >: 0.012143846268416521 -0.000014682161000231 +< 1 -4 3 >: -0.029868388482436517 0.000036111498682019 +< 1 -3 2 >: -0.011289189712398992 0.000013648863568923 +< 1 -2 1 >: 0.025601475842088457 -0.000030952713156017 +< 2 -4 2 >: 0.033867569137196983 -0.000040946590706769 +< 2 -3 1 >: -0.011289189712398996 0.000013648863568923 +< 3 -4 1 >: -0.029868388482436531 0.000036111498682019 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 2 2 ) +l=( 0 1 1 2 ) +num_ms=4 +< 0 -1 -1 2 >: 0.000320036471237378 -0.009099011397214153 +< 0 -1 0 1 >: -0.000452599918077926 0.012867945322127617 +< 0 -1 1 0 >: 0.000130654342268747 -0.003714655847823882 +< 0 0 0 0 >: 0.000130654342268747 -0.003714655847823883 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 2 2 ) +l=( 0 2 2 2 ) +num_ms=5 +< 0 -2 0 2 >: -0.001100000042281807 0.073412066188337413 +< 0 -2 1 1 >: 0.000898146273543449 -0.059940701041617410 +< 0 -1 -1 2 >: 0.000449073136771725 -0.029970350520808705 +< 0 -1 0 1 >: -0.000550000021140903 0.036706033094168693 +< 0 0 0 0 >: 0.000183333340380301 -0.012235344364722898 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 2 2 ) +l=( 1 1 1 1 ) +num_ms=2 +< -1 -1 1 1 >: -0.000000000000114814 0.000000000000002808 +< 1 -1 -1 1 >: 0.000000000000114814 -0.000000000000002808 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 2 2 ) +l=( 1 1 2 2 ) +num_ms=16 +< -1 -1 0 2 >: 0.000357500900835941 0.004881002808116767 +< -1 -1 1 1 >: -0.000218923697408346 -0.002988991578244476 +< -1 0 -1 2 >: -0.000154802431010495 -0.002113536211060421 +< -1 0 0 1 >: 0.000126395655630697 0.001725695092304972 +< -1 1 -2 2 >: 0.000072974565817804 0.000996330522085308 +< -1 1 -1 1 >: 0.000036487282893880 0.000498165265038838 +< -1 1 0 0 >: -0.000072974565802782 -0.000996330526081492 +< 0 -1 -1 2 >: -0.000154802430989251 -0.002113536216711879 +< 0 -1 0 1 >: 0.000126395655630697 0.001725695092304972 +< 0 0 -2 2 >: 0.000145949131605564 0.001992661052162984 +< 0 0 -1 1 >: 0.000072974565802782 0.000996330526081492 +< 0 0 0 0 >: -0.000072974565802782 -0.000996330526081492 +< 0 1 -2 1 >: -0.000154802431010495 -0.002113536211060421 +< 1 -1 -2 2 >: 0.000072974565787760 0.000996330530077676 +< 1 -1 -1 1 >: 0.000036487282908902 0.000498165261042654 +< 1 0 -2 1 >: -0.000154802430989251 -0.002113536216711879 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 2 2 ) +l=( 2 0 1 1 ) +num_ms=4 +< 0 0 -1 1 >: 0.000068593145415220 -0.004344525164863466 +< 0 0 0 0 >: 0.000068593145415220 -0.004344525164863467 +< 1 0 -1 0 >: -0.000237613625820242 0.015049876640610154 +< 2 0 -1 -1 >: 0.000168018206119816 -0.010641869828596459 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 2 2 ) +l=( 2 0 2 2 ) +num_ms=8 +< -2 0 0 2 >: -0.002486022037894315 0.105169540284253848 +< -2 0 1 1 >: 0.001522371370538764 -0.064402927544875491 +< -1 0 -1 2 >: 0.001522371370538764 -0.064402927544875491 +< -1 0 0 1 >: -0.001243011018947157 0.052584770142126890 +< 0 0 -2 2 >: -0.001243011018947157 0.052584770142126890 +< 0 0 -1 1 >: -0.000621505509473579 0.026292385071063445 +< 0 0 0 0 >: 0.000621505509473579 -0.026292385071063445 +< 1 0 -2 1 >: 0.001522371370538764 -0.064402927544875491 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 2 2 ) +l=( 2 1 1 2 ) +num_ms=13 +< -2 -1 1 2 >: -0.000143002816486277 0.006718120187445183 +< -2 0 0 2 >: 0.000279983781678076 -0.012447391776107240 +< -2 0 1 1 >: -0.000294838600027421 0.012852841924573460 +< -1 -1 0 2 >: -0.000294838600027421 0.012852841924573460 +< -1 -1 1 1 >: 0.000351485189921215 -0.015806451869829829 +< -1 0 0 1 >: -0.000071501408243138 0.003359060093722592 +< 0 -1 -1 2 >: 0.000170225145093324 -0.007420591745004197 +< 0 -1 0 1 >: 0.000120367354423953 -0.005247150743309381 +< 0 -1 1 0 >: -0.000210489657199764 0.009417947881979020 +< 0 0 0 0 >: 0.000001003641882413 -0.000164808099797187 +< 1 -1 -1 1 >: -0.000208482373434938 0.009088331682384650 +< 1 -1 0 0 >: 0.000120367354423953 -0.005247150743309381 +< 2 -1 -1 0 >: 0.000170225145093324 -0.007420591745004197 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 1 2 2 2 ) +l=( 2 2 2 2 ) +num_ms=12 +< -2 -2 2 2 >: 0.000000000000004360 0.000000000000028454 +< -2 -1 1 2 >: -0.000000000000004360 -0.000000000000028454 +< -1 -2 1 2 >: -0.000000000000004360 -0.000000000000028454 +< -1 -1 0 2 >: 0.000000000000001506 -0.000000000000040996 +< -1 -1 1 1 >: 0.000000000000002516 0.000000000000078663 +< 0 -2 1 1 >: 0.000000000000001506 -0.000000000000040996 +< 0 -1 -1 2 >: -0.000000000000001506 0.000000000000040996 +< 1 -2 -1 2 >: 0.000000000000004360 0.000000000000028454 +< 1 -2 0 1 >: -0.000000000000001506 0.000000000000040996 +< 1 -1 -1 1 >: -0.000000000000002516 -0.000000000000078663 +< 2 -2 -2 2 >: -0.000000000000004360 -0.000000000000028454 +< 2 -2 -1 1 >: 0.000000000000004360 0.000000000000028454 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 3 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: 0.022445003465771395 -0.028678602089656006 +< -2 0 2 >: -0.031742028308805043 0.040557668025092926 +< -2 1 1 >: 0.034771649851400160 -0.044428699314298783 +< -2 2 0 >: -0.031742028308805043 0.040557668025092926 +< -1 -2 3 >: -0.035488666521105362 0.045344851356488684 +< -1 -1 2 >: 0.027489402883069964 -0.035123970827986309 +< -1 0 1 >: -0.010037710700936646 0.012825460754427673 +< -1 1 0 >: -0.010037710700936646 0.012825460754427673 +< 0 -3 3 >: 0.035488666521105355 -0.045344851356488684 +< 0 -1 1 >: -0.021293199912663211 0.027206910813893204 +< 0 0 0 >: 0.014195466608442144 -0.018137940542595474 +< 1 -3 2 >: -0.035488666521105362 0.045344851356488684 +< 1 -2 1 >: 0.027489402883069964 -0.035123970827986309 +< 2 -3 1 >: 0.022445003465771395 -0.028678602089656006 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.003909118032464789 -0.065474700467181915 +< 0 1 -1 >: -0.004513860696675130 -0.075603671879675149 +< 1 -2 1 >: 0.002606078688309858 0.043649800311454594 +< 1 -1 0 >: 0.007371103651238577 0.123460279190672900 +< 1 0 -1 >: 0.006383563015900836 0.106919738137441989 +< 2 -2 0 >: -0.005827369101774331 -0.097603920700703978 +< 2 -1 -1 >: -0.008241144416683178 -0.138032788395723638 +< 3 -2 -1 >: 0.010093299358730152 0.169054949671542970 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 3 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: 0.114994567612826615 0.116868257509743459 +< -3 1 2 >: -0.114994567612826615 -0.116868257509743459 +< -3 2 1 >: 0.072728950440552789 0.073913975981173455 +< -2 -1 3 >: -0.114994567612826615 -0.116868257509743459 +< -2 1 1 >: 0.089074409053760087 0.090525763007103299 +< -1 -2 3 >: 0.072728950440552789 0.073913975981173455 +< -1 -1 2 >: 0.089074409053760087 0.090525763007103299 +< -1 0 1 >: -0.068996740567695947 -0.070120954505846059 +< 0 -2 2 >: -0.102854268090190465 -0.104530147281494720 +< 0 -1 1 >: -0.032525375423457868 -0.033055334956238115 +< 0 0 0 >: 0.045997827045130647 0.046747303003897386 +< 1 -2 1 >: 0.112671205537362235 0.114507039210823947 +< 1 -1 0 >: -0.032525375423457868 -0.033055334956238115 +< 2 -2 0 >: -0.102854268090190465 -0.104530147281494720 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 3 ) +l=( 3 3 2 ) +num_ms=14 +< -3 1 2 >: -0.018663326793617287 -0.075821938916878287 +< -3 2 1 >: 0.029509310691938944 0.119885011793747803 +< -3 3 0 >: -0.029509310691938941 -0.119885011793747789 +< -2 1 1 >: -0.022857813773588007 -0.092862530827413026 +< -2 3 -1 >: 0.029509310691938944 0.119885011793747803 +< -1 1 0 >: 0.017705586415163361 0.071931007076248651 +< -1 2 -1 >: -0.022857813773588007 -0.092862530827413026 +< -1 3 -2 >: -0.018663326793617287 -0.075821938916878287 +< 0 0 0 >: -0.011803724276775576 -0.047954004717499117 +< 0 1 -1 >: 0.008346493479364291 0.033908601920795332 +< 0 2 -2 >: 0.026393929870534748 0.107228414341673683 +< 1 0 -1 >: 0.008346493479364291 0.033908601920795332 +< 1 1 -2 >: -0.028913101542602578 -0.117462842680890273 +< 2 0 -2 >: 0.026393929870534748 0.107228414341673683 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.015960834663241177 -0.027940446653430408 +< 0 1 -1 >: 0.019547950396933734 -0.034219918743179180 +< 1 -2 1 >: -0.013822488283970105 0.024197136594954639 +< 1 -1 0 >: -0.030908023421151579 0.054106442287166372 +< 1 0 -1 >: -0.025236295446604332 0.044177725133634660 +< 2 -3 1 >: 0.007980417331620590 -0.013970223326715207 +< 2 -2 0 >: 0.027644976567940221 -0.048394273189909291 +< 2 -1 -1 >: 0.030908023421151582 -0.054106442287166379 +< 3 -3 0 >: -0.021114199617977752 0.036961736682521874 +< 3 -2 -1 >: -0.036570866499488860 0.064019605870110227 +< 4 -3 -1 >: 0.042228399235955519 -0.073923473365043776 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 4 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: -0.019034907164356060 -0.004788559928114240 +< -2 0 2 >: 0.026919423870345141 0.006772046394575493 +< -2 1 1 >: -0.029488751377662114 -0.007418405141561056 +< -2 2 0 >: 0.026919423870345141 0.006772046394575493 +< -1 -2 3 >: 0.030096830844611094 0.007571378042526579 +< -1 -1 2 >: -0.023312904926960101 -0.005864764213309192 +< -1 0 1 >: 0.008512669272979584 0.002141509102718990 +< -1 1 0 >: 0.008512669272979584 0.002141509102718990 +< 0 -3 3 >: -0.030096830844611091 -0.007571378042526578 +< 0 -1 1 >: 0.018058098506766651 0.004542826825515945 +< 0 0 0 >: -0.012038732337844436 -0.003028551217010631 +< 1 -3 2 >: 0.030096830844611094 0.007571378042526579 +< 1 -2 1 >: -0.023312904926960101 -0.005864764213309192 +< 2 -3 1 >: -0.019034907164356060 -0.004788559928114240 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.004494209735994228 0.105381182914565316 +< 0 1 -1 >: 0.005189466401741807 0.121683708646490904 +< 1 -2 1 >: -0.002996139823996151 -0.070254121943043521 +< 1 -1 0 >: -0.008474363147722992 -0.198708664128930873 +< 1 0 -1 >: -0.007339013766822769 -0.172086751087723699 +< 2 -2 0 >: 0.006699572316549651 0.157092992364204959 +< 2 -1 -1 >: 0.009474626032163850 0.222163040355231683 +< 3 -2 -1 >: -0.011603999641245916 -0.272093044287832653 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 4 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: -0.108583709135183393 0.020736957145319656 +< -3 1 2 >: 0.108583709135183407 -0.020736957145319659 +< -3 2 1 >: -0.068674367531282338 0.013115203264102683 +< -2 -1 3 >: 0.108583709135183407 -0.020736957145319659 +< -2 1 1 >: -0.084108579429999122 0.016062777934967992 +< -1 -2 3 >: -0.068674367531282338 0.013115203264102683 +< -1 -1 2 >: -0.084108579429999122 0.016062777934967992 +< -1 0 1 >: 0.065150225481110019 -0.012442174287191791 +< 0 -2 2 >: 0.097120221950134047 -0.018547698329373908 +< 0 -1 1 >: 0.030712110822350355 -0.005865297207452147 +< 0 0 0 >: -0.043433483654073360 0.008294782858127863 +< 1 -2 1 >: -0.106389872703993582 0.020317985529597946 +< 1 -1 0 >: 0.030712110822350355 -0.005865297207452147 +< 2 -2 0 >: 0.097120221950134047 -0.018547698329373908 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 4 ) +l=( 3 3 2 ) +num_ms=14 +< -3 1 2 >: 0.016480307505388939 0.058759687309151966 +< -3 2 1 >: -0.026057654128498350 -0.092907223248105325 +< -3 3 0 >: 0.026057654128498347 0.092907223248105311 +< -2 1 1 >: 0.020184172096181417 0.071965625676457326 +< -2 3 -1 >: -0.026057654128498350 -0.092907223248105325 +< -1 1 0 >: -0.015634592477099005 -0.055744333948863176 +< -1 2 -1 >: 0.020184172096181417 0.071965625676457326 +< -1 3 -2 >: 0.016480307505388939 0.058759687309151966 +< 0 0 0 >: 0.010423061651399340 0.037162889299242129 +< 0 1 -1 >: -0.007370217574429931 -0.026278131031979103 +< 0 2 -2 >: -0.023306674386200155 -0.083098746713404975 +< 1 0 -1 >: -0.007370217574429931 -0.026278131031979103 +< 1 1 -2 >: 0.025531182603499389 0.091030116150680365 +< 2 0 -2 >: -0.023306674386200155 -0.083098746713404975 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 2 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.011735387748534349 0.046335658991316926 +< 0 1 -1 >: -0.014372855958809133 0.056749360712164972 +< 1 -2 1 >: 0.010163143913491416 -0.040127857787573294 +< 1 -1 0 >: 0.022725480655680048 -0.089728617804458219 +< 1 0 -1 >: 0.018555277255301931 -0.073263109648710786 +< 2 -3 1 >: -0.005867693874267176 0.023167829495658467 +< 2 -2 0 >: -0.020326287826982838 0.080255715575146616 +< 2 -1 -1 >: -0.022725480655680051 0.089728617804458233 +< 3 -3 0 >: 0.015524458760768045 -0.061296315262659266 +< 3 -2 -1 >: 0.026889151333658032 -0.106168332351685518 +< 4 -3 -1 >: -0.031048917521536101 0.122592630525318574 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.016074341813435620 -0.076988436962834667 +< 0 1 -1 >: 0.016074341813435616 -0.076988436962834653 +< 1 -1 0 >: -0.027841576719099339 0.133347884414943385 +< 1 0 -1 >: -0.027841576719099339 0.133347884414943385 +< 2 -1 -1 >: 0.039373935394001296 -0.188582386653372791 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.021681852163816049 0.144948481443401556 +< 0 1 -1 >: 0.025036046366617718 0.167372089559950643 +< 1 -2 1 >: -0.014454568109210694 -0.096632320962267662 +< 1 -1 0 >: -0.040883692516582790 -0.273317477736857828 +< 1 0 -1 >: -0.035406316319872427 -0.236699879018406500 +< 2 -2 0 >: 0.032321396877595721 0.216076438495208439 +< 2 -1 -1 >: 0.045709357819139269 0.305578229829199632 +< 3 -2 -1 >: -0.055982301563593850 -0.374255369792232562 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.003824450171526099 -0.001296334662190527 +< 0 1 -1 >: 0.005099266895368134 -0.001728446216254036 +< 0 2 -2 >: 0.001274816723842033 -0.000432111554063509 +< 1 -2 1 >: -0.002850576853364363 0.000966230808749082 +< 1 -1 0 >: -0.006982458763331155 0.002366772455191970 +< 1 0 -1 >: -0.006982458763331156 0.002366772455191971 +< 1 1 -2 >: -0.002850576853364363 0.000966230808749082 +< 2 -2 0 >: 0.004937343940906893 -0.001673560852591776 +< 2 -1 -1 >: 0.008062648893229409 -0.002732913428231351 +< 2 0 -2 >: 0.004937343940906894 -0.001673560852591776 +< 3 -2 -1 >: -0.007541917447079142 0.002556406429038884 +< 3 -1 -2 >: -0.007541917447079141 0.002556406429038883 +< 4 -2 -2 >: 0.010665881939957590 -0.003615304642884561 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000693579002525661 0.141853933592052839 +< 0 1 -1 >: 0.000849457326248198 0.173734877653589748 +< 1 -2 1 >: -0.000600657035718694 -0.122849110117468505 +< 1 -1 0 >: -0.001343109963030520 -0.274698961198016789 +< 1 0 -1 >: -0.001096644692624383 -0.224290762602578686 +< 2 -3 1 >: 0.000346789501262831 0.070926966796026433 +< 2 -2 0 >: 0.001201314071437389 0.245698220234937093 +< 2 -1 -1 >: 0.001343109963030520 0.274698961198016789 +< 3 -3 0 >: -0.000917518777629570 -0.187655115390421567 +< 3 -2 -1 >: -0.001589189139752906 -0.325028194156410655 +< 4 -3 -1 >: 0.001835037555259140 0.375310230780843246 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.002611489685934477 -0.008214556580714625 +< 0 1 -1 >: 0.000870496561978160 0.002738185526904878 +< 0 2 -2 >: 0.006093475933847112 0.019167298688334129 +< 0 3 -3 >: 0.002611489685934477 0.008214556580714625 +< 1 -3 2 >: -0.004767906032261314 -0.014997659797199688 +< 1 -2 1 >: -0.004924272175794656 -0.015489516433770379 +< 1 -1 0 >: 0.003371418687472223 0.010604946944528766 +< 1 0 -1 >: 0.003371418687472221 0.010604946944528761 +< 1 1 -2 >: -0.004924272175794655 -0.015489516433770376 +< 1 2 -3 >: -0.004767906032261315 -0.014997659797199692 +< 2 -3 1 >: 0.006396817199080564 0.020121472085972536 +< 2 -2 0 >: 0.001507744273160201 0.004742676453149000 +< 2 -1 -1 >: -0.005505503662393822 -0.017317805842255340 +< 2 0 -2 >: 0.001507744273160201 0.004742676453149000 +< 2 1 -3 >: 0.006396817199080564 0.020121472085972536 +< 3 -3 0 >: -0.006909352260392797 -0.021733673843239983 +< 3 -2 -1 >: 0.003257099891286899 0.010245352103101126 +< 3 -1 -2 >: 0.003257099891286898 0.010245352103101124 +< 3 0 -3 >: -0.006909352260392798 -0.021733673843239987 +< 4 -3 -1 >: 0.005641462497035975 0.017745470384003797 +< 4 -2 -2 >: -0.007283096766424677 -0.022909303755954541 +< 4 -1 -3 >: 0.005641462497035975 0.017745470384003797 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 2 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.003912935032967597 0.008270316149055911 +< 0 1 -1 >: -0.003912935032967597 0.008270316149055910 +< 1 -1 0 >: 0.006777402283816078 -0.014324607764822219 +< 1 0 -1 >: 0.006777402283816078 -0.014324607764822219 +< 2 -1 -1 >: -0.009584694227431086 0.020258054576686526 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.023188891044067617 0.009202290289687139 +< 0 1 -1 >: -0.026776224973002669 0.010625889551823893 +< 1 -2 1 >: 0.015459260696045071 -0.006134860193124757 +< 1 -1 0 >: 0.043725392281216559 -0.017352004976759719 +< 1 0 -1 >: 0.037867300505973533 -0.015027277116467919 +< 2 -2 0 >: -0.034567957798247499 0.013717964424284447 +< 2 -1 -1 >: -0.048886474741822408 0.019400131336974692 +< 3 -2 -1 >: 0.059873459220461445 -0.023760211359283002 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 2 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.034192908607169961 -0.017877247109522633 +< 0 1 -1 >: 0.045590544809559964 -0.023836329479363517 +< 0 2 -2 >: 0.011397636202389989 -0.005959082369840879 +< 1 -2 1 >: -0.025485889331356565 0.013324913262484746 +< 1 -1 0 >: -0.062427424502865134 0.032639238359931919 +< 1 0 -1 >: -0.062427424502865148 0.032639238359931926 +< 1 1 -2 >: -0.025485889331356565 0.013324913262484746 +< 2 -2 0 >: 0.044142855197987156 -0.023079426777071942 +< 2 -1 -1 >: 0.072084980683088468 -0.037688546106502109 +< 2 0 -2 >: 0.044142855197987177 -0.023079426777071949 +< 3 -2 -1 >: -0.067429325112083729 0.035254406734040983 +< 3 -1 -2 >: -0.067429325112083716 0.035254406734040983 +< 4 -2 -2 >: 0.095359466075173496 -0.049857260136698119 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.004687493334737923 0.008742309607119626 +< 0 1 -1 >: 0.005740983421402529 0.010707098855437179 +< 1 -2 1 >: -0.004059488307953275 -0.007571062207514351 +< 1 -1 0 >: -0.009077291810449124 -0.016929409757881712 +< 1 0 -1 >: -0.007411577727314956 -0.013822805184434893 +< 2 -3 1 >: 0.002343746667368962 0.004371154803559814 +< 2 -2 0 >: 0.008118976615906553 0.015142124415028707 +< 2 -1 -1 >: 0.009077291810449126 0.016929409757881712 +< 3 -3 0 >: -0.006200970817994696 -0.011564988552384657 +< 3 -2 -1 >: -0.010740396513018757 -0.020031147761682674 +< 4 -3 -1 >: 0.012401941635989394 0.023129977104769321 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 2 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.002177512226194075 0.007340828969379939 +< 0 1 -1 >: -0.000725837408731359 -0.002446942989793315 +< 0 2 -2 >: -0.005080861861119508 -0.017128600928553190 +< 0 3 -3 >: -0.002177512226194075 -0.007340828969379939 +< 1 -3 2 >: 0.003975575218432621 0.013402458724389308 +< 1 -2 1 >: 0.004105956430022523 0.013841999850077896 +< 1 -1 0 >: -0.002811156196070897 -0.009476969448588489 +< 1 0 -1 >: -0.002811156196070896 -0.009476969448588486 +< 1 1 -2 >: 0.004105956430022522 0.013841999850077892 +< 1 2 -3 >: 0.003975575218432622 0.013402458724389310 +< 2 -3 1 >: -0.005333793862847352 -0.017981285264021773 +< 2 -2 0 >: -0.001257187269956850 -0.004238229581546509 +< 2 -1 -1 >: 0.004590598845091359 0.015475826304658035 +< 2 0 -2 >: -0.001257187269956850 -0.004238229581546510 +< 2 1 -3 >: -0.005333793862847351 -0.017981285264021773 +< 3 -3 0 >: 0.005761155827312150 0.019422007870037901 +< 3 -2 -1 >: -0.002715834901976544 -0.009155622312774864 +< 3 -1 -2 >: -0.002715834901976544 -0.009155622312774864 +< 3 0 -3 >: 0.005761155827312151 0.019422007870037904 +< 4 -3 -1 >: -0.004703964035192215 -0.015858003020637335 +< 4 -2 -2 >: 0.006072791456486028 0.020472593867678430 +< 4 -1 -3 >: -0.004703964035192215 -0.015858003020637335 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 2 1 1 ) +num_ms=4 +< 0 -1 1 >: -0.047029213218911819 -0.050627883867582490 +< 0 0 0 >: -0.047029213218911826 -0.050627883867582504 +< 1 -1 0 >: 0.162913973470290296 0.175380134276699212 +< 2 -1 -1 >: -0.115197575390887555 -0.124012482232461266 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 2 2 2 ) +num_ms=8 +< -2 0 2 >: -0.025237475186649448 0.183673013227056120 +< -2 1 1 >: 0.015454734150860693 -0.112476290481438201 +< -1 -1 2 >: 0.015454734150860693 -0.112476290481438201 +< -1 0 1 >: -0.012618737593324717 0.091836506613528004 +< 0 -2 2 >: -0.012618737593324717 0.091836506613528004 +< 0 -1 1 >: -0.006309368796662359 0.045918253306764002 +< 0 0 0 >: 0.006309368796662359 -0.045918253306764002 +< 1 -2 1 >: 0.015454734150860693 -0.112476290481438201 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: -0.020074498512695594 0.107062520909747841 +< -2 0 2 >: 0.056779256108985293 -0.302818538184837061 +< -2 1 1 >: -0.031099279369254246 0.165860544194574744 +< -1 -2 3 >: 0.031740569092890310 -0.169280709057102768 +< -1 -1 2 >: -0.024586139099182017 0.131124273402468461 +< -1 0 1 >: 0.017955177315442314 -0.095759629838675545 +< 0 -3 3 >: -0.031740569092890310 0.169280709057102741 +< 0 -1 1 >: 0.019044341455734182 -0.101568425434261631 +< 0 0 0 >: -0.012696227637156124 0.067712283622841096 +< 1 -3 2 >: 0.031740569092890310 -0.169280709057102768 +< 1 -2 1 >: -0.024586139099182017 0.131124273402468461 +< 2 -3 1 >: -0.020074498512695594 0.107062520909747841 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: -0.000841419805470141 -0.009360728564836463 +< -2 -1 3 >: 0.001262129708205211 0.014041092847254693 +< -2 0 2 >: -0.003017067071875477 -0.033564631754718646 +< -2 1 1 >: 0.001590133966770241 0.017690114194954164 +< -1 -3 4 >: 0.001574152315257623 0.017512319590103093 +< -1 -2 3 >: -0.001487434125681505 -0.016547586612606198 +< -1 -1 2 >: 0.001011955059808471 0.011257919736494842 +< -1 0 1 >: -0.000711129528605930 -0.007911259573930293 +< 0 -4 4 >: -0.001817674525918921 -0.020221484858961546 +< 0 -3 3 >: 0.000454418631479730 0.005055371214740385 +< 0 -2 2 >: 0.000519335578833978 0.005777567102560443 +< 0 -1 1 >: -0.001103588105022202 -0.012277330092940936 +< 0 0 0 >: 0.000649169473542472 0.007221958878200552 +< 1 -4 3 >: 0.001574152315257623 0.017512319590103093 +< 1 -3 2 >: -0.001487434125681505 -0.016547586612606198 +< 1 -2 1 >: 0.001011955059808471 0.011257919736494842 +< 2 -4 2 >: -0.000841419805470141 -0.009360728564836463 +< 2 -3 1 >: 0.001262129708205211 0.014041092847254693 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.005205621898156869 -0.051588496234578299 +< 0 1 -1 >: -0.006010934408400555 -0.059569264376243526 +< 1 -2 1 >: 0.003470414598771245 0.034392330823052188 +< 1 -1 0 >: 0.009815814785279757 0.097276201383165298 +< 1 0 -1 >: 0.008500744962895162 0.084243661581472062 +< 2 -2 0 >: -0.007760082952960163 -0.076903589625006000 +< 2 -1 -1 >: -0.010974414557216518 -0.108758099442858316 +< 3 -2 -1 >: 0.013440857945476127 0.133200924514937147 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: -0.082462230780954784 0.139406072728251590 +< -3 1 2 >: 0.082462230780954798 -0.139406072728251590 +< -3 2 1 >: -0.052153694041252537 0.088168141896071694 +< -2 -1 3 >: 0.082462230780954798 -0.139406072728251590 +< -2 1 1 >: -0.063874969301150136 0.107983479607339714 +< -1 -2 3 >: -0.052153694041252537 0.088168141896071694 +< -1 -1 2 >: -0.063874969301150136 0.107983479607339714 +< -1 0 1 >: 0.049477338468572864 -0.083643643636950926 +< 0 -2 2 >: 0.073756461440996235 -0.124688582038660123 +< 0 -1 1 >: 0.023323841030793283 -0.039429991745892706 +< 0 0 0 >: -0.032984892312381914 0.055762429091300636 +< 1 -2 1 >: -0.080796155385987251 0.136589498091815281 +< 1 -1 0 >: 0.023323841030793283 -0.039429991745892706 +< 2 -2 0 >: 0.073756461440996235 -0.124688582038660123 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 4 2 2 ) +num_ms=9 +< 0 -2 2 >: -0.008898299215685870 -0.009776235584328294 +< 0 -1 1 >: -0.035593196862743488 -0.039104942337313174 +< 0 0 0 >: -0.026694897647057608 -0.029328706752984872 +< 1 -2 1 >: 0.039794403860813336 0.043720654661220881 +< 1 -1 0 >: 0.097475984077233582 0.107093295140426092 +< 2 -2 0 >: -0.068925929343843784 -0.075726395213407613 +< 2 -1 -1 >: -0.056277785646514485 -0.061830342777729051 +< 3 -2 -1 >: 0.105286096187780731 0.115673979390527384 +< 4 -2 -2 >: -0.074448512579038853 -0.081793855233874835 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.015007866695251853 -0.057139486949664538 +< 0 1 -1 >: -0.018380807765538344 -0.069981293595548277 +< 1 -2 1 >: 0.012997193814698516 0.049484247257618894 +< 1 -1 0 >: 0.029062608886405689 0.110650140683443421 +< 1 0 -1 >: 0.023729520788589985 0.090345461547203396 +< 2 -3 1 >: -0.007503933347625928 -0.028569743474832276 +< 2 -2 0 >: -0.025994387629397042 -0.098968494515237829 +< 2 -1 -1 >: -0.029062608886405692 -0.110650140683443421 +< 3 -3 0 >: 0.019853541492622598 0.075588436255316513 +< 3 -2 -1 >: 0.034387342575399195 0.130923012058889593 +< 4 -3 -1 >: -0.039707082985245210 -0.151176872510633054 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 4 3 3 ) +num_ms=14 +< 0 -3 3 >: 0.002520546632108451 -0.005915906059051884 +< 0 -2 2 >: 0.005881275474919720 -0.013803780804454395 +< 0 -1 1 >: 0.000840182210702818 -0.001971968686350630 +< 0 0 0 >: -0.002520546632108451 0.005915906059051884 +< 1 -3 2 >: -0.009203734984329824 0.021601834644161370 +< 1 -2 1 >: -0.009505576617924266 0.022310278886496913 +< 1 -1 0 >: 0.006508023419663483 -0.015274803762956998 +< 2 -3 1 >: 0.012348106243112675 -0.028981902421832895 +< 2 -2 0 >: 0.002910476553105637 -0.006831099911388285 +< 2 -1 -1 >: -0.005313778870752801 0.012471825046796354 +< 3 -3 0 >: -0.013337479113000747 0.031304032423742960 +< 3 -2 -1 >: 0.006287347949824511 -0.014756862403541467 +< 4 -3 -1 >: 0.010890006093960071 -0.025559635443236802 +< 4 -2 -2 >: -0.007029468707000771 0.016498673734464821 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 3 ) +l=( 4 4 4 ) +num_ms=25 +< -4 0 4 >: 0.003679990763049324 -0.009296407074617208 +< -4 1 3 >: -0.005818576289808433 0.014698910205946636 +< -4 2 2 >: 0.003298822681562143 -0.008333498774700855 +< -3 -1 4 >: -0.002909288144904216 0.007349455102973316 +< -3 0 3 >: 0.005519986144573985 -0.013944610611925807 +< -3 1 2 >: -0.002199215121041429 0.005555665849800571 +< -2 -2 4 >: 0.003298822681562143 -0.008333498774700854 +< -2 -1 3 >: -0.001099607560520714 0.002777832924900285 +< -2 0 2 >: -0.002891421313824468 0.007304319844342088 +< -2 1 1 >: 0.002493675552775042 -0.006299532945405699 +< -1 -3 4 >: -0.002909288144904214 0.007349455102973313 +< -1 -2 3 >: -0.001099607560520714 0.002777832924900284 +< -1 -1 2 >: 0.002493675552775043 -0.006299532945405700 +< -1 0 1 >: -0.002365708347674566 0.005976261690825347 +< 0 -4 4 >: 0.001839995381524662 -0.004648203537308603 +< 0 -3 3 >: 0.002759993072286993 -0.006972305305962906 +< 0 -2 2 >: -0.001445710656912235 0.003652159922171047 +< 0 -1 1 >: -0.001182854173837283 0.002988130845412674 +< 0 0 0 >: 0.001182854173837283 -0.002988130845412675 +< 1 -4 3 >: -0.002909288144904214 0.007349455102973313 +< 1 -3 2 >: -0.001099607560520714 0.002777832924900284 +< 1 -2 1 >: 0.002493675552775043 -0.006299532945405700 +< 2 -4 2 >: 0.003298822681562143 -0.008333498774700854 +< 2 -3 1 >: -0.001099607560520714 0.002777832924900285 +< 3 -4 1 >: -0.002909288144904216 0.007349455102973316 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 4 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: -0.003451767512611046 0.009424699117887672 +< -2 0 2 >: 0.004881536430493386 -0.013328537313802496 +< -2 1 1 >: -0.005347455236528954 0.014600681090637878 +< -2 2 0 >: 0.004881536430493386 -0.013328537313802496 +< -1 -2 3 >: 0.005457723646612442 -0.014901757737152405 +< -1 -1 2 >: -0.004227534558306482 0.011542851909041760 +< -1 0 1 >: 0.001543677360144733 -0.004214853579015829 +< -1 1 0 >: 0.001543677360144733 -0.004214853579015829 +< 0 -3 3 >: -0.005457723646612441 0.014901757737152403 +< 0 -1 1 >: 0.003274634187967464 -0.008941054642291439 +< 0 0 0 >: -0.002183089458644977 0.005960703094860961 +< 1 -3 2 >: 0.005457723646612442 -0.014901757737152405 +< 1 -2 1 >: -0.004227534558306482 0.011542851909041760 +< 2 -3 1 >: -0.003451767512611046 0.009424699117887672 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.002196774961861487 0.032475662370909410 +< 0 1 -1 >: 0.002536617231159517 0.037499664823911878 +< 1 -2 1 >: -0.001464516641240990 -0.021650441580606264 +< 1 -1 0 >: -0.004142278592728203 -0.061236696229319557 +< 1 0 -1 >: -0.003587318490855077 -0.053032534578421463 +< 2 -2 0 >: 0.003274758763994527 0.048411859117123611 +< 2 -1 -1 >: 0.004631208257541214 0.068464707743131778 +< 3 -2 -1 >: -0.005672048561769978 -0.083851799679724656 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 4 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: 0.092871730118677082 0.122981467016222271 +< -3 1 2 >: -0.092871730118677095 -0.122981467016222284 +< -3 2 1 >: 0.058737239483095893 0.077780309152026841 +< -2 -1 3 >: -0.092871730118677095 -0.122981467016222284 +< -2 1 1 >: 0.071938132816621259 0.095261034729197155 +< -1 -2 3 >: 0.058737239483095893 0.077780309152026841 +< -1 -1 2 >: 0.071938132816621259 0.095261034729197155 +< -1 0 1 >: -0.055723038071206238 -0.073788880209733343 +< 0 -2 2 >: -0.083067000693350684 -0.109997968088368550 +< 0 -1 1 >: -0.026268092058977410 -0.034784411714976211 +< 0 0 0 >: 0.037148692047470837 0.049192586806488907 +< 1 -2 1 >: 0.090995340128090879 0.120496736803465732 +< 1 -1 0 >: -0.026268092058977410 -0.034784411714976211 +< 2 -2 0 >: -0.083067000693350684 -0.109997968088368550 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 4 ) +l=( 3 3 2 ) +num_ms=14 +< -3 1 2 >: 0.034114368889974593 -0.122455747258013378 +< -3 2 1 >: -0.053939553315754896 0.193619536956620458 +< -3 3 0 >: 0.053939553315754889 -0.193619536956620458 +< -2 1 1 >: 0.041781398338757166 -0.149977048426676557 +< -2 3 -1 >: -0.053939553315754896 0.193619536956620458 +< -1 1 0 >: -0.032363731989452922 0.116171722173972244 +< -1 2 -1 >: 0.041781398338757166 -0.149977048426676557 +< -1 3 -2 >: 0.034114368889974593 -0.122455747258013378 +< 0 0 0 >: 0.021575821326301956 -0.077447814782648186 +< 0 1 -1 >: -0.015256409569497449 0.054763875020890293 +< 0 2 -2 >: -0.048245003156000874 0.173178578562814545 +< 1 0 -1 >: -0.015256409569497449 0.054763875020890293 +< 1 1 -2 >: 0.052849753030899213 -0.189707627911068211 +< 2 0 -2 >: -0.048245003156000874 0.173178578562814545 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 3 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.010502990198937533 0.045507240709490512 +< 0 1 -1 >: 0.012863483380424871 0.055734759670131043 +< 1 -2 1 >: -0.009095856327978880 -0.039410426510552161 +< 1 -1 0 >: -0.020338953062932399 -0.088124392699854490 +< 1 0 -1 >: -0.016606685635533799 -0.071953265335763419 +< 2 -3 1 >: 0.005251495099468768 0.022753620354745260 +< 2 -2 0 >: 0.018191712655957766 0.078820853021104365 +< 2 -1 -1 >: 0.020338953062932402 0.088124392699854490 +< 3 -3 0 >: -0.013894150044468763 -0.060200420885033211 +< 3 -2 -1 >: -0.024065373805005279 -0.104270187609908124 +< 4 -3 -1 >: 0.027788300088937533 0.120400841770066463 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.008476853230064019 0.014522391911916168 +< 0 1 -1 >: 0.008476853230064018 0.014522391911916167 +< 1 -1 0 >: -0.014682340482775232 -0.025153520638866132 +< 1 0 -1 >: -0.014682340482775232 -0.025153520638866132 +< 2 -1 -1 >: 0.020763965038120266 0.035572450028916042 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.008809116627443402 -0.051393694703885100 +< 0 1 -1 >: -0.010171891712354508 -0.059344326943874981 +< 1 -2 1 >: 0.005872744418295599 0.034262463135923384 +< 1 -1 0 >: 0.016610629609409063 0.096908880094262143 +< 1 0 -1 >: 0.014385227214602229 0.083925552013931093 +< 2 -2 0 >: -0.013131855733791421 -0.076613196648505327 +< 2 -1 -1 >: -0.018571248477854716 -0.108347421757073167 +< 3 -2 -1 >: 0.022745041328591419 0.132697949125476833 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.056947247360977574 0.067292612316523850 +< 0 1 -1 >: -0.075929663147970117 0.089723483088698500 +< 0 2 -2 >: -0.018982415786992526 0.022430870772174621 +< 1 -2 1 >: 0.042445972076880459 -0.050156951841095650 +< 1 -1 0 >: 0.103970973224779883 -0.122858939064033640 +< 1 0 -1 >: 0.103970973224779883 -0.122858939064033654 +< 1 1 -2 >: 0.042445972076880459 -0.050156951841095650 +< 2 -2 0 >: -0.073518580213806792 0.086874388941562977 +< 2 -1 -1 >: -0.120055338758468078 0.141865283081943322 +< 2 0 -2 >: -0.073518580213806820 0.086874388941563005 +< 3 -2 -1 >: 0.112301486271817519 -0.132702821092582413 +< 3 -1 -2 >: 0.112301486271817519 -0.132702821092582385 +< 4 -2 -2 >: -0.158818284960260236 0.187670129354300413 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.009125624293360770 0.061675009519915142 +< 0 1 -1 >: -0.011176561551540098 0.075536151602543511 +< 1 -2 1 >: 0.007903022463442844 -0.053412125022893608 +< 1 -1 0 >: 0.017671695455966051 -0.119433142373907647 +< 1 0 -1 >: 0.014428878918992307 -0.097516752397749873 +< 2 -3 1 >: -0.004562812146680387 0.030837504759957578 +< 2 -2 0 >: -0.015806044926885695 0.106824250045787258 +< 2 -1 -1 >: -0.017671695455966051 0.119433142373907661 +< 3 -3 0 >: 0.012072066219221069 -0.081588368648618292 +< 3 -2 -1 >: 0.020909432044026822 -0.141315199806066633 +< 4 -3 -1 >: -0.024144132438442146 0.163176737297236640 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.008245976518538201 0.001192751997317891 +< 0 1 -1 >: -0.002748658839512736 -0.000397583999105964 +< 0 2 -2 >: -0.019240611876589136 -0.002783087993741745 +< 0 3 -3 >: -0.008245976518538201 -0.001192751997317891 +< 1 -3 2 >: 0.015055024492870961 0.002177657248134500 +< 1 -2 1 >: 0.015548762436702404 0.002249074734872745 +< 1 -1 0 >: -0.010645509909838625 -0.001539836207255942 +< 1 0 -1 >: -0.010645509909838620 -0.001539836207255942 +< 1 1 -2 >: 0.015548762436702402 0.002249074734872745 +< 1 2 -3 >: 0.015055024492870965 0.002177657248134501 +< 2 -3 1 >: -0.020198434901390269 -0.002921633783114323 +< 2 -2 0 >: -0.004760816762709361 -0.000688635686727948 +< 2 -1 -1 >: 0.017384044887230922 0.002514541996826387 +< 2 0 -2 >: -0.004760816762709362 -0.000688635686727948 +< 2 1 -3 >: -0.020198434901390266 -0.002921633783114323 +< 3 -3 0 >: 0.021816803184930275 0.003155725160678719 +< 3 -2 -1 >: -0.010284539650584311 -0.001487623107117953 +< 3 -1 -2 >: -0.010284539650584309 -0.001487623107117953 +< 3 0 -3 >: 0.021816803184930279 0.003155725160678719 +< 4 -3 -1 >: -0.017813345207268693 -0.002576638804041773 +< 4 -2 -2 >: 0.022996929775998445 0.003326426392415193 +< 4 -1 -3 >: -0.017813345207268693 -0.002576638804041773 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 2 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.003321486338984252 -0.000643706857129781 +< 0 1 -1 >: -0.003321486338984252 -0.000643706857129781 +< 1 -1 0 >: 0.005752983095766669 0.001114932981729262 +< 1 0 -1 >: 0.005752983095766669 0.001114932981729262 +< 2 -1 -1 >: -0.008135946718136377 -0.001576753343898596 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.018889021454609311 0.062064370363208311 +< 0 1 -1 >: 0.021811163243094595 0.071665761872565861 +< 1 -2 1 >: -0.012592680969739535 -0.041376246908805522 +< 1 -1 0 >: -0.035617480428086469 -0.117029699077061275 +< 1 0 -1 >: -0.030845642869517916 -0.101350692397983305 +< 2 -2 0 >: 0.028158090667305579 0.092520100741904712 +< 2 -1 -1 >: 0.039821553712234822 0.130843181261326685 +< 3 -2 -1 >: -0.048771243679904291 -0.160249515206369930 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 2 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.027289245792213691 -0.004604817381872335 +< 0 1 -1 >: 0.036385661056284935 -0.006139756509163115 +< 0 2 -2 >: 0.009096415264071232 -0.001534939127290779 +< 1 -2 1 >: -0.020340202882029975 0.003432228229946383 +< 1 -1 0 >: -0.049823118325661261 0.008407207844144528 +< 1 0 -1 >: -0.049823118325661268 0.008407207844144530 +< 1 1 -2 >: -0.020340202882029975 0.003432228229946383 +< 2 -2 0 >: 0.035230264827934808 -0.005944793677439330 +< 2 -1 -1 >: 0.057530781554374216 -0.009707807423899956 +< 2 0 -2 >: 0.035230264827934822 -0.005944793677439331 +< 3 -2 -1 >: -0.053815118442450592 0.009080822339253546 +< 3 -1 -2 >: -0.053815118442450585 0.009080822339253546 +< 4 -2 -2 >: 0.076106070362028072 -0.012842222109672936 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.005376732345743923 -0.048444838179329965 +< 0 1 -1 >: 0.006585125365295138 -0.059332567105529817 +< 1 -2 1 >: -0.004656386800763732 0.041954460545526019 +< 1 -1 0 >: -0.010411997416040477 0.093813025739129113 +< 1 0 -1 >: -0.008501360290825365 0.076598014762483652 +< 2 -3 1 >: 0.002688366172871962 -0.024222419089664986 +< 2 -2 0 >: 0.009312773601527468 -0.083908921091052080 +< 2 -1 -1 >: 0.010411997416040477 -0.093813025739129113 +< 3 -3 0 >: -0.007112748326497687 0.064086497063637088 +< 3 -2 -1 >: -0.012319641482944503 0.111001068993333146 +< 4 -3 -1 >: 0.014225496652995379 -0.128172994127274231 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 2 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.000939000085659110 -0.036515326430728329 +< 0 1 -1 >: 0.000313000028553037 0.012171775476909452 +< 0 2 -2 >: 0.002191000199871256 0.085202428338366096 +< 0 3 -3 >: 0.000939000085659110 0.036515326430728329 +< 1 -3 2 >: -0.001714371761382592 -0.066667559935915013 +< 1 -2 1 >: -0.001770595541611482 -0.068853959830422334 +< 1 -1 0 >: 0.001212243897948357 0.047141083715846119 +< 1 0 -1 >: 0.001212243897948357 0.047141083715846105 +< 1 1 -2 >: -0.001770595541611481 -0.068853959830422320 +< 1 2 -3 >: -0.001714371761382592 -0.066667559935915027 +< 2 -3 1 >: 0.002300071078294516 0.089443917546448537 +< 2 -2 0 >: 0.000542131952224369 0.021082133544328047 +< 2 -1 -1 >: -0.001979585995850665 -0.076981067350432114 +< 2 0 -2 >: 0.000542131952224369 0.021082133544328051 +< 2 1 -3 >: 0.002300071078294515 0.089443917546448523 +< 3 -3 0 >: -0.002484360707722353 -0.096610472778050974 +< 3 -2 -1 >: 0.001171138868895924 0.045542613623332139 +< 3 -1 -2 >: 0.001171138868895924 0.045542613623332132 +< 3 0 -3 >: -0.002484360707722353 -0.096610472778050988 +< 4 -3 -1 >: 0.002028472023646487 0.078882120705089778 +< 4 -2 -2 >: -0.002618746121943499 -0.101836379934778620 +< 4 -1 -3 >: 0.002028472023646487 0.078882120705089778 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 3 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.040668858788855060 0.075358621345957930 +< 0 1 -1 >: 0.040668858788855053 0.075358621345957916 +< 1 -1 0 >: -0.070440529708141048 -0.130524960959543662 +< 1 0 -1 >: -0.070440529708141048 -0.130524960959543662 +< 2 -1 -1 >: 0.099617952453997960 0.184590170017205402 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.025838414533841458 -0.044005534434981834 +< 0 1 -1 >: -0.029835631173092996 -0.050813214303740195 +< 1 -2 1 >: 0.017225609689227633 0.029337022956654545 +< 1 -1 0 >: 0.048721381685302240 0.082977631489903420 +< 1 0 -1 >: 0.042193954246949612 0.071860736816119930 +< 2 -2 0 >: -0.038517634218992021 -0.065599577588551450 +< 2 -1 -1 >: -0.054472160703024533 -0.092771812311675583 +< 3 -2 -1 >: 0.066714499454647747 0.113621801338427739 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 3 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.001622342585559750 -0.010551035010337882 +< 0 1 -1 >: -0.002163123447413001 -0.014068046680450514 +< 0 2 -2 >: -0.000540780861853250 -0.003517011670112628 +< 1 -2 1 >: 0.001209222768034790 0.007864277172031902 +< 1 -1 0 >: 0.002961978767041101 0.019263466267296043 +< 1 0 -1 >: 0.002961978767041101 0.019263466267296043 +< 1 1 -2 >: 0.001209222768034790 0.007864277172031902 +< 2 -2 0 >: -0.002094435271905331 -0.013621327626763336 +< 2 -1 -1 >: -0.003420198476970272 -0.022243534869897292 +< 2 0 -2 >: -0.002094435271905332 -0.013621327626763342 +< 3 -2 -1 >: 0.003199302723897201 0.020806921638478741 +< 3 -1 -2 >: 0.003199302723897201 0.020806921638478741 +< 4 -2 -2 >: -0.004524497302272606 -0.029425430772370850 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.006285520405620221 -0.027977794219560634 +< 0 1 -1 >: 0.007698158880810546 -0.034265659983256133 +< 1 -2 1 >: -0.005443420347272581 0.024229480535992932 +< 1 -1 0 >: -0.012171857926607004 0.054178765537988241 +< 1 0 -1 >: -0.009938280380612655 0.044236776820652295 +< 2 -3 1 >: 0.003142760202810111 -0.013988897109780319 +< 2 -2 0 >: 0.010886840694545164 -0.048458961071985877 +< 2 -1 -1 >: 0.012171857926607004 -0.054178765537988248 +< 3 -3 0 >: -0.008314961926946468 0.037011142868548931 +< 3 -2 -1 >: -0.014401936520472104 0.064105179894517292 +< 4 -3 -1 >: 0.016629923853892940 -0.074022285737097890 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 3 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.000796659387258248 0.034365208947845130 +< 0 1 -1 >: -0.000265553129086083 -0.011455069649281719 +< 0 2 -2 >: -0.001858871903602579 -0.080185487544971970 +< 0 3 -3 >: -0.000796659387258248 -0.034365208947845130 +< 1 -3 2 >: 0.001454494390165287 0.062742000447043825 +< 1 -2 1 >: 0.001502195346736606 0.064799659423770445 +< 1 -1 0 >: -0.001028482846483667 -0.044365293981314106 +< 1 0 -1 >: -0.001028482846483667 -0.044365293981314093 +< 1 1 -2 >: 0.001502195346736606 0.064799659423770431 +< 1 2 -3 >: 0.001454494390165287 0.062742000447043839 +< 2 -3 1 >: -0.001951408997581011 -0.084177226826347359 +< 2 -2 0 >: -0.000459951511685992 -0.019840762636796114 +< 2 -1 -1 >: 0.001679505455393459 0.072448221695192772 +< 2 0 -2 >: -0.000459951511685992 -0.019840762636796117 +< 2 1 -3 >: -0.001951408997581011 -0.084177226826347346 +< 3 -3 0 >: 0.002107762618310424 0.090921796628769855 +< 3 -2 -1 >: -0.000993608827025876 -0.042860945969244897 +< 3 -1 -2 >: -0.000993608827025876 -0.042860945969244890 +< 3 0 -3 >: 0.002107762618310424 0.090921796628769869 +< 4 -3 -1 >: -0.001720980971257732 -0.074237336079196636 +< 4 -2 -2 >: 0.002221776880273687 0.095839988767177170 +< 4 -1 -3 >: -0.001720980971257732 -0.074237336079196636 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 2 1 1 ) +num_ms=4 +< 0 -1 1 >: -0.002966209606809296 -0.027493054947750905 +< 0 0 0 >: -0.002966209606809296 -0.027493054947750908 +< 1 -1 0 >: 0.010275251489785208 0.095238736049574960 +< 2 -1 -1 >: -0.007265700006824295 -0.067343956092290144 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 2 2 2 ) +num_ms=8 +< -2 0 2 >: 0.039814573406919143 0.265704835114836169 +< -2 1 1 >: -0.024381347293384075 -0.162710317055421660 +< -1 -1 2 >: -0.024381347293384075 -0.162710317055421660 +< -1 0 1 >: 0.019907286703459561 0.132852417557418001 +< 0 -2 2 >: 0.019907286703459561 0.132852417557418001 +< 0 -1 1 >: 0.009953643351729781 0.066426208778709001 +< 0 0 0 >: -0.009953643351729781 -0.066426208778709001 +< 1 -2 1 >: -0.024381347293384075 -0.162710317055421660 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: 0.007653567234261328 -0.027845071048683039 +< -2 0 2 >: -0.021647557166453429 0.078757754244579967 +< -2 1 1 >: 0.011856855374949156 -0.043137398578204693 +< -1 -2 3 >: -0.012101352342750641 0.044026923061525829 +< -1 -1 2 >: 0.009373667218012272 -0.034103107960408975 +< -1 0 1 >: -0.006845558642469357 0.024905388681266658 +< 0 -3 3 >: 0.012101352342750641 -0.044026923061525829 +< 0 -1 1 >: -0.007260811405650383 0.026416153836915490 +< 0 0 0 >: 0.004840540937100257 -0.017610769224610332 +< 1 -3 2 >: -0.012101352342750641 0.044026923061525829 +< 1 -2 1 >: 0.009373667218012272 -0.034103107960408975 +< 2 -3 1 >: 0.007653567234261328 -0.027845071048683039 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: -0.000574441238777359 -0.003347613159679569 +< -2 -1 3 >: 0.000861661858166039 0.005021419739519354 +< -2 0 2 >: -0.002059765808904567 -0.012003489064299978 +< -2 1 1 >: 0.001085591900446261 0.006326394218685211 +< -1 -3 4 >: 0.001074681152169440 0.006262810753488357 +< -1 -2 3 >: -0.001015478238331678 -0.005917799914996869 +< -1 -1 2 >: 0.000690866454966068 0.004026092627242514 +< -1 0 1 >: -0.000485491457044205 -0.002829249505088360 +< 0 -4 4 >: -0.001240934904996086 -0.007231670948820369 +< 0 -3 3 >: 0.000310233726249021 0.001807917737205091 +< 0 -2 2 >: 0.000354552829998882 0.002066191699662963 +< 0 -1 1 >: -0.000753424763747623 -0.004390657361783795 +< 0 0 0 >: 0.000443191037498602 0.002582739624578703 +< 1 -4 3 >: 0.001074681152169440 0.006262810753488357 +< 1 -3 2 >: -0.001015478238331678 -0.005917799914996869 +< 1 -2 1 >: 0.000690866454966068 0.004026092627242514 +< 2 -4 2 >: -0.000574441238777359 -0.003347613159679569 +< 2 -3 1 >: 0.000861661858166039 0.005021419739519354 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.021322143097413839 0.003526676922539522 +< 0 1 -1 >: 0.024620690113983192 0.004072255741146066 +< 1 -2 1 >: -0.014214762064942554 -0.002351117948359681 +< 1 -1 0 >: -0.040205418596296699 -0.006649965778618134 +< 1 0 -1 >: -0.034818913874180214 -0.005759039298580466 +< 2 -2 0 >: 0.031785174261196841 0.005257259555652087 +< 2 -1 -1 >: 0.044951024522576787 0.007434887764518732 +< 3 -2 -1 >: -0.055053536747823470 -0.009105840658966392 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: -0.050687647140572147 0.017378841408344180 +< -3 1 2 >: 0.050687647140572153 -0.017378841408344184 +< -3 2 1 >: -0.032057682839825796 0.010991344389043199 +< -2 -1 3 >: 0.050687647140572153 -0.017378841408344184 +< -2 1 1 >: -0.039262482646774802 0.013461592670179379 +< -1 -2 3 >: -0.032057682839825796 0.010991344389043199 +< -1 -1 2 >: -0.039262482646774802 0.013461592670179379 +< -1 0 1 >: 0.030412588284343279 -0.010427304845006506 +< 0 -2 2 >: 0.045336409850336892 -0.015544108303698317 +< 0 -1 1 >: 0.014336631606195799 -0.004915478643602298 +< 0 0 0 >: -0.020275058856228861 0.006951536563337673 +< 1 -2 1 >: -0.049663548702657850 0.017027717508477862 +< 1 -1 0 >: 0.014336631606195799 -0.004915478643602298 +< 2 -2 0 >: 0.045336409850336892 -0.015544108303698317 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 4 2 2 ) +num_ms=9 +< 0 -2 2 >: 0.004371228091308439 -0.001015669812656635 +< 0 -1 1 >: 0.017484912365233758 -0.004062679250626541 +< 0 0 0 >: 0.013113684273925315 -0.003047009437969904 +< 1 -2 1 >: -0.019548726314644653 0.004542213487589424 +< 1 -1 0 >: -0.047884404592197678 0.011126105347381701 +< 2 -2 0 >: 0.033859387200223232 -0.007867344539329506 +< 2 -1 -1 >: 0.027646073881290287 -0.006423659917342960 +< 3 -2 -1 >: -0.051721068276613970 0.012017567289924988 +< 4 -2 -2 >: 0.036572318108606151 -0.008497703324071598 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.006143592400603938 0.009637657780642005 +< 0 1 -1 >: -0.007524333284560014 0.011803671939068540 +< 1 -2 1 >: 0.005320507089420034 -0.008346456471016729 +< 1 -1 0 >: 0.011897015526712750 -0.018663244040436414 +< 1 0 -1 >: 0.009713872500805026 -0.015238474948036084 +< 2 -3 1 >: -0.003071796200301969 0.004818828890321003 +< 2 -2 0 >: -0.010641014178840072 0.016692912942033466 +< 2 -1 -1 >: -0.011897015526712752 0.018663244040436414 +< 3 -3 0 >: 0.008127208824272161 -0.012749422854362718 +< 3 -2 -1 >: 0.014076738607361508 -0.022082648150936052 +< 4 -3 -1 >: -0.016254417648544330 0.025498845708725446 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 4 3 3 ) +num_ms=14 +< 0 -3 3 >: -0.001947804649495662 0.010050146296873052 +< 0 -2 2 >: -0.004544877515489877 0.023450341359370453 +< 0 -1 1 >: -0.000649268216498554 0.003350048765624353 +< 0 0 0 >: 0.001947804649495662 -0.010050146296873052 +< 1 -3 2 >: 0.007112376960948116 -0.036697945553495877 +< 1 -2 1 >: 0.007345631339120367 -0.037901475191657617 +< 1 -1 0 >: -0.005029209979441382 0.025949366156491644 +< 2 -3 1 >: -0.009542255019770017 0.049235460535321768 +< 2 -2 0 >: -0.002249131077430249 0.011604909339789551 +< 2 -1 -1 >: 0.004106332752981489 -0.021187568744017077 +< 3 -3 0 >: 0.010306813410201706 -0.053180375482685636 +< 3 -2 -1 >: -0.004858678436518714 0.025069469419902551 +< 4 -3 -1 >: -0.008415477909689729 0.043421594754065491 +< 4 -2 -2 >: 0.005432167632434120 -0.028028518891377155 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 1 4 4 ) +l=( 4 4 4 ) +num_ms=25 +< -4 0 4 >: 0.001008757196501169 0.003242376852545740 +< -4 1 3 >: -0.001594985173514865 -0.005126647943326229 +< -4 2 2 >: 0.000904271595847615 0.002906536182304704 +< -3 -1 4 >: -0.000797492586757432 -0.002563323971663114 +< -3 0 3 >: 0.001513135794751752 0.004863565278818609 +< -3 1 2 >: -0.000602847730565077 -0.001937690788203136 +< -2 -2 4 >: 0.000904271595847615 0.002906536182304704 +< -2 -1 3 >: -0.000301423865282538 -0.000968845394101568 +< -2 0 2 >: -0.000792594940108061 -0.002547581812714509 +< -2 1 1 >: 0.000683565074363513 0.002197134832854097 +< -1 -3 4 >: -0.000797492586757432 -0.002563323971663113 +< -1 -2 3 >: -0.000301423865282538 -0.000968845394101568 +< -1 -1 2 >: 0.000683565074363513 0.002197134832854098 +< -1 0 1 >: -0.000648486769179323 -0.002084385119493690 +< 0 -4 4 >: 0.000504378598250584 0.001621188426272870 +< 0 -3 3 >: 0.000756567897375876 0.002431782639409305 +< 0 -2 2 >: -0.000396297470054031 -0.001273790906357255 +< 0 -1 1 >: -0.000324243384589661 -0.001042192559746845 +< 0 0 0 >: 0.000324243384589661 0.001042192559746845 +< 1 -4 3 >: -0.000797492586757432 -0.002563323971663113 +< 1 -3 2 >: -0.000301423865282538 -0.000968845394101568 +< 1 -2 1 >: 0.000683565074363513 0.002197134832854098 +< 2 -4 2 >: 0.000904271595847615 0.002906536182304704 +< 2 -3 1 >: -0.000301423865282538 -0.000968845394101568 +< 3 -4 1 >: -0.000797492586757432 -0.002563323971663114 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 1 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: -0.443685031756588133 -0.766788492334507632 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 1 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.021258964632145865 -0.099770728173720583 +< 1 -1 >: -0.042517929264291723 0.199541456347441110 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 1 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: -0.080484268478046864 0.056545394865651424 +< 1 -1 >: 0.160968536956093755 -0.113090789731302863 +< 2 -2 >: -0.160968536956093783 0.113090789731302890 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 1 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: -0.068612942196417448 0.331839144705912803 +< 1 -1 >: 0.137225884392834896 -0.663678289411825606 +< 2 -2 >: -0.137225884392834868 0.663678289411825495 +< 3 -3 >: 0.137225884392834868 -0.663678289411825495 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 1 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: 0.010563846674115336 -0.074491987845651350 +< 1 -1 >: -0.021127693348230666 0.148983975691302645 +< 2 -2 >: 0.021127693348230666 -0.148983975691302645 +< 3 -3 >: -0.021127693348230666 0.148983975691302645 +< 4 -4 >: 0.021127693348230669 -0.148983975691302672 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 1 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: -0.005330008844206259 0.085596074475354916 +< 1 -1 >: 0.010660017688412517 -0.171192148950709833 +< 2 -2 >: -0.010660017688412519 0.171192148950709860 +< 3 -3 >: 0.010660017688412520 -0.171192148950709888 +< 4 -4 >: -0.010660017688412519 0.171192148950709860 +< 5 -5 >: 0.010660017688412507 -0.171192148950709666 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 1 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: 0.043595376456603344 -0.061977341956862740 +< 1 -1 >: -0.087190752913206701 0.123954683913725508 +< 2 -2 >: 0.087190752913206673 -0.123954683913725452 +< 3 -3 >: -0.087190752913206701 0.123954683913725508 +< 4 -4 >: 0.087190752913206646 -0.123954683913725439 +< 5 -5 >: -0.087190752913206673 0.123954683913725452 +< 6 -6 >: 0.087190752913206618 -0.123954683913725383 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.025673494362345103 0.354532665314856887 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.008471527858069306 -0.403448183560426166 +< 1 -1 0 >: 0.016943055716138609 0.806896367120852220 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.050528239746022864 -0.080541291480621405 +< 1 -1 0 >: -0.101056479492045728 0.161082582961242810 +< 2 -2 0 >: 0.101056479492045756 -0.161082582961242865 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.005081450586248567 -0.056434814324392242 +< 0 1 -1 >: 0.005867553727688781 -0.065165310483708785 +< 1 -2 1 >: -0.003387633724165710 0.037623209549594812 +< 1 -1 0 >: -0.009581675114135251 0.106414506410083903 +< 1 0 -1 >: -0.008297974059650284 0.092157665882314610 +< 2 -2 0 >: 0.007574979290105302 -0.084128054084613269 +< 2 -1 -1 >: 0.010712638446762237 -0.118975035062517331 +< 3 -2 -1 >: -0.013120248996744407 0.145714064016452594 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.013488697530298670 0.087985761931948028 +< 1 -1 0 >: -0.026977395060597341 -0.175971523863896057 +< 2 -2 0 >: 0.026977395060597337 0.175971523863896029 +< 3 -3 0 >: -0.026977395060597337 -0.175971523863896029 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.023166996813129861 -0.004034707910871768 +< 0 1 -1 >: 0.028373660532426084 -0.004941487821403271 +< 1 -2 1 >: -0.020063207769563590 0.003494159547664992 +< 1 -1 0 >: -0.044862696419446131 0.007813178272808840 +< 1 0 -1 >: -0.036630238237676291 0.006379433345927211 +< 2 -3 1 >: 0.011583498406564932 -0.002017353955435884 +< 2 -2 0 >: 0.040126415539127193 -0.006988319095329987 +< 2 -1 -1 >: 0.044862696419446138 -0.007813178272808840 +< 3 -3 0 >: -0.030647056095883758 0.005337416872475828 +< 3 -2 -1 >: -0.053082258260484162 0.009244677204303511 +< 4 -3 -1 >: 0.061294112191767537 -0.010674833744951659 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.009599109215753620 -0.030650039218870596 +< 1 -1 0 >: 0.019198218431507232 0.061300078437741171 +< 2 -2 0 >: -0.019198218431507232 -0.061300078437741171 +< 3 -3 0 >: 0.019198218431507232 0.061300078437741171 +< 4 -4 0 >: -0.019198218431507236 -0.061300078437741184 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 1 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.030345923816554193 -0.019658602753619338 +< 0 1 -1 >: 0.016621147002659993 0.010767460177190486 +< 0 2 -2 >: 0.070517554540076050 0.045682464644684985 +< 1 -3 2 >: -0.058999219052618165 -0.038220692081764117 +< 1 -2 1 >: -0.047304613667597688 -0.030644728897573924 +< 1 -1 0 >: 0.051588070488142117 0.033419624681152872 +< 1 0 -1 >: 0.016621147002659993 0.010767460177190486 +< 1 1 -2 >: -0.074332029123929264 -0.048153545802439718 +< 2 -4 2 >: 0.039332812701745441 0.025480461387842747 +< 2 -3 1 >: 0.069531246461361412 0.045043517587763968 +< 2 -2 0 >: -0.024276739053243360 -0.015726882202895476 +< 2 -1 -1 >: -0.047304613667597688 -0.030644728897573924 +< 2 0 -2 >: 0.070517554540076050 0.045682464644684985 +< 3 -4 1 >: -0.073584954594040866 -0.047669578285115005 +< 3 -3 0 >: -0.021242146671587924 -0.013761021927533533 +< 3 -2 -1 >: 0.069531246461361412 0.045043517587763968 +< 3 -1 -2 >: -0.058999219052618165 -0.038220692081764117 +< 4 -4 0 >: 0.084968586686351738 0.055044087710134144 +< 4 -3 -1 >: -0.073584954594040866 -0.047669578285115005 +< 4 -2 -2 >: 0.039332812701745441 0.025480461387842747 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 1 1 1 ) +l=( 0 0 0 0 ) +num_ms=1 +< 0 0 0 0 >: -0.000131149336668165 -0.026671105528810853 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 1 1 1 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: -0.000549702479850836 0.031159740241633885 +< 1 -1 0 0 >: 0.001099404959701671 -0.062319480483267763 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 1 1 1 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: 0.000534231632539918 0.016152804358911307 +< 1 -1 0 0 >: -0.001068463265079836 -0.032305608717822620 +< 2 -2 0 0 >: 0.001068463265079836 0.032305608717822627 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.044836097751452433 0.123019968306161701 +< 1 -1 0 >: 0.089672195502904839 -0.246039936612323346 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.065253113373031621 -0.109526680389507899 +< 1 -1 0 >: 0.130506226746063242 0.219053360779015799 +< 2 -2 0 >: -0.130506226746063270 -0.219053360779015854 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.006691075378480910 0.061635128918971091 +< 0 1 -1 >: 0.007726188341868057 0.071170116545810458 +< 1 -2 1 >: -0.004460716918987272 -0.041090085945980709 +< 1 -1 0 >: -0.012616812729477856 -0.116220313647764084 +< 1 0 -1 >: -0.010926480338518703 -0.100649744054758961 +< 2 -2 0 >: 0.009974466259238965 0.091880225376521643 +< 2 -1 -1 >: 0.014106025461248574 0.129938260841373499 +< 3 -2 -1 >: -0.017276282339383366 -0.159141218563014747 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.020750470233620349 -0.091150031876353815 +< 1 -1 0 >: 0.041500940467240698 0.182300063752707631 +< 2 -2 0 >: -0.041500940467240698 -0.182300063752707603 +< 3 -3 0 >: 0.041500940467240698 0.182300063752707603 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.016080450169900506 0.089746028513755141 +< 0 1 -1 >: -0.019694448875253651 0.109915988149984933 +< 1 -2 1 >: 0.013926078351423631 -0.077722340581674543 +< 1 -1 0 >: 0.031139657853771447 -0.173792436911014841 +< 1 0 -1 >: 0.025425424168863588 -0.141900930528941122 +< 2 -3 1 >: -0.008040225084950255 0.044873014256877584 +< 2 -2 0 >: -0.027852156702847273 0.155444681163349141 +< 2 -1 -1 >: -0.031139657853771451 0.173792436911014869 +< 3 -3 0 >: 0.021272436059761542 -0.118722836301553905 +< 3 -2 -1 >: 0.036844940056267296 -0.205633984492974126 +< 4 -3 -1 >: -0.042544872119523097 0.237445672603107893 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.024580789850859350 -0.118255530012825641 +< 1 -1 0 >: -0.049161579701718680 0.236511060025651199 +< 2 -2 0 >: 0.049161579701718680 -0.236511060025651199 +< 3 -3 0 >: -0.049161579701718680 0.236511060025651199 +< 4 -4 0 >: 0.049161579701718694 -0.236511060025651254 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 2 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.019821407204615442 -0.034286484773894357 +< 0 1 -1 >: -0.010856631847463296 0.018779481128219356 +< 0 2 -2 >: -0.046060788001122802 0.079674590717572227 +< 1 -3 2 >: 0.038537220111199838 -0.066660545183855613 +< 1 -2 1 >: 0.030898515920315173 -0.053447340277189580 +< 1 -1 0 >: -0.033696392247846249 0.058287024115620402 +< 1 0 -1 >: -0.010856631847463296 0.018779481128219356 +< 1 1 -2 >: 0.048552333635234125 -0.083984392769745869 +< 2 -4 2 >: -0.025691480074133227 0.044440363455903735 +< 2 -3 1 >: -0.045416549447846656 0.078560205895160898 +< 2 -2 0 >: 0.015857125763692359 -0.027429187819115495 +< 2 -1 -1 >: 0.030898515920315173 -0.053447340277189580 +< 2 0 -2 >: -0.046060788001122802 0.079674590717572227 +< 3 -4 1 >: 0.048064358098268055 -0.083140307097850474 +< 3 -3 0 >: 0.013874985043230804 -0.024000539341726041 +< 3 -2 -1 >: -0.045416549447846656 0.078560205895160898 +< 3 -1 -2 >: 0.038537220111199838 -0.066660545183855613 +< 4 -4 0 >: -0.055499940172923236 0.096002157366904206 +< 4 -3 -1 >: 0.048064358098268055 -0.083140307097850474 +< 4 -2 -2 >: -0.025691480074133227 0.044440363455903735 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 1 2 1 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: 0.000879900694635743 -0.046214553741910469 +< 1 -1 0 0 >: -0.001759801389271486 0.092429107483820924 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 1 2 1 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: -0.000744986350624590 -0.021998531066858684 +< 1 -1 0 0 >: 0.001489972701249181 0.043997062133717374 +< 2 -2 0 0 >: -0.001489972701249181 -0.043997062133717388 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 1 2 1 ) +l=( 2 2 1 1 ) +num_ms=19 +< 0 0 0 0 >: 0.000074721474110087 0.045311132790134441 +< 0 0 1 -1 >: 0.000198560903657768 -0.077407572244935746 +< 0 1 -1 0 >: -0.000080600861057782 -0.006242390936835944 +< 0 1 0 -1 >: -0.000120319256502976 -0.001387115817576990 +< 0 2 -1 -1 >: -0.000284143955208020 -0.010789751926307911 +< 1 -2 0 1 >: 0.000262290850582401 0.007362041501545532 +< 1 -2 1 0 >: 0.000229860916501465 0.011326357035883928 +< 1 -1 -1 1 >: -0.000129094548527080 0.078208423935611018 +< 1 -1 0 0 >: -0.000033441664260861 -0.086217367801824513 +< 1 -1 1 -1 >: -0.000152025974829142 0.081011618332704857 +< 1 0 -1 0 >: -0.000120319256502976 -0.001387115817576990 +< 1 0 0 -1 >: -0.000080600861057782 -0.006242390936835944 +< 1 1 -1 -1 >: 0.000348003851877943 0.013214693335333129 +< 2 -2 -1 1 >: -0.000056373090562923 -0.083414173404730660 +< 2 -2 0 0 >: -0.000314562187617083 0.073002674466491405 +< 2 -2 1 -1 >: -0.000010510237958798 -0.089020562198918365 +< 2 -1 -1 0 >: 0.000262290850582401 0.007362041501545532 +< 2 -1 0 -1 >: 0.000229860916501465 0.011326357035883928 +< 2 0 -1 -1 >: -0.000284143955208020 -0.010789751926307911 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 1 2 2 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: -0.000390044560424510 0.010161400220348013 +< 1 -1 0 0 >: 0.000780089120849020 -0.020322800440696023 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 1 2 2 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: 0.000236958433008212 0.000726730860463758 +< 1 -1 0 0 >: -0.000473916866016423 -0.001453461720927516 +< 2 -2 0 0 >: 0.000473916866016423 0.001453461720927516 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.099936425840165849 0.172960728852067092 +< 1 -1 0 >: -0.199872851680331642 -0.345921457704134128 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.067333069873716456 -0.178547061608677754 +< 1 -1 0 >: -0.134666139747432939 0.357094123217355564 +< 2 -2 0 >: 0.134666139747432967 -0.357094123217355619 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.026384848432851424 -0.090557865129244200 +< 0 1 -1 >: -0.030466598690468475 -0.104567215619213866 +< 1 -2 1 >: 0.017589898955234277 0.060371910086162772 +< 1 -1 0 >: 0.049751747326529309 0.170757548060440939 +< 1 0 -1 >: 0.043086277067438894 0.147880374508284007 +< 2 -2 0 >: -0.039332209781256379 -0.134995694884165185 +< 2 -1 -1 >: -0.055624144510756472 -0.190912742567166616 +< 3 -2 -1 >: 0.068125385715093592 0.233819402342440030 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.016318843547732997 0.075691400143286583 +< 1 -1 0 >: -0.032637687095465995 -0.151382800286573166 +< 2 -2 0 >: 0.032637687095465995 0.151382800286573166 +< 3 -3 0 >: -0.032637687095465995 -0.151382800286573166 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.005080880668698730 -0.050804786190446816 +< 0 1 -1 >: -0.006222782541141438 -0.062222901328895970 +< 1 -2 1 >: 0.004400171732690367 0.043998235474763780 +< 1 -1 0 >: 0.009839083106968696 0.098383045411614564 +< 1 0 -1 >: 0.008033577716303685 0.080329420199840462 +< 2 -3 1 >: -0.002540440334349366 -0.025402393095223415 +< 2 -2 0 >: -0.008800343465380738 -0.087996470949527589 +< 2 -1 -1 >: -0.009839083106968696 -0.098383045411614564 +< 3 -3 0 >: 0.006721373345286200 0.067208414835865440 +< 3 -2 -1 >: 0.011641760130674894 0.116408389191884884 +< 4 -3 -1 >: -0.013442746690572405 -0.134416829671730909 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.030940967307135768 0.061648342892035281 +< 1 -1 0 >: 0.061881934614271515 -0.123296685784070520 +< 2 -2 0 >: -0.061881934614271515 0.123296685784070520 +< 3 -3 0 >: 0.061881934614271515 -0.123296685784070520 +< 4 -4 0 >: -0.061881934614271529 0.123296685784070548 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 3 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.009817053273569845 0.055584686124101140 +< 0 1 -1 >: 0.005377021526164138 -0.030444986442014595 +< 0 2 -2 >: 0.022812770302420210 -0.129167138197686160 +< 1 -3 2 >: -0.019086533006538668 0.108068981271806724 +< 1 -2 1 >: -0.015303271545390008 0.086647950440740765 +< 1 -1 0 >: 0.016688990565068732 -0.094493966410971922 +< 1 0 -1 >: 0.005377021526164138 -0.030444986442014595 +< 1 1 -2 >: -0.024046771297965359 0.136154118516808226 +< 2 -4 2 >: 0.012724355337692445 -0.072045987514537821 +< 2 -3 1 >: 0.022493694863773919 -0.127360515822027537 +< 2 -2 0 >: -0.007853642618855877 0.044467748899280922 +< 2 -1 -1 >: -0.015303271545390008 0.086647950440740765 +< 2 0 -2 >: 0.022812770302420210 -0.129167138197686160 +< 3 -4 1 >: -0.023805089070606685 0.134785700685596782 +< 3 -3 0 >: -0.006871937291498888 0.038909280286870782 +< 3 -2 -1 >: 0.022493694863773919 -0.127360515822027537 +< 3 -1 -2 >: -0.019086533006538668 0.108068981271806724 +< 4 -4 0 >: 0.027487749165995563 -0.155637121147483182 +< 4 -3 -1 >: -0.023805089070606685 0.134785700685596782 +< 4 -2 -2 >: 0.012724355337692445 -0.072045987514537821 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.049812769767711255 -0.011045396958808368 +< 1 -1 0 >: 0.099625539535422497 0.022090793917616734 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.044266647288743223 0.086360412014017507 +< 1 -1 0 >: 0.088533294577486460 -0.172720824028035042 +< 2 -2 0 >: -0.088533294577486474 0.172720824028035069 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.023973339060976952 0.088744963009341440 +< 0 1 -1 >: 0.027682027520458417 0.102473856565333268 +< 1 -2 1 >: -0.015982226040651297 -0.059163308672894266 +< 1 -1 0 >: -0.045204561647203045 -0.167339107040145707 +< 1 0 -1 >: -0.039148298753417556 -0.144919917743369542 +< 2 -2 0 >: 0.035737343858663624 0.132293179966394475 +< 2 -1 -1 >: 0.050540236368112931 0.187090809317939699 +< 3 -2 -1 >: -0.061898895290764977 -0.229138509196648354 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.004553843690772358 -0.016727430375017845 +< 1 -1 0 >: 0.009107687381544716 0.033454860750035689 +< 2 -2 0 >: -0.009107687381544716 -0.033454860750035689 +< 3 -3 0 >: 0.009107687381544716 0.033454860750035689 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.007910374230632561 0.026348395715979800 +< 0 1 -1 >: 0.009688190269755417 0.032270062522542373 +< 1 -2 1 >: -0.006850585037169583 -0.022818380039003577 +< 1 -1 0 >: -0.015318373828754114 -0.051023448903636311 +< 1 0 -1 >: -0.012507399856550489 -0.041660471576959568 +< 2 -3 1 >: 0.003955187115316282 0.013174197857989902 +< 2 -2 0 >: 0.013701170074339171 0.045636760078007176 +< 2 -1 -1 >: 0.015318373828754115 0.051023448903636318 +< 3 -3 0 >: -0.010464441495853826 -0.034855651255001098 +< 3 -2 -1 >: -0.018124944343650896 -0.060371758904563817 +< 4 -3 -1 >: 0.020928882991707660 0.069711302510002210 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.012080441009612876 0.000022520940721450 +< 1 -1 0 >: -0.024160882019225744 -0.000045041881442901 +< 2 -2 0 >: 0.024160882019225744 0.000045041881442901 +< 3 -3 0 >: -0.024160882019225744 -0.000045041881442901 +< 4 -4 0 >: 0.024160882019225748 0.000045041881442901 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 1 4 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.015160180132536510 -0.016821694253254679 +< 0 1 -1 >: -0.008303572634431905 0.009213621397962607 +< 0 2 -2 >: -0.035229075107291077 0.039090085018709031 +< 1 -3 2 >: 0.029474758914037103 -0.032705111568972378 +< 1 -2 1 >: 0.023632382017304564 -0.026222426204423863 +< 1 -1 0 >: -0.025772306225312062 0.028596880230532949 +< 1 0 -1 >: -0.008303572634431905 0.009213621397962607 +< 1 1 -2 >: 0.037134705733393510 -0.041204567529582077 +< 2 -4 2 >: -0.019649839276024733 0.021803407712648253 +< 2 -3 1 >: -0.034736336503257116 0.038543343616471611 +< 2 -2 0 >: 0.012128144106029212 -0.013457355402603746 +< 2 -1 -1 >: 0.023632382017304564 -0.026222426204423863 +< 2 0 -2 >: -0.035229075107291077 0.039090085018709031 +< 3 -4 1 >: 0.036761483138029336 -0.040790440762437132 +< 3 -3 0 >: 0.010612126092775552 -0.011775185977278271 +< 3 -2 -1 >: -0.034736336503257116 0.038543343616471611 +< 3 -1 -2 >: 0.029474758914037103 -0.032705111568972378 +< 4 -4 0 >: -0.042448504371102230 0.047100743909113098 +< 4 -3 -1 >: 0.036761483138029336 -0.040790440762437132 +< 4 -2 -2 >: -0.019649839276024733 0.021803407712648253 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 2 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.237529292163412231 -0.506725013422213544 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 2 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.011163256227855207 -0.272012801083348243 +< 1 -1 >: -0.022326512455710410 0.544025602166696376 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 2 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: -0.007641334930427780 0.036306741501869841 +< 1 -1 >: 0.015282669860855563 -0.072613483003739682 +< 2 -2 >: -0.015282669860855566 0.072613483003739709 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 2 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: 0.029464058726948968 -0.015652403783227988 +< 1 -1 >: -0.058928117453897935 0.031304807566455976 +< 2 -2 >: 0.058928117453897928 -0.031304807566455969 +< 3 -3 >: -0.058928117453897928 0.031304807566455969 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 2 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: -0.013586208381099698 0.030901612428767603 +< 1 -1 >: 0.027172416762199385 -0.061803224857535186 +< 2 -2 >: -0.027172416762199385 0.061803224857535186 +< 3 -3 >: 0.027172416762199385 -0.061803224857535186 +< 4 -4 >: -0.027172416762199392 0.061803224857535199 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 2 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.001635058193904321 -0.026240219199856703 +< 1 -1 >: -0.003270116387808642 0.052480438399713406 +< 2 -2 >: 0.003270116387808642 -0.052480438399713412 +< 3 -3 >: -0.003270116387808643 0.052480438399713426 +< 4 -4 >: 0.003270116387808642 -0.052480438399713412 +< 5 -5 >: -0.003270116387808638 0.052480438399713357 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 2 2 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: -0.024120927536316672 -0.006947962831113538 +< 1 -1 >: 0.048241855072633351 0.013895925662227079 +< 2 -2 >: -0.048241855072633337 -0.013895925662227072 +< 3 -3 >: 0.048241855072633351 0.013895925662227079 +< 4 -4 >: -0.048241855072633323 -0.013895925662227070 +< 5 -5 >: 0.048241855072633337 0.013895925662227072 +< 6 -6 >: -0.048241855072633302 -0.013895925662227065 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.042157890720039490 -0.080177729415818355 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.000441540392775611 0.171446291731526923 +< 1 -1 0 >: 0.000883080785551222 -0.342892583463053791 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.015314948158571085 0.144142255874459224 +< 0 1 -1 >: 0.015314948158571083 0.144142255874459196 +< 1 -1 0 >: -0.026526268325928540 -0.249661710692156869 +< 1 0 -1 >: -0.026526268325928540 -0.249661710692156869 +< 2 -1 -1 >: 0.037513808425675990 0.353074977266116141 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.010715155854679278 -0.024320535097604255 +< 1 -1 0 >: 0.021430311709358555 0.048641070195208511 +< 2 -2 0 >: -0.021430311709358562 -0.048641070195208524 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.009379950621030062 0.142958858170693121 +< 0 1 -1 >: 0.010831034032074202 0.165074670495782339 +< 1 -2 1 >: -0.006253300414020039 -0.095305905447128719 +< 1 -1 0 >: -0.017687004510200867 -0.269565808115154626 +< 1 0 -1 >: -0.015317395222683886 -0.233450837819405205 +< 2 -2 0 >: 0.013982804809476390 0.213110483236947368 +< 2 -1 -1 >: 0.019774672201577252 0.301383735677575038 +< 3 -2 -1 >: -0.024218928362331558 -0.369118184591948284 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.001892496709451729 -0.008303587970500197 +< 1 -1 0 >: 0.003784993418903457 0.016607175941000394 +< 2 -2 0 >: -0.003784993418903457 -0.016607175941000391 +< 3 -3 0 >: 0.003784993418903457 0.016607175941000391 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.064323537074706449 -0.050824047196869532 +< 0 1 -1 >: 0.085764716099608632 -0.067765396262492728 +< 0 2 -2 >: 0.021441179024902154 -0.016941349065623182 +< 1 -2 1 >: -0.047943933817423873 0.037882008141285978 +< 1 -1 0 >: -0.117438174114455327 0.092791590378108843 +< 1 0 -1 >: -0.117438174114455340 0.092791590378108857 +< 1 1 -2 >: -0.047943933817423873 0.037882008141285978 +< 2 -2 0 >: 0.083041329286497809 -0.065613562793445143 +< 2 -1 -1 >: 0.135605922876237850 -0.107146499366669271 +< 2 0 -2 >: 0.083041329286497836 -0.065613562793445157 +< 3 -2 -1 >: -0.126847725755043245 0.100226372705566905 +< 3 -1 -2 >: -0.126847725755043217 0.100226372705566905 +< 4 -2 -2 >: 0.179389774118965034 -0.141741495587673266 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000988267132983525 0.050693726784944340 +< 0 1 -1 >: 0.001210375102686442 0.062086881891587016 +< 1 -2 1 >: -0.000855864442888947 -0.043902055208269439 +< 1 -1 0 >: -0.001913771073824672 -0.098167979797639165 +< 1 0 -1 >: -0.001562587538456227 -0.080153819861354433 +< 2 -3 1 >: 0.000494133566491763 0.025346863392472177 +< 2 -2 0 >: 0.001711728885777895 0.087804110416538905 +< 2 -1 -1 >: 0.001913771073824673 0.098167979797639179 +< 3 -3 0 >: -0.001307354531386603 -0.067061497052008326 +< 3 -2 -1 >: -0.002264404471866998 -0.116153920125708937 +< 4 -3 -1 >: 0.002614709062773207 0.134122994104016680 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.002658802058065159 -0.012783282173783569 +< 0 1 -1 >: 0.000886267352688387 0.004261094057927860 +< 0 2 -2 >: 0.006203871468818703 0.029827658405494995 +< 0 3 -3 >: 0.002658802058065159 0.012783282173783569 +< 1 -3 2 >: -0.004854286210478159 -0.023338973351783115 +< 1 -2 1 >: -0.005013485240241661 -0.024104388029075930 +< 1 -1 0 >: 0.003432498697249456 0.016503146322977974 +< 1 0 -1 >: 0.003432498697249454 0.016503146322977967 +< 1 1 -2 >: -0.005013485240241660 -0.024104388029075927 +< 1 2 -3 >: -0.004854286210478159 -0.023338973351783119 +< 2 -3 1 >: 0.006512708369321411 0.031312518563785911 +< 2 -2 0 >: 0.001535060083945850 0.007380431404160885 +< 2 -1 -1 >: -0.005605246900686108 -0.026949525094522975 +< 2 0 -2 >: 0.001535060083945850 0.007380431404160887 +< 2 1 -3 >: 0.006512708369321410 0.031312518563785904 +< 3 -3 0 >: -0.007034529030987125 -0.033821385570996489 +< 3 -2 -1 >: 0.003316108786843087 0.015943554057584318 +< 3 -1 -2 >: 0.003316108786843086 0.015943554057584314 +< 3 0 -3 >: -0.007034529030987126 -0.033821385570996496 +< 4 -3 -1 >: 0.005743668902237818 0.027615045680956962 +< 4 -2 -2 >: -0.007415044668165499 -0.035650870675701114 +< 4 -1 -3 >: 0.005743668902237818 0.027615045680956962 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.004972044830004877 0.040109990151243995 +< 1 -1 0 >: -0.009944089660009750 -0.080219980302487962 +< 2 -2 0 >: 0.009944089660009750 0.080219980302487962 +< 3 -3 0 >: -0.009944089660009750 -0.080219980302487962 +< 4 -4 0 >: 0.009944089660009751 0.080219980302487975 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 1 1 ) +l=( 0 0 0 0 ) +num_ms=1 +< 0 0 0 0 >: 0.000169145388298771 0.021394144275254930 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 1 1 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: 0.000151629851811976 -0.010246816255707641 +< 1 -1 0 0 >: -0.000303259703623953 0.020493632511415279 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 1 1 ) +l=( 2 1 1 0 ) +num_ms=5 +< 0 0 0 0 >: -0.000186246234993290 -0.005624955595958680 +< 0 1 -1 0 >: -0.000186246234993290 -0.005624955595958679 +< 1 -1 0 0 >: 0.000322587941726792 0.009742708882519307 +< 1 0 -1 0 >: 0.000322587941726792 0.009742708882519307 +< 2 -1 -1 0 >: -0.000456208242248050 -0.013778271035911628 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 1 1 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: -0.000259357644193434 -0.004860497836025403 +< 1 -1 0 0 >: 0.000518715288386869 0.009720995672050805 +< 2 -2 0 0 >: -0.000518715288386869 -0.009720995672050809 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 1 2 ) +l=( 2 1 1 0 ) +num_ms=5 +< 0 0 0 0 >: 0.000121874643713454 0.003691822861407739 +< 0 1 -1 0 >: 0.000121874643713454 0.003691822861407738 +< 1 -1 0 0 >: -0.000211093075066057 -0.006394424768502517 +< 1 0 -1 0 >: -0.000211093075066057 -0.006394424768502517 +< 2 -1 -1 0 >: 0.000298530689681459 0.009043082231190699 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.018986895339668273 0.010069321218616062 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.003813645922355822 0.032025295375989443 +< 1 -1 0 >: -0.007627291844711643 -0.064050590751978873 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: -0.020494722777808224 -0.109750203166273874 +< -1 0 1 >: 0.028983914909453182 0.155210225790947121 +< -1 1 0 >: -0.008366935537571001 -0.044805332820692947 +< 0 0 0 >: -0.008366935537571001 -0.044805332820692954 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.012065695405917632 0.084713234829181264 +< 1 -1 0 >: 0.024131390811835268 -0.169426469658362555 +< 2 -2 0 >: -0.024131390811835275 0.169426469658362583 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 2 2 2 ) +num_ms=5 +< -2 0 2 >: -0.120655043887796895 0.034518829883595066 +< -2 1 1 >: 0.098514430806070891 -0.028184506577581182 +< -1 -1 2 >: 0.049257215403035445 -0.014092253288790591 +< -1 0 1 >: -0.060327521943898434 0.017259414941797526 +< 0 0 0 >: 0.020109173981299477 -0.005753138313932508 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: -0.007326806974795491 -0.028045977233177387 +< -2 -1 3 >: 0.010361669792645573 0.039663001373166522 +< -2 0 2 >: -0.006783305164419386 -0.025965529440238989 +< -2 1 1 >: 0.003916343062672911 0.014991205411973135 +< -2 2 0 >: -0.000875720931134635 -0.003352135436583467 +< -1 -1 2 >: -0.005538545474137816 -0.021200766009933352 +< -1 0 1 >: 0.009593042161237355 0.036720803888583863 +< -1 1 0 >: -0.003502883724538540 -0.013408541746333871 +< 0 0 0 >: -0.002627162793403904 -0.010056406309750399 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: -0.001031271630432890 0.024875652818421367 +< -2 0 2 >: 0.002916876652497616 -0.070358971177392038 +< -2 1 1 >: -0.001597639140033101 0.038537195636713428 +< -1 -2 3 >: 0.001630583619241674 -0.039331860594899230 +< -1 -1 2 >: -0.001263044640384324 0.030466328211879303 +< -1 0 1 >: 0.000922397387565993 -0.022249460274669768 +< 0 -3 3 >: -0.001630583619241674 0.039331860594899223 +< 0 -1 1 >: 0.000978350171545004 -0.023599116356939530 +< 0 0 0 >: -0.000652233447696670 0.015732744237959690 +< 1 -3 2 >: 0.001630583619241674 -0.039331860594899230 +< 1 -2 1 >: -0.001263044640384324 0.030466328211879303 +< 2 -3 1 >: -0.001031271630432890 0.024875652818421367 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: 0.013674779634781781 -0.035644073162967756 +< -2 -1 3 >: -0.020512169452172671 0.053466109744451637 +< -2 0 2 >: 0.049033463537503534 -0.127808447992761975 +< -2 1 1 >: -0.025842904390888037 0.067360966644717218 +< -1 -3 4 >: -0.025583170116493557 0.066683954822464558 +< -1 -2 3 >: 0.024173823527464736 -0.063010414606609819 +< -1 -1 2 >: -0.016446323646317283 0.042868256671584351 +< -1 0 1 >: 0.011557298190810687 -0.030124740089536722 +< 0 -4 4 >: 0.029540900306963075 -0.076999998534757474 +< 0 -3 3 >: -0.007385225076740766 0.019249999633689362 +< 0 -2 2 >: -0.008440257230560881 0.021999999581359286 +< 0 -1 1 >: 0.017935546614941865 -0.046749999110388463 +< 0 0 0 >: -0.010550321538201098 0.027499999476699101 +< 1 -4 3 >: -0.025583170116493557 0.066683954822464558 +< 1 -3 2 >: 0.024173823527464736 -0.063010414606609819 +< 1 -2 1 >: -0.016446323646317283 0.042868256671584351 +< 2 -4 2 >: 0.013674779634781781 -0.035644073162967756 +< 2 -3 1 >: -0.020512169452172671 0.053466109744451637 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.009321287240871334 -0.074857642926248552 +< 0 1 -1 >: -0.010763295395421773 -0.086438160588740931 +< 1 -2 1 >: 0.006214191493914220 0.049905095284165681 +< 1 -1 0 >: 0.017576387779754035 0.141152925164777426 +< 1 0 -1 >: 0.015221598324033355 0.122242019011180980 +< 2 -2 0 >: -0.013895354605593170 -0.111591185478998670 +< 2 -1 -1 >: -0.019650998937213310 -0.157813767945691491 +< 3 -2 -1 >: 0.024067460166073567 0.193281602926467982 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.002613170775531592 0.001424210166313564 +< 1 -1 0 >: -0.005226341551063184 -0.002848420332627128 +< 2 -2 0 >: 0.005226341551063184 0.002848420332627128 +< 3 -3 0 >: -0.005226341551063184 -0.002848420332627128 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: -0.001638737005437354 -0.043698457336331438 +< -3 0 3 >: 0.002007034742969010 0.053519461510396084 +< -3 1 2 >: -0.001858153105982546 -0.049549393195328140 +< -3 2 1 >: 0.001384985552526448 0.036931937142873066 +< -3 3 0 >: -0.000379293914468746 -0.010114227532757238 +< -2 -2 4 >: 0.001057800188478781 0.028207232919761155 +< -2 -1 3 >: -0.000946125251220258 -0.025229316106302330 +< -2 0 2 >: -0.000437970887241034 -0.011678903977365028 +< -2 1 1 >: 0.001430406927912749 0.038143140666007075 +< -2 2 0 >: -0.000885019133760407 -0.023599864243100222 +< -1 -1 2 >: 0.000799621781574887 0.021322663851132108 +< -1 0 1 >: -0.000979332676036849 -0.026114823196080873 +< -1 1 0 >: -0.000126431304822915 -0.003371409177585748 +< 0 0 0 >: 0.000379293914468746 0.010114227532757238 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.002406610681941587 0.026892227459352502 +< 0 1 -1 >: 0.002947484090144173 0.032936117661138041 +< 1 -2 1 >: -0.002084185987580406 -0.023289352144148720 +< 1 -1 0 >: -0.004660381545982320 -0.052076574546247020 +< 1 0 -1 >: -0.003805185598113233 -0.042520345063438526 +< 2 -3 1 >: 0.001203305340970793 0.013446113729676253 +< 2 -2 0 >: 0.004168371975160813 0.046578704288297454 +< 2 -1 -1 >: 0.004660381545982321 0.052076574546247027 +< 3 -3 0 >: -0.003183646683484500 -0.035575073029014533 +< 3 -2 -1 >: -0.005514237809143309 -0.061617833969226425 +< 4 -3 -1 >: 0.006367293366969003 0.071150146058029079 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.014767957273141234 0.040172809034638220 +< 1 -1 0 >: 0.029535914546282457 -0.080345618069276412 +< 2 -2 0 >: -0.029535914546282457 0.080345618069276412 +< 3 -3 0 >: 0.029535914546282457 -0.080345618069276412 +< 4 -4 0 >: -0.029535914546282464 0.080345618069276425 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 2 ) +l=( 4 4 4 ) +num_ms=13 +< -4 0 4 >: -0.016466403054395954 0.014289760802882370 +< -4 1 3 >: 0.034714225681496458 -0.030125460904069784 +< -4 2 2 >: -0.019681116023445286 0.017079530932150221 +< -3 -1 4 >: 0.017357112840748225 -0.015062730452034887 +< -3 0 3 >: -0.024699604581593933 0.021434641204323555 +< -3 1 2 >: 0.013120744015630190 -0.011386353954766813 +< -2 -2 4 >: -0.009840558011722641 0.008539765466075109 +< -2 -1 3 >: 0.006560372007815095 -0.005693176977383406 +< -2 0 2 >: 0.012937888114168248 -0.011227669202264718 +< -2 1 1 >: -0.014877525292069912 0.012910911816029909 +< -1 -1 2 >: -0.007438762646034956 0.006455455908014955 +< -1 0 1 >: 0.010585544820683114 -0.009186274801852952 +< 0 0 0 >: -0.003528514940227706 0.003062091600617652 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 1 ) +l=( 0 0 0 0 ) +num_ms=1 +< 0 0 0 0 >: -0.000096232900583378 -0.007181811938265209 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 1 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: -0.000202105566068617 0.017235014306926640 +< 1 -1 0 0 >: 0.000404211132137234 -0.034470028613853274 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 1 ) +l=( 1 1 1 1 ) +num_ms=5 +< 0 0 0 0 >: 0.000064703297946057 -0.003457522621016441 +< 0 0 1 -1 >: -0.000129406595892114 0.006915045242032880 +< 1 -1 -1 1 >: 0.000129406595892114 -0.006915045242032879 +< 1 -1 0 0 >: -0.000129406595892114 0.006915045242032880 +< 1 -1 1 -1 >: 0.000129406595892114 -0.006915045242032879 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 1 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: 0.000346797029018903 0.007220241099190649 +< 1 -1 0 0 >: -0.000693594058037806 -0.014440482198381300 +< 2 -2 0 0 >: 0.000693594058037806 0.014440482198381304 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 1 ) +l=( 2 2 1 1 ) +num_ms=8 +< 0 0 0 0 >: 0.000018213204980344 -0.017773446029033343 +< 0 0 1 -1 >: -0.000036426409960688 0.035546892058066680 +< 1 -1 -1 1 >: 0.000036426409960688 -0.035546892058066687 +< 1 -1 0 0 >: -0.000036426409960688 0.035546892058066694 +< 1 -1 1 -1 >: 0.000036426409960688 -0.035546892058066687 +< 2 -2 -1 1 >: -0.000036426409960688 0.035546892058066694 +< 2 -2 0 0 >: 0.000036426409960688 -0.035546892058066701 +< 2 -2 1 -1 >: -0.000036426409960688 0.035546892058066694 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 1 ) +l=( 2 2 2 2 ) +num_ms=13 +< 0 0 0 0 >: -0.000727799869848321 -0.001653804898473280 +< 0 0 1 -1 >: 0.001455599739696642 0.003307609796946560 +< 0 0 2 -2 >: -0.001455599739696642 -0.003307609796946562 +< 1 -1 -2 2 >: 0.001455599739696643 0.003307609796946562 +< 1 -1 -1 1 >: -0.001455599739696642 -0.003307609796946561 +< 1 -1 0 0 >: 0.001455599739696642 0.003307609796946560 +< 1 -1 1 -1 >: -0.001455599739696642 -0.003307609796946561 +< 1 -1 2 -2 >: 0.001455599739696643 0.003307609796946562 +< 2 -2 -2 2 >: -0.001455599739696643 -0.003307609796946563 +< 2 -2 -1 1 >: 0.001455599739696643 0.003307609796946562 +< 2 -2 0 0 >: -0.001455599739696642 -0.003307609796946562 +< 2 -2 1 -1 >: 0.001455599739696643 0.003307609796946562 +< 2 -2 2 -2 >: -0.001455599739696643 -0.003307609796946563 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 2 ) +l=( 0 0 0 0 ) +num_ms=1 +< 0 0 0 0 >: 0.000020935512243829 0.000901079341750005 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 2 ) +l=( 0 1 1 2 ) +num_ms=4 +< 0 -1 -1 2 >: -0.000168814917448911 0.008250168730277932 +< 0 -1 0 1 >: 0.000238740345787144 -0.011667500510225469 +< 0 -1 1 0 >: -0.000068918401453316 0.003368117280174384 +< 0 0 0 0 >: -0.000068918401453316 0.003368117280174385 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 2 ) +l=( 0 2 2 2 ) +num_ms=5 +< 0 -2 0 2 >: 0.000814856742190073 -0.034047282432673624 +< 0 -2 1 1 >: -0.000665327743944100 0.027799489696158645 +< 0 -1 -1 2 >: -0.000332663871972050 0.013899744848079322 +< 0 -1 0 1 >: 0.000407428371095036 -0.017023641216336809 +< 0 0 0 0 >: -0.000135809457031679 0.005674547072112269 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 2 ) +l=( 1 1 0 0 ) +num_ms=2 +< 0 0 0 0 >: 0.000082623206527214 -0.005265773447052712 +< 1 -1 0 0 >: -0.000165246413054427 0.010531546894105423 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 2 ) +l=( 1 1 1 1 ) +num_ms=3 +< -1 -1 1 1 >: -0.000011504996837292 0.001339849741944992 +< -1 0 0 1 >: 0.000011504996837292 -0.001339849741944992 +< 0 0 0 0 >: -0.000002876249209323 0.000334962435486248 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 2 ) +l=( 1 1 2 2 ) +num_ms=11 +< -1 -1 0 2 >: -0.000144780468302614 0.006236442820208421 +< -1 -1 1 1 >: 0.000088659568015650 -0.003819025679888580 +< -1 0 -1 2 >: 0.000125383563521872 -0.005400917911549560 +< -1 0 0 1 >: -0.000102375250920142 0.004409831008651529 +< -1 1 -2 2 >: 0.000030428886117350 -0.004315425479804201 +< -1 1 -1 1 >: -0.000119088454133000 0.008134451159692781 +< -1 1 0 0 >: 0.000074320821735775 -0.004703729859827819 +< 0 0 -2 2 >: -0.000103874011074325 0.005976738419790680 +< 0 0 -1 1 >: 0.000015214443058675 -0.002157712739902101 +< 0 0 0 0 >: 0.000007169373139937 0.000442352089969620 +< 0 1 -2 1 >: 0.000125383563521872 -0.005400917911549560 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 2 ) +l=( 2 2 0 0 ) +num_ms=3 +< 0 0 0 0 >: -0.000107196788060430 -0.000335221069303797 +< 1 -1 0 0 >: 0.000214393576120860 0.000670442138607594 +< 2 -2 0 0 >: -0.000214393576120860 -0.000670442138607594 +ctilde_basis_func: rank=4 ndens=2 mu0=0 mu=( 0 0 0 0 ) +n=( 2 2 2 2 ) +l=( 2 2 2 2 ) +num_ms=6 +< -2 -2 2 2 >: 0.000592031129020375 0.000530260317488982 +< -2 -1 1 2 >: -0.001184062258040749 -0.001060520634977963 +< -2 0 0 2 >: 0.000592031129020374 0.000530260317488981 +< -1 -1 1 1 >: 0.000592031129020374 0.000530260317488981 +< -1 0 0 1 >: -0.000592031129020374 -0.000530260317488981 +< 0 0 0 0 >: 0.000148007782255094 0.000132565079372245 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.015496423957503546 -0.211402399527168994 +< 1 -1 0 >: 0.030992847915007088 0.422804799054337876 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: 0.010335376702368096 0.186370131773652109 +< -1 0 1 >: -0.014616429904723878 -0.263567167975559735 +< -1 1 0 >: 0.004219399870041812 0.076085287690118339 +< 0 0 0 >: 0.004219399870041813 0.076085287690118353 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.030084347150259941 0.124342680618911530 +< 1 -1 0 >: -0.060168694300519888 -0.248685361237823088 +< 2 -2 0 >: 0.060168694300519902 0.248685361237823171 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 2 2 2 ) +num_ms=7 +< -2 0 2 >: 0.129546917496429492 -0.024167972229472437 +< -2 1 1 >: -0.158661922808341349 0.029599600039980717 +< -2 2 0 >: 0.064773458748214774 -0.012083986114736222 +< -1 -1 2 >: -0.079330961404170675 0.014799800019990358 +< -1 0 1 >: 0.064773458748214732 -0.012083986114736215 +< -1 1 0 >: 0.032386729374107366 -0.006041993057368108 +< 0 0 0 >: -0.032386729374107366 0.006041993057368108 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: -0.005437462674323070 0.002070360366137689 +< -2 -1 3 >: 0.007689733458925168 -0.002927931708791647 +< -2 0 2 >: -0.005034112235651309 0.001916781240742731 +< -2 1 1 >: 0.002906446054384072 -0.001106654165320441 +< -2 2 0 >: -0.000649901095053884 0.000247455394123980 +< -1 -1 2 >: -0.004110335428415725 0.001565045329452845 +< -1 0 1 >: 0.007119309798166423 -0.002710738026760699 +< -1 1 0 >: -0.002599604380215535 0.000989821576495919 +< 0 0 0 >: -0.001949703285161650 0.000742366182371939 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: -0.019415948844952600 -0.041919380289178819 +< -2 0 2 >: 0.027458298182874204 0.059282956131232099 +< -2 1 1 >: -0.030079058610926628 -0.064941224697330019 +< -2 2 0 >: 0.027458298182874204 0.059282956131232099 +< -1 -2 3 >: 0.030699310641682822 0.066280359908286429 +< -1 -1 2 >: -0.023779583771057145 -0.051340546021085433 +< -1 0 1 >: 0.008683076292994509 0.018746916780253729 +< -1 1 0 >: 0.008683076292994509 0.018746916780253729 +< 0 -3 3 >: -0.030699310641682818 -0.066280359908286415 +< 0 -1 1 >: 0.018419586385009686 0.039768215944971839 +< 0 0 0 >: -0.012279724256673128 -0.026512143963314569 +< 1 -3 2 >: 0.030699310641682822 0.066280359908286429 +< 1 -2 1 >: -0.023779583771057145 -0.051340546021085433 +< 2 -3 1 >: -0.019415948844952600 -0.041919380289178819 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.010916976047477154 0.029562404251441590 +< 0 1 -1 >: 0.012605838119495259 0.034135724104924658 +< 1 -2 1 >: -0.007277984031651434 -0.019708269500961051 +< 1 -1 0 >: -0.020585247448592556 -0.055743404038326318 +< 1 0 -1 >: -0.017827347233669948 -0.048275203990610638 +< 2 -2 0 >: 0.016274067033930591 0.044069030323034782 +< 2 -1 -1 >: 0.023015006314353527 0.062323020363466958 +< 3 -2 -1 >: -0.028187510948549519 -0.076329799559789718 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.003019318068367032 0.035361910211253469 +< 1 -1 0 >: 0.006038636136734063 -0.070723820422506939 +< 2 -2 0 >: -0.006038636136734062 0.070723820422506925 +< 3 -3 0 >: 0.006038636136734062 -0.070723820422506925 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 3 3 2 ) +num_ms=12 +< -3 1 2 >: 0.000780557466224931 0.022883587515913923 +< -3 2 1 >: -0.001234169718960367 -0.036182128793041307 +< -3 3 0 >: 0.001234169718960367 0.036182128793041300 +< -2 1 1 >: 0.000955983753585398 0.028026556449156175 +< -2 3 -1 >: -0.001234169718960367 -0.036182128793041307 +< -1 1 0 >: -0.000740501831376220 -0.021709277275824775 +< -1 2 -1 >: 0.000955983753585398 0.028026556449156175 +< -1 3 -2 >: 0.000780557466224931 0.022883587515913923 +< 0 0 0 >: 0.000493667887584147 0.014472851517216521 +< 0 1 -1 >: -0.000698151821929577 -0.020467702901859640 +< 0 2 -2 >: -0.002207749909893755 -0.064724559641514259 +< 1 1 -2 >: 0.001209234426978807 0.035451101340245844 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: 0.001088468824505481 0.005627282905129761 +< -3 0 3 >: -0.001333096610482720 -0.006891985877927236 +< -3 1 2 >: 0.001234207636923562 0.006380739053133610 +< -3 2 1 >: -0.000919924058170154 -0.004755922089831464 +< -3 3 0 >: 0.000251931578925744 0.001302462905168902 +< -2 -2 4 >: -0.000702603605029282 -0.003632395495994208 +< -2 -1 3 >: 0.000628427768832755 0.003248913300082847 +< -2 0 2 >: 0.000290905529820292 0.001503954617817535 +< -2 1 1 >: -0.000950093481884947 -0.004911895213273929 +< -2 2 0 >: 0.000587840350826736 0.003039080112060771 +< -1 -1 2 >: -0.000531118402618552 -0.002745832898809083 +< -1 0 1 >: 0.000650484539708764 0.003362944760514725 +< -1 1 0 >: 0.000083977192975248 0.000434154301722968 +< 0 0 0 >: -0.000251931578925744 -0.001302462905168902 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.007778889614829623 -0.017226748254304803 +< 0 1 -1 >: -0.009527155160883875 -0.021098371575213819 +< 1 -2 1 >: 0.006736716019677401 0.014918801612827192 +< 1 -1 0 >: 0.015063754965110481 0.033359454549115104 +< 1 0 -1 >: 0.012299504424945760 0.027237880580966350 +< 2 -3 1 >: -0.003889444807414812 -0.008613374127152405 +< 2 -2 0 >: -0.013473432039354806 -0.029837603225654395 +< 2 -1 -1 >: -0.015063754965110483 -0.033359454549115111 +< 3 -3 0 >: 0.010290503698531100 0.022788845889603292 +< 3 -2 -1 >: 0.017823675241331317 0.039471438926650088 +< 4 -3 -1 >: -0.020581007397062208 -0.045577691779206599 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.018737015545710532 -0.052616975313013861 +< 1 -1 0 >: -0.037474031091421049 0.105233950626027695 +< 2 -2 0 >: 0.037474031091421049 -0.105233950626027695 +< 3 -3 0 >: -0.037474031091421049 0.105233950626027695 +< 4 -4 0 >: 0.037474031091421056 -0.105233950626027709 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 4 4 2 ) +num_ms=18 +< -4 2 2 >: -0.006044870827777889 0.025085459056242251 +< -4 3 1 >: 0.011308917792424723 -0.046930596589202039 +< -4 4 0 >: -0.013058413463399518 0.054190785148011039 +< -3 1 2 >: 0.009067306241666833 -0.037628188584363377 +< -3 2 1 >: -0.010685922884296206 0.044345245519615953 +< -3 3 0 >: 0.003264603365849879 -0.013547696287002755 +< -3 4 -1 >: 0.011308917792424723 -0.046930596589202039 +< -2 1 1 >: 0.007270018580844463 -0.030169669235915589 +< -2 2 0 >: 0.003730975275257007 -0.015483081470860301 +< -2 3 -1 >: -0.010685922884296206 0.044345245519615953 +< -2 4 -2 >: -0.006044870827777889 0.025085459056242251 +< -1 1 0 >: -0.007928322459921136 0.032901548125578127 +< -1 2 -1 >: 0.007270018580844463 -0.030169669235915589 +< -1 3 -2 >: 0.009067306241666833 -0.037628188584363377 +< 0 0 0 >: 0.004663719094071257 -0.019353851838575371 +< 0 1 -1 >: -0.005108848299380770 0.021201082453201125 +< 0 2 -2 >: -0.021675007659273028 0.089948575026921870 +< 1 1 -2 >: 0.011423732084149601 -0.047407061561935734 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 3 ) +l=( 4 4 4 ) +num_ms=19 +< -4 0 4 >: 0.009407769941711568 -0.012810286243555288 +< -4 1 3 >: -0.014874990359339028 0.020254841004178591 +< -4 2 2 >: 0.016866653676554738 -0.022966830918090146 +< -4 3 1 >: -0.014874990359339032 0.020254841004178594 +< -4 4 0 >: 0.004703884970855784 -0.006405143121777644 +< -3 -1 4 >: -0.014874990359339027 0.020254841004178587 +< -3 0 3 >: 0.014111654912567351 -0.019215429365332930 +< -3 1 2 >: -0.005622217892184912 0.007655610306030048 +< -3 2 1 >: -0.005622217892184912 0.007655610306030048 +< -3 3 0 >: 0.007055827456283674 -0.009607714682666463 +< -2 -2 4 >: 0.008433326838277367 -0.011483415459045071 +< -2 -1 3 >: -0.005622217892184912 0.007655610306030048 +< -2 0 2 >: -0.007391819239916232 0.010065224905650583 +< -2 1 1 >: 0.012749991736576313 -0.017361292289295938 +< -2 2 0 >: -0.003695909619958114 0.005032612452825289 +< -1 -1 2 >: 0.006374995868288156 -0.008680646144647969 +< -1 0 1 >: -0.006047852105386008 0.008235184013714114 +< -1 1 0 >: -0.003023926052693004 0.004117592006857056 +< 0 0 0 >: 0.003023926052693005 -0.004117592006857058 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.012095863652752078 0.074670222274287504 +< 1 -1 0 >: -0.024191727305504153 -0.149340444548574980 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: -0.027722962161594932 -0.182169209836380019 +< -1 0 1 >: 0.039206189078083695 0.257626167197398892 +< -1 1 0 >: -0.011317851909065490 -0.074370268490854874 +< 0 0 0 >: -0.011317851909065492 -0.074370268490854888 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.010303945864100435 -0.114024069317504431 +< 1 -1 0 >: 0.020607891728200874 0.228048138635008890 +< 2 -2 0 >: -0.020607891728200878 -0.228048138635008946 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 2 2 2 ) +num_ms=7 +< -2 0 2 >: 0.042022451452387269 0.080597823448569278 +< -2 1 1 >: -0.051466781899613338 -0.098711770913959981 +< -2 2 0 >: 0.021011225726193641 0.040298911724284653 +< -1 -1 2 >: -0.025733390949806669 -0.049355885456979991 +< -1 0 1 >: 0.021011225726193627 0.040298911724284632 +< -1 1 0 >: 0.010505612863096814 0.020149455862142316 +< 0 0 0 >: -0.010505612863096814 -0.020149455862142316 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: -0.056934482896859567 -0.047203325033994971 +< -2 -1 3 >: 0.080517517879437839 0.066755582452181134 +< -2 0 2 >: -0.052711088636069131 -0.043701787092569389 +< -2 1 1 >: 0.030432761213312742 0.025231238541962651 +< -2 2 0 >: -0.006804972281598627 -0.005641876453634117 +< -1 -1 2 >: -0.043038423648328772 -0.035682359741514340 +< -1 0 1 >: 0.074544736436579315 0.061803660006253106 +< -1 1 0 >: -0.027219889126394513 -0.022567505814536471 +< 0 0 0 >: -0.020414916844795877 -0.016925629360902347 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: 0.018889007523489963 0.016319736810161682 +< -2 0 2 >: -0.026713090619486946 -0.023079593131290089 +< -2 1 1 >: 0.029262724625945299 0.025282427552097746 +< -2 2 0 >: -0.026713090619486946 -0.023079593131290089 +< -1 -2 3 >: -0.029866143257142375 -0.025803769567300922 +< -1 -1 2 >: 0.023134215090071478 0.019987513960706055 +< -1 0 1 >: -0.008447420970005705 -0.007298408176485422 +< -1 1 0 >: -0.008447420970005705 -0.007298408176485422 +< 0 -3 3 >: 0.029866143257142371 0.025803769567300919 +< 0 -1 1 >: -0.017919685954285419 -0.015482261740380547 +< 0 0 0 >: 0.011946457302856948 0.010321507826920368 +< 1 -3 2 >: -0.029866143257142375 -0.025803769567300922 +< 1 -2 1 >: 0.023134215090071478 0.019987513960706055 +< 2 -3 1 >: 0.018889007523489963 0.016319736810161682 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.010671986401207595 -0.045090125829449212 +< 0 1 -1 >: -0.012322948443050454 -0.052065592570853178 +< 1 -2 1 >: 0.007114657600805060 0.030060083886299466 +< 1 -1 0 >: 0.020123290541398692 0.085022756636155300 +< 1 0 -1 >: 0.017427280816586368 0.073631867146692426 +< 2 -2 0 >: -0.015908858032035681 -0.067216390979111681 +< 2 -1 -1 >: -0.022498522790773006 -0.095058331736432286 +< 3 -2 -1 >: 0.027554950401886016 0.116422204277235763 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.001864695096017076 -0.055191671252036840 +< 1 -1 0 >: -0.003729390192034152 0.110383342504073681 +< 2 -2 0 >: 0.003729390192034151 -0.110383342504073667 +< 3 -3 0 >: -0.003729390192034151 0.110383342504073667 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 3 3 2 ) +num_ms=12 +< -3 1 2 >: -0.001824350276484969 -0.001765977023819884 +< -3 2 1 >: 0.002884551061825212 0.002792254845398130 +< -3 3 0 >: -0.002884551061825211 -0.002792254845398130 +< -2 1 1 >: -0.002234363644746794 -0.002162871302918785 +< -2 3 -1 >: 0.002884551061825212 0.002792254845398130 +< -1 1 0 >: 0.001730730637095126 0.001675352907238878 +< -1 2 -1 >: -0.002234363644746794 -0.002162871302918785 +< -1 3 -2 >: -0.001824350276484969 -0.001765977023819884 +< 0 0 0 >: -0.001153820424730084 -0.001116901938159252 +< 0 1 -1 >: 0.001631748493196371 0.001579537868785611 +< 0 2 -2 >: 0.005160041807048300 0.004994937315850710 +< 1 1 -2 >: -0.002826271295390074 -0.002735839841215740 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: -0.000880613013969882 0.073925413803475143 +< -3 0 3 >: 0.001078526272540303 -0.090539771421307161 +< -3 1 2 >: -0.000998521301250582 0.083823540210658604 +< -3 2 1 >: 0.000744253835525948 -0.062478378008573206 +< -3 3 0 >: -0.000203822307113651 0.017110408495815126 +< -2 -2 4 >: 0.000568433256259812 -0.047718649420391841 +< -2 -1 3 >: -0.000508422160667399 0.042680857559390842 +< -2 0 2 >: -0.000235353727757834 0.019757397902006639 +< -2 1 1 >: 0.000768662056091465 -0.064527391340068213 +< -2 2 0 >: -0.000475585383265185 0.039924286490235293 +< -1 -1 2 >: 0.000429695152286318 -0.036071908361780945 +< -1 0 1 >: -0.000526266934024496 0.044178884767398584 +< -1 1 0 >: -0.000067940769037884 0.005703469498605046 +< 0 0 0 >: 0.000203822307113651 -0.017110408495815126 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.005754255337477731 0.002739786439421501 +< 0 1 -1 >: 0.007047494713253530 0.003355539390389707 +< 1 -2 1 >: -0.004983331302117914 -0.002372724657483135 +< 1 -1 0 >: -0.011143067545938199 -0.005305573626022196 +< 1 0 -1 >: -0.009098276552305242 -0.004331982725507440 +< 2 -3 1 >: 0.002877127668738867 0.001369893219710751 +< 2 -2 0 >: 0.009966662604235831 0.004745449314966272 +< 2 -1 -1 >: 0.011143067545938200 0.005305573626022197 +< 3 -3 0 >: -0.007612164301666063 -0.003624396782068212 +< 3 -2 -1 >: -0.013184655326047687 -0.006277639373331288 +< 4 -3 -1 >: 0.015224328603332131 0.007248793564136426 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.007116166719745826 0.026591214056357816 +< 1 -1 0 >: 0.014232333439491648 -0.053182428112715618 +< 2 -2 0 >: -0.014232333439491648 0.053182428112715618 +< 3 -3 0 >: 0.014232333439491648 -0.053182428112715618 +< 4 -4 0 >: -0.014232333439491651 0.053182428112715625 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 4 4 2 ) +num_ms=18 +< -4 2 2 >: 0.010506451961026682 -0.021355907622853013 +< -4 3 1 >: -0.019655771794380526 0.039953244754154946 +< -4 4 0 >: 0.022696530273230889 -0.046134033227620705 +< -3 1 2 >: -0.015759677941540023 0.032033861434279519 +< -3 2 1 >: 0.018572958569631662 -0.037752267746282105 +< -3 3 0 >: -0.005674132568307720 0.011533508306905171 +< -3 4 -1 >: -0.019655771794380526 0.039953244754154946 +< -2 1 1 >: -0.012635853296387476 0.025684228770528172 +< -2 2 0 >: -0.006484722935208827 0.013181152350748775 +< -2 3 -1 >: 0.018572958569631662 -0.037752267746282105 +< -2 4 -2 >: 0.010506451961026682 -0.021355907622853013 +< -1 1 0 >: 0.013780036237318752 -0.028009948745341139 +< -1 2 -1 >: -0.012635853296387476 0.025684228770528172 +< -1 3 -2 >: -0.015759677941540023 0.032033861434279519 +< 0 0 0 >: -0.008105903669011032 0.016476440438435967 +< 0 1 -1 >: 0.008879572576962463 -0.018049036191043377 +< 0 2 -2 >: 0.037672835899249593 -0.076575575307409119 +< 1 1 -2 >: -0.019855327893231054 0.040358871851526874 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 2 4 ) +l=( 4 4 4 ) +num_ms=19 +< -4 0 4 >: -0.000815261153535848 0.006227177581522628 +< -4 1 3 >: 0.001289041066514758 -0.009846032275975178 +< -4 2 2 >: -0.001461635182177508 0.011164351201262402 +< -4 3 1 >: 0.001289041066514758 -0.009846032275975180 +< -4 4 0 >: -0.000407630576767924 0.003113588790761314 +< -3 -1 4 >: 0.001289041066514758 -0.009846032275975176 +< -3 0 3 >: -0.001222891730303773 0.009340766372283942 +< -3 1 2 >: 0.000487211727392503 -0.003721450400420801 +< -3 2 1 >: 0.000487211727392503 -0.003721450400420801 +< -3 3 0 >: -0.000611445865151886 0.004670383186141970 +< -2 -2 4 >: -0.000730817591088754 0.005582175600631200 +< -2 -1 3 >: 0.000487211727392503 -0.003721450400420801 +< -2 0 2 >: 0.000640562334921024 -0.004892782385482065 +< -2 1 1 >: -0.001104892342726936 0.008439456236550154 +< -2 2 0 >: 0.000320281167460512 -0.002446391192741031 +< -1 -1 2 >: -0.000552446171363468 0.004219728118275077 +< -1 0 1 >: 0.000524096455844474 -0.004003185588121690 +< -1 1 0 >: 0.000262048227922237 -0.002001592794060844 +< 0 0 0 >: -0.000262048227922237 0.002001592794060845 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.044909625842496657 -0.074854674750367375 +< 0 1 -1 >: 0.044909625842496650 -0.074854674750367362 +< 1 -1 0 >: -0.077785753708112457 0.129652099851679470 +< 1 0 -1 >: -0.077785753708112457 0.129652099851679470 +< 2 -1 -1 >: 0.110005667853425901 -0.183355758000395830 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.011830002482392145 -0.182045459226579193 +< 0 1 -1 >: -0.013660110235446086 -0.210207989778429000 +< 1 -2 1 >: 0.007886668321594761 0.121363639484386096 +< 1 -1 0 >: 0.022306866604675138 0.343268209875555452 +< 1 0 -1 >: 0.019318313158479386 0.297278990063839232 +< 2 -2 0 >: -0.017635126483080060 -0.271377347883864861 +< 2 -1 -1 >: -0.024939835046536761 -0.383785525898203250 +< 3 -2 -1 >: 0.030544935066598111 0.470039354558148270 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.009918496013901573 0.142717750537309895 +< 0 1 -1 >: -0.013224661351868769 0.190290334049746573 +< 0 2 -2 >: -0.003306165337967192 0.047572583512436636 +< 1 -2 1 >: 0.007392810440548207 -0.106375530599094034 +< 1 -1 0 >: 0.018108613344463221 -0.260565771085598918 +< 1 0 -1 >: 0.018108613344463224 -0.260565771085598974 +< 1 1 -2 >: 0.007392810440548207 -0.106375530599094034 +< 2 -2 0 >: -0.012804723293755146 0.184247823679728584 +< 2 -1 -1 >: -0.020910025578153385 0.300875436155745968 +< 2 0 -2 >: -0.012804723293755151 0.184247823679728640 +< 3 -2 -1 >: 0.019559537915532423 -0.281443199547744605 +< 3 -1 -2 >: 0.019559537915532419 -0.281443199547744605 +< 4 -2 -2 >: -0.027661363793896721 0.398020789838097688 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.002662617097155242 0.043569531234203263 +< 0 1 -1 >: -0.003261026634220442 0.053361559928026096 +< 1 -2 1 >: 0.002305894046687218 -0.037732320879799594 +< 1 -1 0 >: 0.005156135837304694 -0.084372034436066570 +< 1 0 -1 >: 0.004209967281958199 -0.068889477642964686 +< 2 -3 1 >: -0.001331308548577621 0.021784765617101635 +< 2 -2 0 >: -0.004611788093374438 0.075464641759599216 +< 2 -1 -1 >: -0.005156135837304694 0.084372034436066584 +< 3 -3 0 >: 0.003522311337830738 -0.057637072192681452 +< 3 -2 -1 >: 0.006100822197198743 -0.099830337437239625 +< 4 -3 -1 >: -0.007044622675661477 0.115274144385362945 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.003440880470860412 0.013618720548827392 +< 0 1 -1 >: -0.001146960156953472 -0.004539573516275801 +< 0 2 -2 >: -0.008028721098674294 -0.031777014613930586 +< 0 3 -3 >: -0.003440880470860412 -0.013618720548827392 +< 1 -3 2 >: 0.006282159505230815 0.024864268163172991 +< 1 -2 1 >: 0.006488186437860689 0.025679705736427819 +< 1 -1 0 >: -0.004442157586644238 -0.017581692627420414 +< 1 0 -1 >: -0.004442157586644236 -0.017581692627420407 +< 1 1 -2 >: 0.006488186437860687 0.025679705736427812 +< 1 2 -3 >: 0.006282159505230816 0.024864268163172998 +< 2 -3 1 >: -0.008428401419515532 -0.033358916294183201 +< 2 -2 0 >: -0.001986593266100584 -0.007862771974883781 +< 2 -1 -1 >: 0.007254012962874356 0.028710783834421945 +< 2 0 -2 >: -0.001986593266100584 -0.007862771974883781 +< 2 1 -3 >: -0.008428401419515532 -0.033358916294183194 +< 3 -3 0 >: 0.009103714016995480 0.036031747747082357 +< 3 -2 -1 >: -0.004291531943600353 -0.016985528779976698 +< 3 -1 -2 >: -0.004291531943600353 -0.016985528779976694 +< 3 0 -3 >: 0.009103714016995482 0.036031747747082364 +< 4 -3 -1 >: -0.007433151368620624 -0.029419798840343042 +< 4 -2 -2 >: 0.009596157153502179 0.037980796985806947 +< 4 -1 -3 >: -0.007433151368620624 -0.029419798840343042 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 2 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.031626196124089540 0.124238012018366747 +< 0 1 -1 >: -0.031626196124089533 0.124238012018366720 +< 1 -1 0 >: 0.054778178537060983 -0.215186549047164027 +< 1 0 -1 >: 0.054778178537060983 -0.215186549047164027 +< 2 -1 -1 >: -0.077468043009206428 0.304319736102762528 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.010343487681285667 0.081185770639017593 +< 0 1 -1 >: 0.011943630794299710 0.093745253065608006 +< 1 -2 1 >: -0.006895658454190442 -0.054123847092678382 +< 1 -1 0 >: -0.019503867414817636 -0.153085357212546791 +< 1 0 -1 >: -0.016890844653275592 -0.132575808293480812 +< 2 -2 0 >: 0.015419161053190952 0.121024601303033247 +< 2 -1 -1 >: 0.021805986681837659 0.171154632543546154 +< 3 -2 -1 >: -0.026706770354213965 -0.209620758422620096 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 2 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.035281108280478521 0.016415843772724075 +< 0 1 -1 >: -0.047041477707304706 0.021887791696965440 +< 0 2 -2 >: -0.011760369426826175 0.005471947924241359 +< 1 -2 1 >: 0.026296985478893566 -0.012235647527942548 +< 1 -1 0 >: 0.064414196196667967 -0.029971093116005623 +< 1 0 -1 >: 0.064414196196667980 -0.029971093116005626 +< 1 1 -2 >: 0.026296985478893566 -0.012235647527942548 +< 2 -2 0 >: -0.045547714935344624 0.021192763181901022 +< 2 -1 -1 >: -0.074379107027559246 0.034607637356866373 +< 2 0 -2 >: -0.045547714935344645 0.021192763181901029 +< 3 -2 -1 >: 0.069575283807829180 -0.032372480488778228 +< 3 -1 -2 >: 0.069575283807829180 -0.032372480488778221 +< 4 -2 -2 >: -0.098394309966989196 0.045781600954888556 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.002213108333893375 -0.056403580921133775 +< 0 1 -1 >: -0.002710493081769895 -0.069079996461279075 +< 1 -2 1 >: 0.001916608038478716 0.048846933942113140 +< 1 -1 0 >: 0.004285665860260942 0.109225064787006762 +< 1 0 -1 >: 0.003499231521901740 0.089181891950200362 +< 2 -3 1 >: -0.001106554166946688 -0.028201790460566891 +< 2 -2 0 >: -0.003833216076957434 -0.097693867884226307 +< 2 -1 -1 >: -0.004285665860260943 -0.109225064787006776 +< 3 -3 0 >: 0.002927667137963184 0.074614924085413703 +< 3 -2 -1 >: 0.005070868230601998 0.129236839518831331 +< 4 -3 -1 >: -0.005855334275926370 -0.149229848170827462 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 2 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.002552071211400202 0.000010578837385885 +< 0 1 -1 >: 0.000850690403800068 -0.000003526279128628 +< 0 2 -2 >: 0.005954832826600471 -0.000024683953900398 +< 0 3 -3 >: 0.002552071211400202 -0.000010578837385885 +< 1 -3 2 >: -0.004659423236144752 0.000019314226228094 +< 1 -2 1 >: -0.004812231625738799 0.000019947647073678 +< 1 -1 0 >: 0.003294709766696124 -0.000013657220339256 +< 1 0 -1 >: 0.003294709766696123 -0.000013657220339256 +< 1 1 -2 >: -0.004812231625738799 0.000019947647073678 +< 1 2 -3 >: -0.004659423236144753 0.000019314226228094 +< 2 -3 1 >: 0.006251272255177035 -0.000025912753667297 +< 2 -2 0 >: 0.001473439000893000 -0.000006107694612454 +< 2 -1 -1 >: -0.005380238519313141 0.000022302147423959 +< 2 0 -2 >: 0.001473439000893000 -0.000006107694612454 +< 2 1 -3 >: 0.006251272255177034 -0.000025912753667297 +< 3 -3 0 >: -0.006752145753492282 0.000027988972883245 +< 3 -2 -1 >: 0.003182992033236229 -0.000013194128349459 +< 3 -1 -2 >: 0.003182992033236228 -0.000013194128349459 +< 3 0 -3 >: -0.006752145753492283 0.000027988972883245 +< 4 -3 -1 >: 0.005513103921652112 -0.000022852900662848 +< 4 -2 -2 >: -0.007117386558156476 0.000029502967893248 +< 4 -1 -3 >: 0.005513103921652112 -0.000022852900662848 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 2 1 1 ) +num_ms=4 +< 0 -1 1 >: 0.015761397451015922 -0.034885911749473052 +< 0 0 0 >: 0.015761397451015922 -0.034885911749473059 +< 1 -1 0 >: -0.054599082366892350 0.120848343236902800 +< 2 -1 -1 >: 0.038607381388192433 -0.085452682997973414 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 2 2 2 ) +num_ms=8 +< -2 0 2 >: -0.024039661482545320 -0.096286931071182427 +< -2 1 1 >: 0.014721226055368649 0.058963462505733047 +< -1 -1 2 >: 0.014721226055368649 0.058963462505733047 +< -1 0 1 >: -0.012019830741272653 -0.048143465535591186 +< 0 -2 2 >: -0.012019830741272653 -0.048143465535591186 +< 0 -1 1 >: -0.006009915370636327 -0.024071732767795593 +< 0 0 0 >: 0.006009915370636327 0.024071732767795593 +< 1 -2 1 >: 0.014721226055368649 0.058963462505733047 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: 0.011712964679141825 0.035618966481091710 +< -2 0 2 >: -0.033129267009678810 -0.100745650950545190 +< -2 1 1 >: 0.018145646854812802 0.055180665596155372 +< -1 -2 3 >: -0.018519823269595739 -0.056318530990721309 +< -1 -1 2 >: 0.014345393419569783 0.043624146521985999 +< -1 0 1 >: -0.010476394096246056 -0.031858572136003023 +< 0 -3 3 >: 0.018519823269595739 0.056318530990721302 +< 0 -1 1 >: -0.011111893961757440 -0.033791118594432776 +< 0 0 0 >: 0.007407929307838295 0.022527412396288523 +< 1 -3 2 >: -0.018519823269595739 -0.056318530990721309 +< 1 -2 1 >: 0.014345393419569783 0.043624146521985999 +< 2 -3 1 >: 0.011712964679141825 0.035618966481091710 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: -0.000325432350205215 -0.000378105260875749 +< -2 -1 3 >: 0.000488148525307823 0.000567157891313623 +< -2 0 2 >: -0.001166898166104609 -0.001355766675415617 +< -2 1 1 >: 0.000615009333727343 0.000714551778344593 +< -1 -3 4 >: 0.000608828178520274 0.000707370171166916 +< -1 -2 3 >: -0.000575288554118958 -0.000668401984918876 +< -1 -1 2 >: 0.000391389543334462 0.000454737967178732 +< -1 0 1 >: -0.000275040535402238 -0.000319557269964375 +< 0 -4 4 >: -0.000703014225517819 -0.000816800717479861 +< 0 -3 3 >: 0.000175753556379455 0.000204200179369965 +< 0 -2 2 >: 0.000200861207290806 0.000233371633565675 +< 0 -1 1 >: -0.000426830065492962 -0.000495914721327059 +< 0 0 0 >: 0.000251076509113507 0.000291714541957093 +< 1 -4 3 >: 0.000608828178520274 0.000707370171166916 +< 1 -3 2 >: -0.000575288554118958 -0.000668401984918876 +< 1 -2 1 >: 0.000391389543334462 0.000454737967178732 +< 2 -4 2 >: -0.000325432350205215 -0.000378105260875749 +< 2 -3 1 >: 0.000488148525307823 0.000567157891313623 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.008099599554954246 -0.002354940413717618 +< 0 1 -1 >: -0.009352611966762011 -0.002719250963570790 +< 1 -2 1 >: 0.005399733036636162 0.001569960275811745 +< 1 -1 0 >: 0.015272751387209840 0.004440518228879951 +< 1 0 -1 >: 0.013226590687007742 0.003845601592177918 +< 2 -2 0 >: -0.012074170130269825 -0.003510537898689381 +< 2 -1 -1 >: -0.017075455152627705 -0.004964650307551269 +< 3 -2 -1 >: 0.020913076124857863 0.006080430002426092 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: 0.019631542699033788 -0.035711676901976415 +< -3 1 2 >: -0.019631542699033788 0.035711676901976415 +< -3 2 1 >: 0.012416077782359243 -0.022586047614854231 +< -2 -1 3 >: -0.019631542699033788 0.035711676901976415 +< -2 1 1 >: 0.015206527586743538 -0.027662145981298958 +< -1 -2 3 >: 0.012416077782359243 -0.022586047614854231 +< -1 -1 2 >: 0.015206527586743538 -0.027662145981298958 +< -1 0 1 >: -0.011778925619420269 0.021427006141185843 +< 0 -2 2 >: -0.017558985591291709 0.031941494857331360 +< 0 -1 1 >: -0.005552638787056022 0.010100787561972214 +< 0 0 0 >: 0.007852617079613515 -0.014284670760790565 +< 1 -2 1 >: 0.019234904990517311 -0.034990154507591284 +< 1 -1 0 >: -0.005552638787056022 0.010100787561972214 +< 2 -2 0 >: -0.017558985591291709 0.031941494857331360 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 4 2 2 ) +num_ms=9 +< 0 -2 2 >: 0.009353804665421333 -0.010047640726051023 +< 0 -1 1 >: 0.037415218661685339 -0.040190562904204100 +< 0 0 0 >: 0.028061413996263992 -0.030142922178153061 +< 1 -2 1 >: -0.041831486160273552 0.044934415353890853 +< 1 -1 0 >: -0.102465796274966534 0.110066389507314608 +< 2 -2 0 >: 0.072454259385708111 -0.077828690401342007 +< 2 -1 -1 >: 0.059158655062081289 -0.063546859610778300 +< 3 -2 -1 >: -0.110675709352324056 0.118885288334477632 +< 4 -2 -2 >: 0.078259544595659730 -0.084064593564627074 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.010293696918808872 -0.032314368986093446 +< 0 1 -1 >: 0.012607152508970569 -0.039576857687973373 +< 1 -2 1 >: -0.008914603030546085 0.027985064449220918 +< 1 -1 0 >: -0.019933658368726685 0.062576506463170700 +< 1 0 -1 >: -0.016275763903446684 0.051093503573580605 +< 2 -3 1 >: 0.005146848459404437 -0.016157184493046726 +< 2 -2 0 >: 0.017829206061092177 -0.055970128898441857 +< 2 -1 -1 >: 0.019933658368726688 -0.062576506463170700 +< 3 -3 0 >: -0.013617281059320054 0.042747892055590840 +< 3 -2 -1 >: -0.023585822655687684 0.074041520956753329 +< 4 -3 -1 >: 0.027234562118640119 -0.085495784111181708 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 4 3 3 ) +num_ms=14 +< 0 -3 3 >: -0.002607958750132885 0.016684473672022890 +< 0 -2 2 >: -0.006085237083643398 0.038930438568053415 +< 0 -1 1 >: -0.000869319583377629 0.005561491224007634 +< 0 0 0 >: 0.002607958750132885 -0.016684473672022890 +< 1 -3 2 >: 0.009522918909938399 -0.060923083935119908 +< 1 -2 1 >: 0.009835228358793364 -0.062921090528084284 +< 1 -1 0 >: -0.006733720537907048 0.043079125781320511 +< 2 -3 1 >: -0.012776336416104280 0.081736894246712127 +< 2 -2 0 >: -0.003011411372849321 0.019265570731659274 +< 2 -1 -1 >: 0.005498059796123914 -0.035173958909803654 +< 3 -3 0 >: 0.013800020564732902 -0.088285936184354416 +< 3 -2 -1 >: -0.006505392081224297 0.041618389439573196 +< 4 -3 -1 >: -0.011267669607836723 0.072085165038528798 +< 4 -2 -2 >: 0.007273249456953178 -0.046530773950472511 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 3 ) +l=( 4 4 4 ) +num_ms=25 +< -4 0 4 >: -0.003648104537075803 0.026454157441520663 +< -4 1 3 >: 0.005768159739776860 -0.041827695547948941 +< -4 2 2 >: -0.003270239184416702 0.023714074357456379 +< -3 -1 4 >: 0.002884079869888429 -0.020913847773974467 +< -3 0 3 >: -0.005472156805613703 0.039681236162280982 +< -3 1 2 >: 0.002180159456277802 -0.015809382904970918 +< -2 -2 4 >: -0.003270239184416702 0.023714074357456375 +< -2 -1 3 >: 0.001090079728138901 -0.007904691452485459 +< -2 0 2 >: 0.002866367850559558 -0.020785409418337654 +< -2 1 1 >: -0.002472068459904368 0.017926155234835255 +< -1 -3 4 >: 0.002884079869888428 -0.020913847773974457 +< -1 -2 3 >: 0.001090079728138900 -0.007904691452485456 +< -1 -1 2 >: -0.002472068459904368 0.017926155234835258 +< -1 0 1 >: 0.002345210059548730 -0.017006244069548995 +< 0 -4 4 >: -0.001824052268537901 0.013227078720760330 +< 0 -3 3 >: -0.002736078402806852 0.019840618081140498 +< 0 -2 2 >: 0.001433183925279780 -0.010392704709168836 +< 0 -1 1 >: 0.001172605029774365 -0.008503122034774499 +< 0 0 0 >: -0.001172605029774366 0.008503122034774501 +< 1 -4 3 >: 0.002884079869888428 -0.020913847773974457 +< 1 -3 2 >: 0.001090079728138900 -0.007904691452485456 +< 1 -2 1 >: -0.002472068459904368 0.017926155234835258 +< 2 -4 2 >: -0.003270239184416702 0.023714074357456375 +< 2 -3 1 >: 0.001090079728138901 -0.007904691452485459 +< 3 -4 1 >: 0.002884079869888429 -0.020913847773974467 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 4 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: 0.009625484768779556 -0.059386974877105640 +< -2 0 2 >: -0.013612491104423707 0.083985865299513102 +< -2 1 1 >: 0.014911736883462550 -0.092001905872267378 +< -2 2 0 >: -0.013612491104423707 0.083985865299513102 +< -1 -2 3 >: -0.015219227726301290 0.093899051979425954 +< -1 -1 2 >: 0.011788763105220618 -0.072733892908196290 +< -1 0 1 >: -0.004304647651875987 0.026558662560656091 +< -1 1 0 >: -0.004304647651875987 0.026558662560656091 +< 0 -3 3 >: 0.015219227726301288 -0.093899051979425954 +< 0 -1 1 >: -0.009131536635780771 0.056339431187655553 +< 0 0 0 >: 0.006087691090520516 -0.037559620791770380 +< 1 -3 2 >: -0.015219227726301290 0.093899051979425954 +< 1 -2 1 >: 0.011788763105220618 -0.072733892908196290 +< 2 -3 1 >: 0.009625484768779556 -0.059386974877105640 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.006314448997840148 0.008714688795515652 +< 0 1 -1 >: 0.007291297657374341 0.010062855843989549 +< 1 -2 1 >: -0.004209632665226764 -0.005809792530343766 +< 1 -1 0 >: -0.011906639215544981 -0.016432574781972114 +< 1 0 -1 >: -0.010311452034357970 -0.014231027210775378 +< 2 -2 0 >: 0.009413024799750661 0.012991091033019172 +< 2 -1 -1 >: 0.013312027334761672 0.018372177128919212 +< 3 -2 -1 >: -0.016303837206074000 -0.022501229714941656 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 4 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: -0.022917611572427582 -0.095136539930398695 +< -3 1 2 >: 0.022917611572427585 0.095136539930398695 +< -3 2 1 >: -0.014494370219980818 -0.060169630977523370 +< -2 -1 3 >: 0.022917611572427585 0.095136539930398695 +< -2 1 1 >: -0.017751905590972488 -0.073692446953246241 +< -1 -2 3 >: -0.014494370219980818 -0.060169630977523370 +< -1 -1 2 >: -0.017751905590972488 -0.073692446953246241 +< -1 0 1 >: 0.013750566943456546 0.057081923958239203 +< 0 -2 2 >: 0.020498134943153581 0.085092708171397885 +< 0 -1 1 >: 0.006482079420585139 0.026908677009363880 +< 0 0 0 >: -0.009167044628971034 -0.038054615972159478 +< 1 -2 1 >: -0.022454581790300181 -0.093214391489357590 +< 1 -1 0 >: 0.006482079420585139 0.026908677009363880 +< 2 -2 0 >: 0.020498134943153581 0.085092708171397885 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 4 ) +l=( 3 3 2 ) +num_ms=14 +< -3 1 2 >: -0.009925536391645493 0.073082807694142202 +< -3 2 1 >: 0.015693650998244400 -0.115554065056783811 +< -3 3 0 >: -0.015693650998244400 0.115554065056783797 +< -2 1 1 >: -0.012156249791478398 0.089507793910298450 +< -2 3 -1 >: 0.015693650998244400 -0.115554065056783811 +< -1 1 0 >: 0.009416190598946637 -0.069332439034070256 +< -1 2 -1 >: -0.012156249791478398 0.089507793910298450 +< -1 3 -2 >: -0.009925536391645493 0.073082807694142202 +< 0 0 0 >: -0.006277460399297760 0.046221626022713520 +< 0 1 -1 >: 0.004438834816973460 -0.032683625198129333 +< 0 2 -2 >: 0.014036828178892772 -0.103354697817360730 +< 1 0 -1 >: 0.004438834816973460 -0.032683625198129333 +< 1 1 -2 >: -0.015376574858807463 0.113219398837396845 +< 2 0 -2 >: 0.014036828178892772 -0.103354697817360730 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 3 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.007795806063381553 0.037279924497378908 +< 0 1 -1 >: -0.009547873494490012 0.045658396334030481 +< 1 -2 1 >: 0.006751366093865186 -0.032285361665895955 +< 1 -1 0 >: 0.015096513526869783 -0.072192263363109216 +< 1 0 -1 >: 0.012326251678618338 -0.058944736205412601 +< 2 -3 1 >: -0.003897903031690777 0.018639962248689457 +< 2 -2 0 >: -0.013502732187730376 0.064570723331791938 +< 2 -1 -1 >: -0.015096513526869785 0.072192263363109230 +< 3 -3 0 >: 0.010312882056498515 -0.049316704557664598 +< 3 -2 -1 >: 0.017862435694320843 -0.085419037955738727 +< 4 -3 -1 >: -0.020625764112997037 0.098633409115329224 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.053271702106590713 -0.004203523508645967 +< 0 1 -1 >: -0.053271702106590706 -0.004203523508645966 +< 1 -1 0 >: 0.092269294654289125 0.007280716287785008 +< 1 0 -1 >: 0.092269294654289125 0.007280716287785008 +< 2 -1 -1 >: -0.130488487890694976 -0.010296487717976251 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.005827360758839869 0.027378270584179781 +< 0 1 -1 >: -0.006728856605562517 0.031613703783445204 +< 1 -2 1 >: 0.003884907172559911 -0.018252180389453181 +< 1 -1 0 >: 0.010988176823989483 -0.051624962099289871 +< 1 0 -1 >: 0.009516040270850300 -0.044708528647393837 +< 2 -2 0 >: -0.008686916524120469 0.040813116088405904 +< 2 -1 -1 >: -0.012285155163614113 0.057718462294931189 +< 3 -2 -1 >: 0.015046180780886280 -0.070690390680325774 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.059231345990026794 0.114295582697711742 +< 0 1 -1 >: 0.078975127986702420 0.152394110263615712 +< 0 2 -2 >: 0.019743781996675602 0.038098527565903921 +< 1 -2 1 >: -0.044148438677503170 -0.085190897480010755 +< 1 -1 0 >: -0.108141147700436147 -0.208674229555779661 +< 1 0 -1 >: -0.108141147700436160 -0.208674229555779689 +< 1 1 -2 >: -0.044148438677503170 -0.085190897480010755 +< 2 -2 0 >: 0.076467338864274398 0.147554962777770027 +< 2 -1 -1 >: 0.124870641470643792 0.240956245213934328 +< 2 0 -2 >: 0.076467338864274426 0.147554962777770082 +< 3 -2 -1 >: -0.116805789512458735 -0.225393928698507690 +< 3 -1 -2 >: -0.116805789512458721 -0.225393928698507662 +< 4 -2 -2 >: 0.165188331692216139 0.318755150841983859 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.014123746813070662 -0.207334968187052132 +< 0 1 -1 >: 0.017297986474141595 -0.253932438947230388 +< 1 -2 1 >: -0.012231523536738698 0.179557349542825567 +< 1 -1 0 >: -0.027350518096536380 0.401502439437448844 +< 1 0 -1 >: -0.022331604512423844 0.327825369034818237 +< 2 -3 1 >: 0.007061873406535332 -0.103667484093526094 +< 2 -2 0 >: 0.024463047073477406 -0.359114699085651301 +< 2 -1 -1 >: 0.027350518096536384 -0.401502439437448899 +< 3 -3 0 >: -0.018683960823913017 0.274278381955214201 +< 3 -2 -1 >: -0.032361569433643822 0.475064092964213869 +< 4 -3 -1 >: 0.037367921647826048 -0.548556763910428513 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.005586530235519948 -0.031100937682684408 +< 0 1 -1 >: 0.001862176745173317 0.010366979227561477 +< 0 2 -2 >: 0.013035237216213212 0.072568854592930276 +< 0 3 -3 >: 0.005586530235519948 0.031100937682684408 +< 1 -3 2 >: -0.010199562093929745 -0.056782283761228985 +< 1 -2 1 >: -0.010534062434239565 -0.058644490497830340 +< 1 -1 0 >: 0.007212179521750988 0.040151137898823810 +< 1 0 -1 >: 0.007212179521750985 0.040151137898823797 +< 1 1 -2 >: -0.010534062434239563 -0.058644490497830326 +< 1 2 -3 >: -0.010199562093929746 -0.056782283761228992 +< 2 -3 1 >: 0.013684148509654210 0.076181427844674299 +< 2 -2 0 >: 0.003225384735313424 0.017956134743147611 +< 2 -1 -1 >: -0.011777439841093286 -0.065566533629494550 +< 2 0 -2 >: 0.003225384735313425 0.017956134743147615 +< 2 1 -3 >: 0.013684148509654206 0.076181427844674285 +< 3 -3 0 >: -0.014780569694928880 -0.082285346649300400 +< 3 -2 -1 >: 0.006967627374056395 0.038789684405337387 +< 3 -1 -2 >: 0.006967627374056394 0.038789684405337380 +< 3 0 -3 >: -0.014780569694928882 -0.082285346649300414 +< 4 -3 -1 >: 0.012068284620073394 0.067185704199606497 +< 4 -2 -2 >: -0.015580088450278449 -0.086736371156097877 +< 4 -1 -3 >: 0.012068284620073394 0.067185704199606497 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 2 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.022868430750014889 -0.026881012703276877 +< 0 1 -1 >: 0.022868430750014886 -0.026881012703276874 +< 1 -1 0 >: -0.039609283948396239 0.046559279760979969 +< 1 0 -1 >: -0.039609283948396239 0.046559279760979969 +< 2 -1 -1 >: 0.056015986555708885 -0.065844764892301025 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.005105938206464469 -0.061307427965305666 +< 0 1 -1 >: -0.005895829595935710 -0.070791720078185599 +< 1 -2 1 >: 0.003403958804309645 0.040871618643537097 +< 1 -1 0 >: 0.009627849413628011 0.115602394803662453 +< 1 0 -1 >: 0.008337962176012965 0.100114610638289830 +< 2 -2 0 >: -0.007611483279045272 -0.091391717637396716 +< 2 -1 -1 >: -0.010764262883001859 -0.129247406571378814 +< 3 -2 -1 >: 0.013183475760267366 0.158295098338959772 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 2 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.029728205437398288 -0.088854042070227318 +< 0 1 -1 >: -0.039637607249864398 -0.118472056093636466 +< 0 2 -2 >: -0.009909401812466098 -0.029618014023409113 +< 1 -2 1 >: 0.022158096069033819 0.066227892714884815 +< 1 -1 0 >: 0.054276029040702597 0.162224543891255152 +< 1 0 -1 >: 0.054276029040702604 0.162224543891255152 +< 1 1 -2 >: 0.022158096069033819 0.066227892714884815 +< 2 -2 0 >: -0.038378948190558780 -0.114710075060401179 +< 2 -1 -1 >: -0.062672559954387183 -0.187320768169560864 +< 2 0 -2 >: -0.038378948190558794 -0.114710075060401220 +< 3 -2 -1 >: 0.058624811725341404 0.175222533979451645 +< 3 -1 -2 >: 0.058624811725341397 0.175222533979451617 +< 4 -2 -2 >: -0.082908003833547031 -0.247802083987120919 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.006754557238419695 0.062138276414587426 +< 0 1 -1 >: -0.008272609336275457 0.076103535355878896 +< 1 -2 1 >: 0.005849618159787520 -0.053813325922412142 +< 1 -1 0 >: 0.013080143847702123 -0.120330254857865138 +< 1 0 -1 >: 0.010679892729691609 -0.098249241673608739 +< 2 -3 1 >: -0.003377278619209848 0.031069138207293720 +< 2 -2 0 >: -0.011699236319575044 0.107626651844824325 +< 2 -1 -1 >: -0.013080143847702124 0.120330254857865152 +< 3 -3 0 >: 0.008935439334604865 -0.082201213145594310 +< 3 -2 -1 >: 0.015476634915485073 -0.142376677611968067 +< 4 -3 -1 >: -0.017870878669209736 0.164402426291188675 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 2 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.000684508559562604 0.017230875513980341 +< 0 1 -1 >: -0.000228169519854201 -0.005743625171326785 +< 0 2 -2 >: -0.001597186638979408 -0.040205376199287463 +< 0 3 -3 >: -0.000684508559562604 -0.017230875513980341 +< 1 -3 2 >: 0.001249735929592688 0.031459130681901516 +< 1 -2 1 >: 0.001290721717991874 0.032490850457911301 +< 1 -1 0 >: -0.000883696750507464 -0.022244964635406348 +< 1 0 -1 >: -0.000883696750507464 -0.022244964635406338 +< 1 1 -2 >: 0.001290721717991874 0.032490850457911294 +< 1 2 -3 >: 0.001249735929592688 0.031459130681901523 +< 2 -3 1 >: -0.001676696695495886 -0.042206852830668676 +< 2 -2 0 >: -0.000395201201126072 -0.009948250616369477 +< 2 -1 -1 >: 0.001443070750732572 0.036325875135334917 +< 2 0 -2 >: -0.000395201201126072 -0.009948250616369479 +< 2 1 -3 >: -0.001676696695495886 -0.042206852830668669 +< 3 -3 0 >: 0.001811039418897693 0.045588611481904240 +< 3 -2 -1 >: -0.000853732169399136 -0.021490677549155596 +< 3 -1 -2 >: -0.000853732169399135 -0.021490677549155592 +< 3 0 -3 >: 0.001811039418897693 0.045588611481904247 +< 4 -3 -1 >: -0.001478707493455302 -0.037222945404217285 +< 4 -2 -2 >: 0.001909003165354832 0.048054615882440477 +< 4 -1 -3 >: -0.001478707493455302 -0.037222945404217285 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 3 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.017694899263075575 0.068953597370605371 +< 0 1 -1 >: 0.017694899263075575 0.068953597370605357 +< 1 -1 0 >: -0.030648464558459987 -0.119431134010536261 +< 1 0 -1 >: -0.030648464558459987 -0.119431134010536261 +< 2 -1 -1 >: 0.043343474244485238 0.168901129487298962 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.020118940903727806 0.129429915640769139 +< 0 1 -1 >: 0.023231351893154832 0.149452793272777162 +< 1 -2 1 >: -0.013412627269151867 -0.086286610427179403 +< 1 -1 0 >: -0.037936638782179573 -0.244055389434641723 +< 1 0 -1 >: -0.032854092919561442 -0.211358167180903944 +< 2 -2 0 >: 0.029991546330690948 0.192942726463215336 +< 2 -1 -1 >: 0.042414451577404172 0.272862220525521393 +< 3 -2 -1 >: -0.051946882042312646 -0.334186605185153085 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 3 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.004133633258302778 0.035219393568613942 +< 0 1 -1 >: 0.005511511011070372 0.046959191424818608 +< 0 2 -2 >: 0.001377877752767593 0.011739797856204650 +< 1 -2 1 >: -0.003081028319872986 -0.026250986048579898 +< 1 -1 0 >: -0.007546947266753369 -0.064301521063940770 +< 1 0 -1 >: -0.007546947266753369 -0.064301521063940784 +< 1 1 -2 >: -0.003081028319872986 -0.026250986048579898 +< 2 -2 0 >: 0.005336497589578586 0.045468041584922132 +< 2 -1 -1 >: 0.008714464072039936 0.074249000991137210 +< 2 0 -2 >: 0.005336497589578587 0.045468041584922146 +< 3 -2 -1 >: -0.008151634716731091 -0.069453580754768568 +< 3 -1 -2 >: -0.008151634716731089 -0.069453580754768568 +< 4 -2 -2 >: 0.011528152371912468 0.098222195858768666 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.007727186668594346 0.126957116773081052 +< 0 1 -1 >: -0.009463832242646384 0.155490077654494102 +< 1 -2 1 >: 0.006691939954787150 -0.109948088316715653 +< 1 -1 0 >: 0.014963632640250938 -0.245851399472326648 +< 1 0 -1 >: 0.012217754889023408 -0.200736827085451180 +< 2 -3 1 >: -0.003863593334297174 0.063478558386540540 +< 2 -2 0 >: -0.013383879909574304 0.219896176633431389 +< 2 -1 -1 >: -0.014963632640250940 0.245851399472326676 +< 3 -3 0 >: 0.010222107129637158 -0.167948479075679752 +< 3 -2 -1 >: 0.017705208908943625 -0.290895298812995917 +< 4 -3 -1 >: -0.020444214259274323 0.335896958151359615 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 3 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.000778843439898713 -0.004525756822878790 +< 0 1 -1 >: 0.000259614479966238 0.001508585607626265 +< 0 2 -2 >: 0.001817301359763664 0.010560099253383843 +< 0 3 -3 >: 0.000778843439898713 0.004525756822878790 +< 1 -3 2 >: -0.001421967069324814 -0.008262863672245420 +< 1 -2 1 >: -0.001468601274226767 -0.008533848905223674 +< 1 -1 0 >: 0.001005482557343538 0.005842726934664717 +< 1 0 -1 >: 0.001005482557343538 0.005842726934664714 +< 1 1 -2 >: -0.001468601274226766 -0.008533848905223672 +< 1 2 -3 >: -0.001421967069324815 -0.008262863672245421 +< 2 -3 1 >: 0.001907769017265865 0.011085794915972584 +< 2 -2 0 >: 0.000449665469682096 0.002612946919975854 +< 2 -1 -1 >: -0.001641946140506930 -0.009541133130896147 +< 2 0 -2 >: 0.000449665469682096 0.002612946919975854 +< 2 1 -3 >: 0.001907769017265865 0.011085794915972582 +< 3 -3 0 >: -0.002060626052226077 -0.011974027047691077 +< 3 -2 -1 >: 0.000971388436679149 0.005644610482355665 +< 3 -1 -2 >: 0.000971388436679149 0.005644610482355664 +< 3 0 -3 >: -0.002060626052226077 -0.011974027047691078 +< 4 -3 -1 >: 0.001682494126213189 0.009776752144375877 +< 4 -2 -2 >: -0.002172090576971827 -0.012621732745055137 +< 4 -1 -3 >: 0.001682494126213189 0.009776752144375877 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 2 1 1 ) +num_ms=4 +< 0 -1 1 >: -0.022116145723924285 -0.041260785944438057 +< 0 0 0 >: -0.022116145723924289 -0.041260785944438064 +< 1 -1 0 >: 0.076612576122868078 0.142931555231981061 +< 2 -1 -1 >: -0.054173272100650587 -0.101067871950073357 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 2 2 2 ) +num_ms=8 +< -2 0 2 >: 0.034677318353898291 -0.129990094600396566 +< -2 1 1 >: -0.021235433903775171 0.079602350846771558 +< -1 -1 2 >: -0.021235433903775171 0.079602350846771558 +< -1 0 1 >: 0.017338659176949135 -0.064995047300198242 +< 0 -2 2 >: 0.017338659176949135 -0.064995047300198242 +< 0 -1 1 >: 0.008669329588474568 -0.032497523650099121 +< 0 0 0 >: -0.008669329588474568 0.032497523650099121 +< 1 -2 1 >: -0.021235433903775171 0.079602350846771558 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: -0.011358322653565719 0.056076513923086671 +< -2 0 2 >: 0.032126187884964415 -0.158608333041265787 +< -2 1 1 >: -0.017596237791244192 0.086873361814993236 +< -1 -2 3 >: 0.017959084992177646 -0.088664753619549022 +< -1 -1 2 >: -0.013911047417565521 0.068679422832819456 +< -1 0 1 >: 0.010159192625499499 -0.050156358829294097 +< 0 -3 3 >: -0.017959084992177646 0.088664753619549008 +< 0 -1 1 >: 0.010775450995306584 -0.053198852171729392 +< 0 0 0 >: -0.007183633996871059 0.035465901447819609 +< 1 -3 2 >: 0.017959084992177646 -0.088664753619549022 +< 1 -2 1 >: -0.013911047417565521 0.068679422832819456 +< 2 -3 1 >: -0.011358322653565719 0.056076513923086671 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: 0.000403562276564152 -0.000162601660772411 +< -2 -1 3 >: -0.000605343414846227 0.000243902491158616 +< -2 0 2 >: 0.001447047535792778 -0.000583038470641414 +< -2 1 1 >: -0.000762661015939868 0.000307288255121347 +< -1 -3 4 >: -0.000754995886564783 0.000304199852565401 +< -1 -2 3 >: 0.000713404055973981 -0.000287441842410916 +< -1 -1 2 >: -0.000485354498505932 0.000195557048077758 +< -1 0 1 >: 0.000341072375086119 -0.000137423485427726 +< 0 -4 4 >: 0.000871794156690475 -0.000351259733532157 +< 0 -3 3 >: -0.000217948539172619 0.000087814933383039 +< 0 -2 2 >: -0.000249084044768707 0.000100359923866331 +< 0 -1 1 >: 0.000529303595133503 -0.000213264838215952 +< 0 0 0 >: -0.000311355055960884 0.000125449904832913 +< 1 -4 3 >: -0.000754995886564783 0.000304199852565401 +< 1 -3 2 >: 0.000713404055973981 -0.000287441842410916 +< 1 -2 1 >: -0.000485354498505932 0.000195557048077758 +< 2 -4 2 >: 0.000403562276564152 -0.000162601660772411 +< 2 -3 1 >: -0.000605343414846227 0.000243902491158616 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.016484663824014738 -0.098119484383888775 +< 0 1 -1 >: -0.019034850192590783 -0.113298621443570890 +< 1 -2 1 >: 0.010989775882676488 0.065412989589259160 +< 1 -1 0 >: 0.031083780201443693 0.185015874065000807 +< 1 0 -1 >: 0.026919343300102004 0.160228447043673117 +< 2 -2 0 >: -0.024573885931152388 -0.146267891333069555 +< 2 -1 -1 >: -0.034752722764045098 -0.206854035662941055 +< 3 -2 -1 >: 0.042563218972157958 0.253343419304839890 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: 0.015926487128803200 0.023379910035030406 +< -3 1 2 >: -0.015926487128803204 -0.023379910035030409 +< -3 2 1 >: 0.010072794890474721 0.014786753440104636 +< -2 -1 3 >: -0.015926487128803204 -0.023379910035030409 +< -2 1 1 >: 0.012336603882688320 0.018110000440300093 +< -1 -2 3 >: 0.010072794890474721 0.014786753440104636 +< -1 -1 2 >: 0.012336603882688320 0.018110000440300093 +< -1 0 1 >: -0.009555892277281918 -0.014027946021018240 +< 0 -2 2 >: -0.014245083145111772 -0.020911627258463003 +< 0 -1 1 >: -0.004504690819702806 -0.006612837171720568 +< 0 0 0 >: 0.006370594851521281 0.009351964014012164 +< 1 -2 1 >: 0.015604706744228708 0.022907539927200203 +< 1 -1 0 >: -0.004504690819702806 -0.006612837171720568 +< 2 -2 0 >: -0.014245083145111772 -0.020911627258463003 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 4 2 2 ) +num_ms=9 +< 0 -2 2 >: -0.004628573120642897 -0.017765183713257846 +< 0 -1 1 >: -0.018514292482571592 -0.071060734853031396 +< 0 0 0 >: -0.013885719361928690 -0.053295551139773530 +< 1 -2 1 >: 0.020699608273171705 0.079448316831233351 +< 1 -1 0 >: 0.050703478144763912 0.194607837159494229 +< 2 -2 0 >: -0.035852773225906465 -0.137608521327525740 +< 2 -1 -1 >: -0.029273666755729753 -0.112356887170444855 +< 3 -2 -1 >: 0.054766015727267504 0.210200488418110676 +< 4 -2 -2 >: -0.038725421099319958 -0.148634190769170366 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.007784200142983607 -0.110856207564197728 +< 0 1 -1 >: 0.009533659203004847 -0.135770571676172652 +< 1 -2 1 >: -0.006741315071966263 0.096004291917795873 +< 1 -1 0 >: -0.015074038758660454 0.214672122859925263 +< 1 0 -1 >: -0.012307901107218279 0.175279054335625656 +< 2 -3 1 >: 0.003892100071491804 -0.055428103782098871 +< 2 -2 0 >: 0.013482630143932531 -0.192008583835591828 +< 2 -1 -1 >: 0.015074038758660455 -0.214672122859925291 +< 3 -3 0 >: -0.010297528866944025 0.146648978251312262 +< 3 -2 -1 >: -0.017835843189954230 0.254003481209336190 +< 4 -3 -1 >: 0.020595057733888058 -0.293297956502624579 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 4 3 3 ) +num_ms=14 +< 0 -3 3 >: 0.001304955982363996 0.012281745338285435 +< 0 -2 2 >: 0.003044897292182658 0.028657405789332679 +< 0 -1 1 >: 0.000434985327454666 0.004093915112761815 +< 0 0 0 >: -0.001304955982363996 -0.012281745338285435 +< 1 -3 2 >: -0.004765025520613829 -0.044846593115418991 +< 1 -2 1 >: -0.004921297196157517 -0.046317362205375461 +< 1 -1 0 >: 0.003369381858152998 0.031711330105026712 +< 2 -3 1 >: 0.006392952587168311 0.060168018459210583 +< 2 -2 0 >: 0.001506833375396931 0.014181737954355050 +< 2 -1 -1 >: -0.002751088767021832 -0.025892192607424779 +< 3 -3 0 >: -0.006905178002442247 -0.064988887661860228 +< 3 -2 -1 >: 0.003255132127218061 0.030636055444981412 +< 4 -3 -1 >: 0.005638054229691440 0.053063204574204957 +< 4 -2 -2 >: -0.003639348356101538 -0.034252151268715496 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 2 4 4 ) +l=( 4 4 4 ) +num_ms=25 +< -4 0 4 >: -0.001190327260320904 0.013418324705094308 +< -4 1 3 >: 0.001882072651801112 -0.021216234225902596 +< -4 2 2 >: -0.001067034897004629 0.012028474182650404 +< -3 -1 4 >: 0.000941036325900556 -0.010608117112951296 +< -3 0 3 >: -0.001785490890481355 0.020127487057641457 +< -3 1 2 >: 0.000711356598003086 -0.008018982788433602 +< -2 -2 4 >: -0.001067034897004629 0.012028474182650403 +< -2 -1 3 >: 0.000355678299001543 -0.004009491394216801 +< -2 0 2 >: 0.000935257133109281 -0.010542969411145523 +< -2 1 1 >: -0.000806602565057619 0.009092671811101108 +< -1 -3 4 >: 0.000941036325900555 -0.010608117112951291 +< -1 -2 3 >: 0.000355678299001543 -0.004009491394216799 +< -1 -1 2 >: -0.000806602565057619 0.009092671811101112 +< -1 0 1 >: 0.000765210381634867 -0.008626065881846339 +< 0 -4 4 >: -0.000595163630160452 0.006709162352547153 +< 0 -3 3 >: -0.000892745445240678 0.010063743528820732 +< 0 -2 2 >: 0.000467628566554641 -0.005271484705572766 +< 0 -1 1 >: 0.000382605190817433 -0.004313032940923171 +< 0 0 0 >: -0.000382605190817433 0.004313032940923172 +< 1 -4 3 >: 0.000941036325900555 -0.010608117112951291 +< 1 -3 2 >: 0.000355678299001543 -0.004009491394216799 +< 1 -2 1 >: -0.000806602565057619 0.009092671811101112 +< 2 -4 2 >: -0.001067034897004629 0.012028474182650403 +< 2 -3 1 >: 0.000355678299001543 -0.004009491394216801 +< 3 -4 1 >: 0.000941036325900556 -0.010608117112951296 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 1 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.360154989178294860 0.274262363425851641 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 1 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: -0.236503037611134448 -0.017793557778389042 +< 1 -1 >: 0.473006075222268785 0.035587115556778084 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 1 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: 0.109362673367572216 -0.176245148364653936 +< 1 -1 >: -0.218725346735144460 0.352490296729307928 +< 2 -2 >: 0.218725346735144516 -0.352490296729307984 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 1 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: 0.085923349847730035 -0.451038172672023951 +< 1 -1 >: -0.171846699695460070 0.902076345344047903 +< 2 -2 >: 0.171846699695460070 -0.902076345344047792 +< 3 -3 >: -0.171846699695460070 0.902076345344047792 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 1 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: 0.013560976305340870 0.027254481451177152 +< 1 -1 >: -0.027121952610681732 -0.054508962902354283 +< 2 -2 >: 0.027121952610681732 0.054508962902354283 +< 3 -3 >: -0.027121952610681732 -0.054508962902354283 +< 4 -4 >: 0.027121952610681736 0.054508962902354297 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 1 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.000394826851028686 -0.011479639494511551 +< 1 -1 >: -0.000789653702057372 0.022959278989023103 +< 2 -2 >: 0.000789653702057372 -0.022959278989023106 +< 3 -3 >: -0.000789653702057372 0.022959278989023113 +< 4 -4 >: 0.000789653702057372 -0.022959278989023106 +< 5 -5 >: -0.000789653702057371 0.022959278989023082 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 1 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: -0.036031930408102500 0.073811722430843191 +< 1 -1 >: 0.072063860816205014 -0.147623444861686409 +< 2 -2 >: -0.072063860816204986 0.147623444861686354 +< 3 -3 >: 0.072063860816205014 -0.147623444861686409 +< 4 -4 >: -0.072063860816204972 0.147623444861686326 +< 5 -5 >: 0.072063860816204986 -0.147623444861686354 +< 6 -6 >: -0.072063860816204944 0.147623444861686270 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.024919033854915000 0.118397927355655158 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.049498795663409048 0.250305546865169426 +< 1 -1 0 >: 0.098997591326818082 -0.500611093730338741 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.035633126325943947 -0.078566305460119765 +< 1 -1 0 >: 0.071266252651887893 0.157132610920239529 +< 2 -2 0 >: -0.071266252651887921 -0.157132610920239585 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.027429849235777872 -0.087513004003342554 +< 0 1 -1 >: -0.031673261680214400 -0.101051312837845200 +< 1 -2 1 >: 0.018286566157185241 0.058342002668895013 +< 1 -1 0 >: 0.051722219737448456 0.165016102860717329 +< 1 0 -1 >: 0.044792756232751245 0.142908137110887123 +< 2 -2 0 >: -0.040890005002513316 -0.130456683911123444 +< 2 -1 -1 >: -0.057827199640058030 -0.184493611689330705 +< 3 -2 -1 >: 0.070823566186098613 0.225957604721019084 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.012196224155131703 0.020287513804108058 +< 1 -1 0 >: 0.024392448310263406 -0.040575027608216116 +< 2 -2 0 >: -0.024392448310263402 0.040575027608216109 +< 3 -3 0 >: 0.024392448310263402 -0.040575027608216109 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.012421907309781263 -0.120080484980472135 +< 0 1 -1 >: -0.015213667270556293 -0.147067958134047994 +< 1 -2 1 >: 0.010757687293726188 0.103992750491844602 +< 1 -1 0 >: 0.024054920069457506 0.232534859266939259 +< 1 0 -1 >: 0.019640759991201785 0.189863917537965776 +< 2 -3 1 >: -0.006210953654890632 -0.060040242490236082 +< 2 -2 0 >: -0.021515374587452382 -0.207985500983689287 +< 2 -1 -1 >: -0.024054920069457510 -0.232534859266939287 +< 3 -3 0 >: 0.016432638775388298 0.158851550285178000 +< 3 -2 -1 >: 0.028462165261398956 0.275138955955010811 +< 4 -3 -1 >: -0.032865277550776603 -0.317703100570356112 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.003608364130291558 0.027578091051118719 +< 1 -1 0 >: -0.007216728260583114 -0.055156182102237418 +< 2 -2 0 >: 0.007216728260583114 0.055156182102237418 +< 3 -3 0 >: -0.007216728260583114 -0.055156182102237418 +< 4 -4 0 >: 0.007216728260583114 0.055156182102237425 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 1 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.000869775901563319 -0.014410984674016806 +< 0 1 -1 >: 0.000476395881260622 0.007893221381820237 +< 0 2 -2 >: 0.002021176549012365 0.033488102186950454 +< 1 -3 2 >: -0.001691037625126737 -0.028018156464309805 +< 1 -2 1 >: -0.001355846447436025 -0.022464501878244173 +< 1 -1 0 >: 0.001478619032657641 0.024498673945828567 +< 1 0 -1 >: 0.000476395881260622 0.007893221381820237 +< 1 1 -2 >: -0.002130507149399340 -0.035299559142409752 +< 2 -4 2 >: 0.001127358416751158 0.018678770976206537 +< 2 -3 1 >: 0.001992906953281184 0.033019714053765262 +< 2 -2 0 >: -0.000695820721250655 -0.011528787739213448 +< 2 -1 -1 >: -0.001355846447436025 -0.022464501878244173 +< 2 0 -2 >: 0.002021176549012365 0.033488102186950454 +< 3 -4 1 >: -0.002109094473789373 -0.034944780699490946 +< 3 -3 0 >: -0.000608843131094323 -0.010087689271811759 +< 3 -2 -1 >: 0.001992906953281184 0.033019714053765262 +< 3 -1 -2 >: -0.001691037625126737 -0.028018156464309805 +< 4 -4 0 >: 0.002435372524377292 0.040350757087247051 +< 4 -3 -1 >: -0.002109094473789373 -0.034944780699490946 +< 4 -2 -2 >: 0.001127358416751158 0.018678770976206537 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.012133802258501273 -0.139076548810896566 +< 1 -1 0 >: -0.024267604517002543 0.278153097621793133 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.013791095149015265 -0.138174582053536055 +< 1 -1 0 >: -0.027582190298030534 0.276349164107072109 +< 2 -2 0 >: 0.027582190298030541 -0.276349164107072220 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.016459879601045745 0.003208294727954801 +< 0 1 -1 >: 0.019006231836985171 0.003704619649648721 +< 1 -2 1 >: -0.010973253067363825 -0.002138863151969866 +< 1 -1 0 >: -0.031037046622436185 -0.006049618555151704 +< 1 0 -1 >: -0.026878870833471735 -0.005239123351967085 +< 2 -2 0 >: 0.024536939792933598 0.004782643402374085 +< 2 -1 -1 >: 0.034700473034298775 0.006763679163631634 +< 3 -2 -1 >: -0.042499226383619554 -0.008283781367395996 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.026926954637611796 -0.042991289269624235 +< 1 -1 0 >: -0.053853909275223592 0.085982578539248469 +< 2 -2 0 >: 0.053853909275223585 -0.085982578539248455 +< 3 -3 0 >: -0.053853909275223585 0.085982578539248455 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.001214021670103439 0.014748397803456945 +< 0 1 -1 >: 0.001486866814217439 0.018063024571026872 +< 1 -2 1 >: -0.001051373607054390 -0.012772487162912328 +< 1 -1 0 >: -0.002350942855122768 -0.028560149538015403 +< 1 0 -1 >: -0.001919536803164206 -0.023319264448574142 +< 2 -3 1 >: 0.000607010835051720 0.007374198901728474 +< 2 -2 0 >: 0.002102747214108780 0.025544974325824667 +< 2 -1 -1 >: 0.002350942855122768 0.028560149538015406 +< 3 -3 0 >: -0.001605999712668499 -0.019510296412299170 +< 3 -2 -1 >: -0.002781673099282860 -0.033792824656830957 +< 4 -3 -1 >: 0.003211999425336999 0.039020592824598355 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.011908961484496062 -0.094323560600201542 +< 1 -1 0 >: 0.023817922968992117 0.188647121200403001 +< 2 -2 0 >: -0.023817922968992117 -0.188647121200403001 +< 3 -3 0 >: 0.023817922968992117 0.188647121200403001 +< 4 -4 0 >: -0.023817922968992121 -0.188647121200403056 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 2 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.004558055184434740 0.020126689870304117 +< 0 1 -1 >: -0.002496549642868278 -0.011023842049876291 +< 0 2 -2 >: -0.010591963092246076 -0.046770200809181622 +< 1 -3 2 >: 0.008861872121806554 0.039130757450013952 +< 1 -2 1 >: 0.007105304846829330 0.031374404499193737 +< 1 -1 0 >: -0.007748693813539057 -0.034215372779516993 +< 1 0 -1 >: -0.002496549642868278 -0.011023842049876291 +< 1 1 -2 >: 0.011164909421312584 0.049300120393488037 +< 2 -4 2 >: -0.005907914747871035 -0.026087171633342631 +< 2 -3 1 >: -0.010443816452229051 -0.046116039909784780 +< 2 -2 0 >: 0.003646444147547793 0.016101351896243298 +< 2 -1 -1 >: 0.007105304846829330 0.031374404499193737 +< 2 0 -2 >: -0.010591963092246076 -0.046770200809181622 +< 3 -4 1 >: 0.011052696428401183 0.048804629220968045 +< 3 -3 0 >: 0.003190638629104317 0.014088682909212877 +< 3 -2 -1 >: -0.010443816452229051 -0.046116039909784780 +< 3 -1 -2 >: 0.008861872121806554 0.039130757450013952 +< 4 -4 0 >: -0.012762554516417272 -0.056354731636851521 +< 4 -3 -1 >: 0.011052696428401183 0.048804629220968045 +< 4 -2 -2 >: -0.005907914747871035 -0.026087171633342631 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.065034147298372993 -0.047196259697234337 +< 1 -1 0 >: 0.130068294596745959 0.094392519394468660 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.016796106620001042 -0.129855617544632068 +< 1 -1 0 >: -0.033592213240002090 0.259711235089264136 +< 2 -2 0 >: 0.033592213240002097 -0.259711235089264247 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.026919185071921752 -0.080257020639781712 +< 0 1 -1 >: 0.031083597495278743 -0.092672824941470597 +< 1 -2 1 >: -0.017946123381281161 0.053504680426521116 +< 1 -1 0 >: -0.050759302155657465 0.151334089419248946 +< 1 0 -1 >: -0.043958845145169567 0.131059165895655361 +< 2 -2 0 >: 0.040128751813143064 -0.119640102548103686 +< 2 -1 -1 >: 0.056750625055250838 -0.169196655627236126 +< 3 -2 -1 >: -0.069505036984685478 0.207222736236066268 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.029204147694068341 -0.014311818505648768 +< 1 -1 0 >: 0.058408295388136681 0.028623637011297536 +< 2 -2 0 >: -0.058408295388136675 -0.028623637011297533 +< 3 -3 0 >: 0.058408295388136675 0.028623637011297533 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.010812031281630137 0.052343958951060074 +< 0 1 -1 >: 0.013241979861501942 0.064107995273642693 +< 1 -2 1 >: -0.009363493756403721 -0.045331198186267886 +< 1 -1 0 >: -0.020937408546213582 -0.101363640646010181 +< 1 0 -1 >: -0.017095322491470333 -0.082763066017853965 +< 2 -3 1 >: 0.005406015640815070 0.026171979475530044 +< 2 -2 0 >: 0.018726987512807450 0.090662396372535800 +< 2 -1 -1 >: 0.020937408546213586 0.101363640646010195 +< 3 -3 0 >: -0.014302972969322151 -0.069244549010539155 +< 3 -2 -1 >: -0.024773475882150262 -0.119935077033447079 +< 4 -3 -1 >: 0.028605945938644312 0.138489098021078338 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.016069363750387557 0.061402412860779139 +< 1 -1 0 >: -0.032138727500775101 -0.122804825721558236 +< 2 -2 0 >: 0.032138727500775101 0.122804825721558236 +< 3 -3 0 >: -0.032138727500775101 -0.122804825721558236 +< 4 -4 0 >: 0.032138727500775108 0.122804825721558264 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 3 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.004835693703825201 -0.018718794987673260 +< 0 1 -1 >: 0.002648618522770768 0.010252706264063282 +< 0 2 -2 >: 0.011237136709365039 0.043498548748997647 +< 1 -3 2 >: -0.009401663097424391 -0.036393496950530159 +< 1 -2 1 >: -0.007538100466379558 -0.029179713577604155 +< 1 -1 0 >: 0.008220679296502839 0.031821951479044534 +< 1 0 -1 >: 0.002648618522770768 0.010252706264063282 +< 1 1 -2 >: -0.011844982126761027 -0.045851496319566823 +< 2 -4 2 >: 0.006267775398282927 0.024262331300353438 +< 2 -3 1 >: 0.011079966217700176 0.042890147474686342 +< 2 -2 0 >: -0.003868554963060161 -0.014975035990138611 +< 2 -1 -1 >: -0.007538100466379558 -0.029179713577604155 +< 2 0 -2 >: 0.011237136709365039 0.043498548748997647 +< 3 -4 1 >: -0.011725934058812648 -0.045390665565162025 +< 3 -3 0 >: -0.003384985592677639 -0.013103156491371276 +< 3 -2 -1 >: 0.011079966217700176 0.042890147474686342 +< 3 -1 -2 >: -0.009401663097424391 -0.036393496950530159 +< 4 -4 0 >: 0.013539942370710560 0.052412625965485120 +< 4 -3 -1 >: -0.011725934058812648 -0.045390665565162025 +< 4 -2 -2 >: 0.006267775398282927 0.024262331300353438 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.099299222180234459 -0.028070314492789197 +< 1 -1 0 >: -0.198598444360468890 0.056140628985578388 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.004454427650309395 0.259452239157920983 +< 1 -1 0 >: 0.008908855300618792 -0.518904478315841966 +< 2 -2 0 >: -0.008908855300618794 0.518904478315842188 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.030742865736554072 0.030112738251934824 +< 0 1 -1 >: -0.035498803617320017 0.034771195071582606 +< 1 -2 1 >: 0.020495243824369375 -0.020075158834623210 +< 1 -1 0 >: 0.057969303561133195 -0.056781123781436418 +< 1 0 -1 >: 0.050202889523633054 -0.049173895650152642 +< 2 -2 0 >: -0.045828758406722694 0.044889419813322964 +< 2 -1 -1 >: -0.064811651685507218 0.063483226307060853 +< 3 -2 -1 >: 0.079377738008243007 -0.077750755838964389 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.011228970968402285 0.029184583395980727 +< 1 -1 0 >: -0.022457941936804570 -0.058369166791961455 +< 2 -2 0 >: 0.022457941936804567 0.058369166791961448 +< 3 -3 0 >: -0.022457941936804567 -0.058369166791961448 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.008548132744733879 -0.028232475920630648 +< 0 1 -1 >: -0.010469281739087326 -0.034577580090478920 +< 1 -2 1 >: 0.007402900111861140 0.024450041358998600 +< 1 -1 0 >: 0.016553387880762306 0.054671954531402216 +< 1 0 -1 >: 0.013515784607412875 0.044639463947525992 +< 2 -3 1 >: -0.004274066372366940 -0.014116237960315327 +< 2 -2 0 >: -0.014805800223722285 -0.048900082717997222 +< 2 -1 -1 >: -0.016553387880762310 -0.054671954531402223 +< 3 -3 0 >: 0.011308116708266909 0.037348055090804015 +< 3 -2 -1 >: 0.019586232676636818 0.064688728981154034 +< 4 -3 -1 >: -0.022616233416533824 -0.074696110181608044 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.007289306139640483 -0.007904629611406767 +< 1 -1 0 >: 0.014578612279280961 0.015809259222813527 +< 2 -2 0 >: -0.014578612279280961 -0.015809259222813527 +< 3 -3 0 >: 0.014578612279280961 0.015809259222813527 +< 4 -4 0 >: -0.014578612279280964 -0.015809259222813531 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 1 4 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.000463362253131482 0.003461824263848675 +< 0 1 -1 >: -0.000253793958336532 -0.001896119239428635 +< 0 2 -2 >: -0.001076756573783626 -0.008044552632829601 +< 1 -3 2 >: 0.000900879183592549 0.006730555619237984 +< 1 -2 1 >: 0.000722310268259987 0.005396449960674569 +< 1 -1 0 >: -0.000787715830323520 -0.005885101248542747 +< 1 0 -1 >: -0.000253793958336532 -0.001896119239428635 +< 1 1 -2 >: 0.001135001086238469 0.008479703025615256 +< 2 -4 2 >: -0.000600586122395033 -0.004487037079491990 +< 2 -3 1 >: -0.001061696299580154 -0.007932035865860667 +< 2 -2 0 >: 0.000370689802505186 0.002769459411078941 +< 2 -1 -1 >: 0.000722310268259987 0.005396449960674569 +< 2 0 -2 >: -0.001076756573783626 -0.008044552632829601 +< 3 -4 1 >: 0.001123593750626647 0.008394477716604887 +< 3 -3 0 >: 0.000324353577192038 0.002423276984694071 +< 3 -2 -1 >: -0.001061696299580154 -0.007932035865860667 +< 3 -1 -2 >: 0.000900879183592549 0.006730555619237984 +< 4 -4 0 >: -0.001297414308768151 -0.009693107938776289 +< 4 -3 -1 >: 0.001123593750626647 0.008394477716604887 +< 4 -2 -2 >: -0.000600586122395033 -0.004487037079491990 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 2 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: -0.413647545681683826 0.238747196297639130 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 2 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.063581753118858733 0.269039596844016404 +< 1 -1 >: -0.127163506237717439 -0.538079193688032698 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 2 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: -0.058396305129791819 0.024828448464959414 +< 1 -1 >: 0.116792610259583651 -0.049656896929918835 +< 2 -2 >: -0.116792610259583679 0.049656896929918849 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 2 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: -0.048098593790511880 -0.107268311593823662 +< 1 -1 >: 0.096197187581023760 0.214536623187647324 +< 2 -2 >: -0.096197187581023746 -0.214536623187647296 +< 3 -3 >: 0.096197187581023746 0.214536623187647296 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 2 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: -0.006438111813368136 0.088509794079511608 +< 1 -1 >: 0.012876223626736268 -0.177019588159023161 +< 2 -2 >: -0.012876223626736268 0.177019588159023161 +< 3 -3 >: 0.012876223626736268 -0.177019588159023161 +< 4 -4 >: -0.012876223626736270 0.177019588159023189 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 2 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: -0.000227447483396139 0.006403781684337695 +< 1 -1 >: 0.000454894966792277 -0.012807563368675390 +< 2 -2 >: -0.000454894966792277 0.012807563368675393 +< 3 -3 >: 0.000454894966792277 -0.012807563368675395 +< 4 -4 >: -0.000454894966792277 0.012807563368675393 +< 5 -5 >: 0.000454894966792277 -0.012807563368675379 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 2 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: 0.035159880175297135 0.014639776930199728 +< 1 -1 >: -0.070319760350594285 -0.029279553860399463 +< 2 -2 >: 0.070319760350594257 0.029279553860399449 +< 3 -3 >: -0.070319760350594285 -0.029279553860399463 +< 4 -4 >: 0.070319760350594243 0.029279553860399442 +< 5 -5 >: -0.070319760350594257 -0.029279553860399449 +< 6 -6 >: 0.070319760350594215 0.029279553860399432 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.070138423728544286 -0.319737878788430130 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.000590765241106720 -0.085531965435636362 +< 1 -1 0 >: 0.001181530482213440 0.171063930871272668 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.027886407609637495 -0.112140466967647984 +< 0 1 -1 >: -0.027886407609637488 -0.112140466967647956 +< 1 -1 0 >: 0.048300674820467508 0.194232986372465694 +< 1 0 -1 >: 0.048300674820467508 0.194232986372465694 +< 2 -1 -1 >: -0.068307469402877796 -0.274686923588169540 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.006880216419361051 0.051035192411418365 +< 1 -1 0 >: -0.013760432838722103 -0.102070384822836743 +< 2 -2 0 >: 0.013760432838722107 0.102070384822836771 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 2 2 2 ) +num_ms=10 +< 0 0 0 >: 0.023760388603510450 0.028420660306426281 +< 0 1 -1 >: -0.023760388603510450 -0.028420660306426281 +< 0 2 -2 >: -0.047520777207020928 -0.056841320612852589 +< 1 -2 1 >: 0.058200828168841180 0.069616115903716205 +< 1 -1 0 >: -0.023760388603510450 -0.028420660306426281 +< 1 0 -1 >: -0.023760388603510450 -0.028420660306426281 +< 1 1 -2 >: 0.058200828168841180 0.069616115903716205 +< 2 -2 0 >: -0.047520777207020901 -0.056841320612852561 +< 2 -1 -1 >: 0.058200828168841180 0.069616115903716205 +< 2 0 -2 >: -0.047520777207020928 -0.056841320612852589 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.011684804748145752 0.160894754917286553 +< 0 1 -1 >: 0.013492450333540329 0.185785260125388429 +< 1 -2 1 >: -0.007789869832097165 -0.107263169944857670 +< 1 -1 0 >: -0.022033079131345678 -0.303386059358295823 +< 1 0 -1 >: -0.019081206251338124 -0.262740034558337721 +< 2 -2 0 >: 0.017418678480444139 0.239847739478814159 +< 2 -1 -1 >: 0.024633731345660471 0.339195926075467780 +< 3 -2 -1 >: -0.030170036128835891 -0.415428470857849730 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.002531396175927053 -0.075445379988288888 +< 1 -1 0 >: -0.005062792351854106 0.150890759976577776 +< 2 -2 0 >: 0.005062792351854106 -0.150890759976577749 +< 3 -3 0 >: -0.005062792351854106 0.150890759976577749 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.002561394970747174 0.073816746797527227 +< 0 1 -1 >: -0.003415193294329566 0.098422329063369673 +< 0 2 -2 >: -0.000853798323582391 0.024605582265842415 +< 1 -2 1 >: 0.001909151090605589 -0.055019754572386934 +< 1 -1 0 >: 0.004676446013861709 -0.134770324475509656 +< 1 0 -1 >: 0.004676446013861709 -0.134770324475509684 +< 1 1 -2 >: 0.001909151090605589 -0.055019754572386934 +< 2 -2 0 >: -0.003306746688254412 0.095297010339344193 +< 2 -1 -1 >: -0.005399894729907620 0.155619366229417438 +< 2 0 -2 >: -0.003306746688254413 0.095297010339344221 +< 3 -2 -1 >: 0.005051139000990132 -0.145568587794344811 +< 3 -1 -2 >: 0.005051139000990132 -0.145568587794344784 +< 4 -2 -2 >: -0.007143389280631929 0.205865071114260945 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.003558911181816534 -0.020595979383847621 +< 0 1 -1 >: 0.004358758217667979 -0.025224820121654272 +< 1 -2 1 >: -0.003082107493265617 0.017836641362232609 +< 1 -1 0 >: -0.006891801868903397 0.039883942576236571 +< 1 0 -1 >: -0.005627132662390934 0.032565102747414906 +< 2 -3 1 >: 0.001779455590908267 -0.010297989691923812 +< 2 -2 0 >: 0.006164214986531237 -0.035673282724465231 +< 2 -1 -1 >: 0.006891801868903398 -0.039883942576236571 +< 3 -3 0 >: -0.004707996962626763 0.027245919728737057 +< 3 -2 -1 >: -0.008154489941149508 0.047191317269115844 +< 4 -3 -1 >: 0.009415993925253528 -0.054491839457474135 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.001312545864702657 0.036535945291993888 +< 0 1 -1 >: -0.000437515288234219 -0.012178648430664638 +< 0 2 -2 >: -0.003062607017639533 -0.085250539014652391 +< 0 3 -3 >: -0.001312545864702657 -0.036535945291993888 +< 1 -3 2 >: 0.002396369926192563 0.066705204653999067 +< 1 -2 1 >: 0.002474960217465626 0.068892839128078920 +< 1 -1 0 >: -0.001694489425042269 -0.047167702551279209 +< 1 0 -1 >: -0.001694489425042268 -0.047167702551279188 +< 1 1 -2 >: 0.002474960217465626 0.068892839128078906 +< 1 2 -3 >: 0.002396369926192564 0.066705204653999081 +< 2 -3 1 >: -0.003215067632521636 -0.089494423235626383 +< 2 -2 0 >: -0.000757798708309809 -0.021094037849430102 +< 2 -1 -1 >: 0.002767089643930401 0.077024535726670895 +< 2 0 -2 >: -0.000757798708309809 -0.021094037849430106 +< 2 1 -3 >: -0.003215067632521636 -0.089494423235626369 +< 3 -3 0 >: 0.003472669942369462 0.096665025157276985 +< 3 -2 -1 >: -0.001637032310048096 -0.045568329861519180 +< 3 -1 -2 >: -0.001637032310048096 -0.045568329861519180 +< 3 0 -3 >: 0.003472669942369463 0.096665025157276999 +< 4 -3 -1 >: -0.002835423134635149 -0.078926662536209280 +< 4 -2 -2 >: 0.003660515526631053 0.101893883191490439 +< 4 -1 -3 >: -0.002835423134635149 -0.078926662536209280 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.003194710869684784 -0.037484623508700396 +< 1 -1 0 >: 0.006389421739369566 0.074969247017400764 +< 2 -2 0 >: -0.006389421739369566 -0.074969247017400764 +< 3 -3 0 >: 0.006389421739369566 0.074969247017400764 +< 4 -4 0 >: -0.006389421739369567 -0.074969247017400778 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.002242735739163265 -0.002058808906315038 +< 0 1 -1 >: 0.001228396954862743 0.001127656079581287 +< 0 2 -2 >: 0.005211646900634105 0.004784239564308989 +< 1 -3 2 >: -0.004360376634170764 -0.004002782000820134 +< 1 -2 1 >: -0.003496079023363185 -0.003209365465931663 +< 1 -1 0 >: 0.003812650756577550 0.003499975140735564 +< 1 0 -1 >: 0.001228396954862743 0.001127656079581287 +< 1 1 -2 >: -0.005493558188853668 -0.005043031298369340 +< 2 -4 2 >: 0.002906917756113842 0.002668521333880089 +< 2 -3 1 >: 0.005138753144249200 0.004717323827318954 +< 2 -2 0 >: -0.001794188591330612 -0.001647047125052031 +< 2 -1 -1 >: -0.003496079023363185 -0.003209365465931663 +< 2 0 -2 >: 0.005211646900634105 0.004784239564308989 +< 3 -4 1 >: -0.005438345147453845 -0.004992346280338144 +< 3 -3 0 >: -0.001569915017414285 -0.001441166234420526 +< 3 -2 -1 >: 0.005138753144249200 0.004717323827318954 +< 3 -1 -2 >: -0.004360376634170764 -0.004002782000820134 +< 4 -4 0 >: 0.006279660069657141 0.005764664937682106 +< 4 -3 -1 >: -0.005438345147453845 -0.004992346280338144 +< 4 -2 -2 >: 0.002906917756113842 0.002668521333880089 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 1 ) +l=( 4 4 4 ) +num_ms=31 +< 0 0 0 >: -0.006574658982315992 -0.014087994203259398 +< 0 1 -1 >: 0.006574658982315990 0.014087994203259391 +< 0 2 -2 >: 0.008035694311719539 0.017218659581761473 +< 0 3 -3 >: -0.015340870958737306 -0.032871986474271912 +< 0 4 -4 >: -0.010227247305824874 -0.021914657649514613 +< 1 -4 3 >: 0.016170697840113619 0.034650116157649069 +< 1 -3 2 >: 0.006111949287329992 0.013096512893234338 +< 1 -2 1 >: -0.013860598148668817 -0.029700099563699203 +< 1 -1 0 >: 0.006574658982315990 0.014087994203259395 +< 1 0 -1 >: 0.006574658982315990 0.014087994203259391 +< 1 1 -2 >: -0.013860598148668813 -0.029700099563699196 +< 1 2 -3 >: 0.006111949287329992 0.013096512893234338 +< 1 3 -4 >: 0.016170697840113622 0.034650116157649069 +< 2 -4 2 >: -0.018335847861989975 -0.039289538679703008 +< 2 -3 1 >: 0.006111949287329991 0.013096512893234333 +< 2 -2 0 >: 0.008035694311719545 0.017218659581761487 +< 2 -1 -1 >: -0.013860598148668817 -0.029700099563699203 +< 2 0 -2 >: 0.008035694311719539 0.017218659581761473 +< 2 1 -3 >: 0.006111949287329992 0.013096512893234338 +< 2 2 -4 >: -0.018335847861989978 -0.039289538679703015 +< 3 -4 1 >: 0.016170697840113612 0.034650116157649048 +< 3 -3 0 >: -0.015340870958737311 -0.032871986474271919 +< 3 -2 -1 >: 0.006111949287329991 0.013096512893234333 +< 3 -1 -2 >: 0.006111949287329992 0.013096512893234338 +< 3 0 -3 >: -0.015340870958737306 -0.032871986474271912 +< 3 1 -4 >: 0.016170697840113622 0.034650116157649069 +< 4 -4 0 >: -0.010227247305824872 -0.021914657649514609 +< 4 -3 -1 >: 0.016170697840113612 0.034650116157649048 +< 4 -2 -2 >: -0.018335847861989975 -0.039289538679703008 +< 4 -1 -3 >: 0.016170697840113619 0.034650116157649069 +< 4 0 -4 >: -0.010227247305824874 -0.021914657649514613 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 2 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.028562625396167999 -0.040893223768209308 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.033474606026999379 0.003531046844184128 +< 1 -1 0 >: -0.066949212053998744 -0.007062093688368256 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.080183448364590931 -0.010055377451931887 +< 1 -1 0 >: -0.160366896729181890 0.020110754903863777 +< 2 -2 0 >: 0.160366896729181918 -0.020110754903863780 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.006927029626842822 -0.039188203779566347 +< 0 1 -1 >: -0.007998644839484427 -0.045250640002381062 +< 1 -2 1 >: 0.004618019751228546 0.026125469186377554 +< 1 -1 0 >: 0.013061732326988476 0.073893985693471081 +< 1 0 -1 >: 0.011311792012604446 0.063994068797429804 +< 2 -2 0 >: -0.010326206085183700 -0.058418325044816345 +< 2 -1 -1 >: -0.014603460693526370 -0.082615987569499116 +< 3 -2 -1 >: 0.017885513588965077 0.101183507070695317 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.007081306006930199 0.020682885014649426 +< 1 -1 0 >: 0.014162612013860399 -0.041365770029298851 +< 2 -2 0 >: -0.014162612013860397 0.041365770029298844 +< 3 -3 0 >: 0.014162612013860397 -0.041365770029298844 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000060535381768797 -0.005509987654540380 +< 0 1 -1 >: 0.000074140398359066 -0.006748329121329302 +< 1 -2 1 >: -0.000052425178439567 0.004771789283370605 +< 1 -1 0 >: -0.000117226262723429 0.010670045211921681 +< 1 0 -1 >: -0.000095714842708615 0.008712055433878303 +< 2 -3 1 >: 0.000030267690884398 -0.002754993827270191 +< 2 -2 0 >: 0.000104850356879135 -0.009543578566741213 +< 2 -1 -1 >: 0.000117226262723429 -0.010670045211921681 +< 3 -3 0 >: -0.000080080782840295 0.007289028530474959 +< 3 -2 -1 >: -0.000138703984589280 0.012624967752601744 +< 4 -3 -1 >: 0.000160161565680589 -0.014578057060949924 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.011913230655226979 0.067478759809899272 +< 1 -1 0 >: -0.023826461310453951 -0.134957519619798516 +< 2 -2 0 >: 0.023826461310453951 0.134957519619798516 +< 3 -3 0 >: -0.023826461310453951 -0.134957519619798516 +< 4 -4 0 >: 0.023826461310453954 0.134957519619798516 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 2 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.002407912466291439 0.009462982242613851 +< 0 1 -1 >: 0.001318867974285719 -0.005183088835550431 +< 0 2 -2 >: 0.005595482928643184 -0.021989983578659979 +< 1 -3 2 >: -0.004681516895549575 0.018398140244405548 +< 1 -2 1 >: -0.003753564058615729 0.014751329431796342 +< 1 -1 0 >: 0.004093451192695446 -0.016087069812443545 +< 1 0 -1 >: 0.001318867974285719 -0.005183088835550431 +< 1 1 -2 >: -0.005898156887700626 0.023179477939421989 +< 2 -4 2 >: 0.003121011263699716 -0.012265426829603699 +< 2 -3 1 >: 0.005517220571804162 -0.021682416213400474 +< 2 -2 0 >: -0.001926329973033152 0.007570385794091083 +< 2 -1 -1 >: -0.003753564058615729 0.014751329431796342 +< 2 0 -2 >: 0.005595482928643184 -0.021989983578659979 +< 3 -4 1 >: -0.005838877424513359 0.022946512449460981 +< 3 -3 0 >: -0.001685538726404007 0.006624087569829693 +< 3 -2 -1 >: 0.005517220571804162 -0.021682416213400474 +< 3 -1 -2 >: -0.004681516895549575 0.018398140244405548 +< 4 -4 0 >: 0.006742154905616029 -0.026496350279318782 +< 4 -3 -1 >: -0.005838877424513359 0.022946512449460981 +< 4 -2 -2 >: 0.003121011263699716 -0.012265426829603699 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.039944153566567428 0.078664696909813467 +< 1 -1 0 >: 0.079888307133134842 -0.157329393819626906 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.148212179996103782 0.052461354094730982 +< 1 -1 0 >: 0.296424359992207564 -0.104922708189461977 +< 2 -2 0 >: -0.296424359992207676 0.104922708189462005 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.029635440469442446 0.144935335828732109 +< 0 1 -1 >: -0.034220059065171435 0.167356910311614537 +< 1 -2 1 >: 0.019756960312961622 -0.096623557219154707 +< 1 -1 0 >: 0.055881122451714650 -0.273292690128122850 +< 1 0 -1 >: 0.048394471635173825 -0.236678412319542952 +< 2 -2 0 >: -0.044177906288547723 0.216056842169870533 +< 2 -1 -1 >: -0.062476994230511826 0.305550516440134146 +< 3 -2 -1 >: 0.076518378263781259 -0.374221427961105635 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.009189405473043527 -0.041296367239119176 +< 1 -1 0 >: -0.018378810946087055 0.082592734478238353 +< 2 -2 0 >: 0.018378810946087051 -0.082592734478238339 +< 3 -3 0 >: -0.018378810946087051 0.082592734478238339 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.004193920271992357 0.059533526155363545 +< 0 1 -1 >: -0.005136482344147857 0.072913380834638525 +< 1 -2 1 >: 0.003632041496991924 -0.051557546027410153 +< 1 -1 0 >: 0.008121491684374040 -0.115286177670363352 +< 1 0 -1 >: 0.006631170192324360 -0.094130769896077993 +< 2 -3 1 >: -0.002096960135996179 0.029766763077681776 +< 2 -2 0 >: -0.007264082993983850 0.103115092054820348 +< 2 -1 -1 >: -0.008121491684374042 0.115286177670363366 +< 3 -3 0 >: 0.005548035029062071 -0.078755452438925594 +< 3 -2 -1 >: 0.009609478552507383 -0.136408444997293432 +< 4 -3 -1 >: -0.011096070058124146 0.157510904877851243 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.016119704515829444 -0.040604277544866535 +< 1 -1 0 >: 0.032239409031658874 0.081208555089733042 +< 2 -2 0 >: -0.032239409031658874 -0.081208555089733042 +< 3 -3 0 >: 0.032239409031658874 0.081208555089733042 +< 4 -4 0 >: -0.032239409031658881 -0.081208555089733056 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 3 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.003883361704442617 -0.014763909030005193 +< 0 1 -1 >: -0.002127004804474931 0.008086526012688061 +< 0 2 -2 >: -0.009024117125163543 0.034308224278878849 +< 1 -3 2 >: 0.007550118073385938 -0.028704319835503804 +< 1 -2 1 >: 0.006053561798635698 -0.023014656502464544 +< 1 -1 0 >: -0.006601714897552447 0.025098645351008825 +< 1 0 -1 >: -0.002127004804474931 0.008086526012688061 +< 1 1 -2 >: 0.009512254662549190 -0.036164043732381669 +< 2 -4 2 >: -0.005033412048923958 0.019136213223669200 +< 2 -3 1 >: -0.008897899480750511 0.033828365341720429 +< 2 -2 0 >: 0.003106689363554094 -0.011811127224004157 +< 2 -1 -1 >: 0.006053561798635698 -0.023014656502464544 +< 2 0 -2 >: -0.009024117125163543 0.034308224278878849 +< 3 -4 1 >: 0.009416651686766643 -0.035800576781611526 +< 3 -3 0 >: 0.002718353193109830 -0.010334736321003631 +< 3 -2 -1 >: -0.008897899480750511 0.033828365341720429 +< 3 -1 -2 >: 0.007550118073385938 -0.028704319835503804 +< 4 -4 0 >: -0.010873412772439327 0.041338945284014536 +< 4 -3 -1 >: 0.009416651686766643 -0.035800576781611526 +< 4 -2 -2 >: -0.005033412048923958 0.019136213223669200 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.005072215053019308 -0.028852562164503000 +< 1 -1 0 >: -0.010144430106038615 0.057705124329005986 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.068168184874519477 -0.026661227943539156 +< 1 -1 0 >: -0.136336369749038955 0.053322455887078318 +< 2 -2 0 >: 0.136336369749039010 -0.053322455887078332 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.029434249958283192 -0.051268600876259576 +< 0 1 -1 >: 0.033987744273619051 -0.059199881033767873 +< 1 -2 1 >: -0.019622833305522121 0.034179067250839704 +< 1 -1 0 >: -0.055501753985711728 0.096673000910799251 +< 1 0 -1 >: -0.048065928906220558 0.083721274648828295 +< 2 -2 0 >: 0.043877989182294373 -0.076426717780414460 +< 2 -1 -1 >: 0.062052847391260650 -0.108083700812723088 +< 3 -2 -1 >: -0.075998906597691415 0.132374958251405522 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.004455294383807628 0.074176281212189638 +< 1 -1 0 >: 0.008910588767615257 -0.148352562424379275 +< 2 -2 0 >: -0.008910588767615255 0.148352562424379247 +< 3 -3 0 >: 0.008910588767615255 -0.148352562424379247 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.003065086686454744 -0.045447316415647733 +< 0 1 -1 >: 0.003753949199606088 -0.055661367698575340 +< 1 -2 1 >: -0.002654442935271277 0.039358530549780481 +< 1 -1 0 >: -0.005935514845660651 0.088008349803811337 +< 1 0 -1 >: -0.004846327577527679 0.071858516707903233 +< 2 -3 1 >: 0.001532543343227373 -0.022723658207823873 +< 2 -2 0 >: 0.005308885870542557 -0.078717061099560989 +< 2 -1 -1 >: 0.005935514845660652 -0.088008349803811337 +< 3 -3 0 >: -0.004054728559607131 0.060121148495533641 +< 3 -2 -1 >: -0.007022995876140124 0.104132883803657469 +< 4 -3 -1 >: 0.008109457119214264 -0.120242296991067324 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.006926660717943072 0.010593690588367720 +< 1 -1 0 >: -0.013853321435886141 -0.021187381176735434 +< 2 -2 0 >: 0.013853321435886141 0.021187381176735434 +< 3 -3 0 >: -0.013853321435886141 -0.021187381176735434 +< 4 -4 0 >: 0.013853321435886143 0.021187381176735437 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 2 4 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.000781000306832227 0.010512068342587475 +< 0 1 -1 >: -0.000427771485470467 -0.005757696957271104 +< 0 2 -2 >: -0.001814880709046459 -0.024427839375021299 +< 1 -3 2 >: 0.001518438142186993 0.020437796739675461 +< 1 -2 1 >: 0.001217458990944270 0.016386692815798080 +< 1 -1 0 >: -0.001327700521614786 -0.017870516182398703 +< 1 0 -1 >: -0.000427771485470467 -0.005757696957271104 +< 1 1 -2 >: 0.001913052240696055 0.025749203580603789 +< 2 -4 2 >: -0.001012292094791329 -0.013625197826450308 +< 2 -3 1 >: -0.001789496511921209 -0.024086174445228044 +< 2 -2 0 >: 0.000624800245465782 0.008409654674069981 +< 2 -1 -1 >: 0.001217458990944270 0.016386692815798080 +< 2 0 -2 >: -0.001814880709046459 -0.024427839375021299 +< 3 -4 1 >: 0.001893825097024421 0.025490411046797022 +< 3 -3 0 >: 0.000546700214782559 0.007358447839811230 +< 3 -2 -1 >: -0.001789496511921209 -0.024086174445228044 +< 3 -1 -2 >: 0.001518438142186993 0.020437796739675461 +< 4 -4 0 >: -0.002186800859130236 -0.029433791359244930 +< 4 -3 -1 >: 0.001893825097024421 0.025490411046797022 +< 4 -2 -2 >: -0.001012292094791329 -0.013625197826450308 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 3 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.176658714096489783 0.023879805557936042 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 3 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: -0.002540801358050102 0.298466751975384748 +< 1 -1 >: 0.005081602716100203 -0.596933503950769384 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 3 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: 0.059823661384663780 0.100956277395379490 +< 1 -1 >: -0.119647322769327574 -0.201912554790758980 +< 2 -2 >: 0.119647322769327602 0.201912554790759036 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 3 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: 0.029432650864335195 0.244404832833674923 +< 1 -1 >: -0.058865301728670390 -0.488809665667349846 +< 2 -2 >: 0.058865301728670383 0.488809665667349735 +< 3 -3 >: -0.058865301728670383 -0.488809665667349735 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 3 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: -0.001906339961232206 -0.025163049350088649 +< 1 -1 >: 0.003812679922464411 0.050326098700177277 +< 2 -2 >: -0.003812679922464411 -0.050326098700177277 +< 3 -3 >: 0.003812679922464411 0.050326098700177277 +< 4 -4 >: -0.003812679922464412 -0.050326098700177291 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 3 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.000012471310214961 -0.000675022383739162 +< 1 -1 >: -0.000024942620429923 0.001350044767478325 +< 2 -2 >: 0.000024942620429923 -0.001350044767478325 +< 3 -3 >: -0.000024942620429923 0.001350044767478325 +< 4 -4 >: 0.000024942620429923 -0.001350044767478325 +< 5 -5 >: -0.000024942620429922 0.001350044767478324 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 3 3 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: -0.007031432348500973 0.042736940015154629 +< 1 -1 >: 0.014062864697001949 -0.085473880030309271 +< 2 -2 >: -0.014062864697001944 0.085473880030309243 +< 3 -3 >: 0.014062864697001949 -0.085473880030309271 +< 4 -4 >: -0.014062864697001940 0.085473880030309229 +< 5 -5 >: 0.014062864697001944 -0.085473880030309243 +< 6 -6 >: -0.014062864697001935 0.085473880030309188 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.022494385424700006 0.030550572951718341 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.032256602544819685 0.141081987034832185 +< 1 -1 0 >: -0.064513205089639356 -0.282163974069664314 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.039490564642876563 -0.041364977212005966 +< 0 1 -1 >: -0.039490564642876563 -0.041364977212005959 +< 1 -1 0 >: 0.068399664381045319 0.071646242185123152 +< 1 0 -1 >: 0.068399664381045319 0.071646242185123152 +< 2 -1 -1 >: -0.096731733029442185 -0.101323087391268510 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.003686817274720872 -0.024299573471098207 +< 1 -1 0 >: -0.007373634549441745 0.048599146942196421 +< 2 -2 0 >: 0.007373634549441747 -0.048599146942196435 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.006364692275466469 -0.128720015722180114 +< 0 1 -1 >: -0.007349313597099392 -0.148633071454587040 +< 1 -2 1 >: 0.004243128183644311 0.085813343814786724 +< 1 -1 0 >: 0.012001378848394606 0.242716789310913533 +< 1 0 -1 >: 0.010393498963150958 0.210198905468246350 +< 2 -2 0 >: -0.009487923055873893 -0.191884470146424263 +< 2 -1 -1 >: -0.013417949464369239 -0.271365620089848436 +< 3 -2 -1 >: 0.016433564791077746 0.332353651477040213 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.000109883258596099 0.076222231585436256 +< 1 -1 0 >: 0.000219766517192198 -0.152444463170872513 +< 2 -2 0 >: -0.000219766517192198 0.152444463170872485 +< 3 -3 0 >: 0.000219766517192198 -0.152444463170872485 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.005775081143343545 -0.138028080587029867 +< 0 1 -1 >: 0.007700108191124730 -0.184037440782706563 +< 0 2 -2 >: 0.001925027047781182 -0.046009360195676634 +< 1 -2 1 >: -0.004304491337364459 0.102880056998805966 +< 1 -1 0 >: -0.010543807378773288 0.252003644355523970 +< 1 0 -1 >: -0.010543807378773288 0.252003644355523970 +< 1 1 -2 >: -0.004304491337364459 0.102880056998805966 +< 2 -2 0 >: 0.007455597697055345 -0.178193485807513957 +< 2 -1 -1 >: 0.012174940056836640 -0.290988743810856987 +< 2 0 -2 >: 0.007455597697055348 -0.178193485807514013 +< 3 -2 -1 >: -0.011388613599298195 0.272195045686990822 +< 3 -1 -2 >: -0.011388613599298193 0.272195045686990822 +< 4 -2 -2 >: 0.016105931808754172 -0.384941925221306547 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.004286442952834003 0.007171131761165309 +< 0 1 -1 >: -0.005249799022996065 0.008782806846560546 +< 1 -2 1 >: 0.003712168489027029 -0.006210382279054599 +< 1 -1 0 >: 0.008300661085397121 -0.013886836942226154 +< 1 0 -1 >: 0.006777461395666574 -0.011338554883228488 +< 2 -3 1 >: -0.002143221476417002 0.003585565880582655 +< 2 -2 0 >: -0.007424336978054061 0.012420764558109204 +< 2 -1 -1 >: -0.008300661085397121 0.013886836942226156 +< 3 -3 0 >: 0.005670431031132069 -0.009486515629460021 +< 3 -2 -1 >: 0.009821474646735925 -0.016431127057021010 +< 4 -3 -1 >: -0.011340862062264142 0.018973031258920046 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.001537531547045407 -0.050717661819310568 +< 0 1 -1 >: 0.000512510515681803 0.016905887273103538 +< 0 2 -2 >: 0.003587573609772615 0.118341210911724656 +< 0 3 -3 >: 0.001537531547045407 0.050717661819310568 +< 1 -3 2 >: -0.002807135703975282 -0.092597358141182987 +< 1 -2 1 >: -0.002899197288544134 -0.095634140262294831 +< 1 -1 0 >: 0.001984944691991796 0.065476219861589885 +< 1 0 -1 >: 0.001984944691991795 0.065476219861589857 +< 1 1 -2 >: -0.002899197288544134 -0.095634140262294817 +< 1 2 -3 >: -0.002807135703975283 -0.092597358141183000 +< 2 -3 1 >: 0.003766167753693276 0.124232392404347289 +< 2 -2 0 >: 0.000887694252574207 0.029281855704047351 +< 2 -1 -1 >: -0.003241401108683878 -0.106922219298120388 +< 2 0 -2 >: 0.000887694252574207 0.029281855704047354 +< 2 1 -3 >: 0.003766167753693275 0.124232392404347275 +< 3 -3 0 >: -0.004067926106398554 -0.134186320252571462 +< 3 -2 -1 >: 0.001917638756800137 0.063256037995375367 +< 3 -1 -2 >: 0.001917638756800137 0.063256037995375367 +< 3 0 -3 >: -0.004067926106398554 -0.134186320252571489 +< 4 -3 -1 >: 0.003321447757341056 0.109562671693497496 +< 4 -2 -2 >: -0.004287970616493293 -0.141444800944968807 +< 4 -1 -3 >: 0.003321447757341056 0.109562671693497496 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.000564000276867000 0.002960362759414127 +< 1 -1 0 >: -0.001128000553734000 -0.005920725518828251 +< 2 -2 0 >: 0.001128000553734000 0.005920725518828251 +< 3 -3 0 >: -0.001128000553734000 -0.005920725518828251 +< 4 -4 0 >: 0.001128000553734001 0.005920725518828253 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.001362998863120273 0.310650973639591432 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.056822075852102985 -0.025729572016269381 +< 1 -1 0 >: 0.113644151704205942 0.051459144032538755 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.039634463368203594 0.108310888568006566 +< 0 1 -1 >: 0.039634463368203587 0.108310888568006553 +< 1 -1 0 >: -0.068648904284456122 -0.187599962012718474 +< 1 0 -1 >: -0.068648904284456122 -0.187599962012718474 +< 2 -1 -1 >: 0.097084211481130306 0.265306410579063845 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.055685185220894801 -0.052456178200205983 +< 1 -1 0 >: 0.111370370441789615 0.104912356400411980 +< 2 -2 0 >: -0.111370370441789643 -0.104912356400412007 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.002405068117621055 0.014712202886592562 +< 0 1 -1 >: -0.002777133450255805 0.016988188593893203 +< 1 -2 1 >: 0.001603378745080703 -0.009808135257728371 +< 1 -1 0 >: 0.004535039933827769 -0.027741595806138396 +< 1 0 -1 >: 0.003927459789871746 -0.024024926709635686 +< 2 -2 0 >: -0.003585263867678760 0.021931657168793063 +< 2 -1 -1 >: -0.005070328786357519 0.031016047013424260 +< 3 -2 -1 >: 0.006209859177360511 -0.037986744510531772 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.002879204336403736 0.002628541220406434 +< 1 -1 0 >: -0.005758408672807473 -0.005257082440812869 +< 2 -2 0 >: 0.005758408672807472 0.005257082440812868 +< 3 -3 0 >: -0.005758408672807472 -0.005257082440812868 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.004629765197891853 -0.029385394315170330 +< 0 1 -1 >: 0.006173020263855807 -0.039180525753560451 +< 0 2 -2 >: 0.001543255065963951 -0.009795131438390111 +< 1 -2 1 >: -0.003450823234116317 0.021902579744785582 +< 1 -1 0 >: -0.008452756116125794 0.053650144425342883 +< 1 0 -1 >: -0.008452756116125794 0.053650144425342890 +< 1 1 -2 >: -0.003450823234116317 0.021902579744785582 +< 2 -2 0 >: 0.005977001169428610 -0.037936380934797592 +< 2 -1 -1 >: 0.009760402038078965 -0.061949850652068032 +< 2 0 -2 >: 0.005977001169428613 -0.037936380934797606 +< 3 -2 -1 >: -0.009130020095915401 0.057948779075463225 +< 3 -1 -2 >: -0.009130020095915400 0.057948779075463218 +< 4 -2 -2 >: 0.012911798244382463 -0.081951949291482293 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000341378894985666 0.029268900300513732 +< 0 1 -1 >: -0.000418102050835023 0.035846935534325934 +< 1 -2 1 >: 0.000295642795373447 -0.025347611201078885 +< 1 -1 0 >: 0.000661077387513088 -0.056678981712847486 +< 1 0 -1 >: 0.000539767426633070 -0.046278194779005064 +< 2 -3 1 >: -0.000170689447492833 0.014634450150256870 +< 2 -2 0 >: -0.000591285590746895 0.050695222402157784 +< 2 -1 -1 >: -0.000661077387513088 0.056678981712847493 +< 3 -3 0 >: 0.000451601829489054 -0.038719115671751500 +< 3 -2 -1 >: 0.000782197313466099 -0.067063475567609984 +< 4 -3 -1 >: -0.000903203658978108 0.077438231343503028 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.001192979420224080 -0.016137607842938776 +< 0 1 -1 >: -0.000397659806741360 0.005379202614312929 +< 0 2 -2 >: -0.002783618647189520 0.037654418300190479 +< 0 3 -3 >: -0.001192979420224080 0.016137607842938776 +< 1 -3 2 >: 0.002178072463653877 -0.029463106132499504 +< 1 -2 1 >: 0.002249503567617181 -0.030429365167656597 +< 1 -1 0 >: -0.001540129808965347 0.020833562141109364 +< 1 0 -1 >: -0.001540129808965347 0.020833562141109353 +< 1 1 -2 >: 0.002249503567617181 -0.030429365167656593 +< 1 2 -3 >: 0.002178072463653878 -0.029463106132499511 +< 2 -3 1 >: -0.002922190853190307 0.039528904884335907 +< 2 -2 0 >: -0.000688766989404056 0.009317052232197314 +< 2 -1 -1 >: 0.002515021446410155 -0.034021064513522215 +< 2 0 -2 >: -0.000688766989404056 0.009317052232197316 +< 2 1 -3 >: -0.002922190853190306 0.039528904884335900 +< 3 -3 0 >: 0.003156326865130934 -0.042696097107901489 +< 3 -2 -1 >: -0.001487906753316908 0.020127133196797656 +< 3 -1 -2 >: -0.001487906753316908 0.020127133196797653 +< 3 0 -3 >: 0.003156326865130935 -0.042696097107901496 +< 4 -3 -1 >: -0.002577130093669736 0.034861217307559735 +< 4 -2 -2 >: 0.003327060644597615 -0.045005638020232198 +< 4 -1 -3 >: -0.002577130093669736 0.034861217307559735 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.002558471978950402 0.027987985900305476 +< 1 -1 0 >: 0.005116943957900802 -0.055975971800610931 +< 2 -2 0 >: -0.005116943957900802 0.055975971800610931 +< 3 -3 0 >: 0.005116943957900802 -0.055975971800610931 +< 4 -4 0 >: -0.005116943957900803 0.055975971800610938 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.004553733633015689 -0.064790509961743667 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.097793834778726593 -0.108485198544140196 +< 1 -1 0 >: -0.195587669557453159 0.216970397088280337 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: -0.032161344950737955 -0.112984298064465527 +< -1 0 1 >: 0.045483010213493089 0.159783926657971392 +< -1 1 0 >: -0.013129814095157363 -0.046125646534077594 +< 0 0 0 >: -0.013129814095157365 -0.046125646534077601 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.093210570847324675 0.043977683080320906 +< 1 -1 0 >: -0.186421141694649378 -0.087955366160641826 +< 2 -2 0 >: 0.186421141694649434 0.087955366160641840 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 2 2 2 ) +num_ms=5 +< -2 0 2 >: -0.029497321738384760 0.039844891202794913 +< -2 1 1 >: 0.024084462345916241 -0.032533217434519271 +< -1 -1 2 >: 0.012042231172958121 -0.016266608717259635 +< -1 0 1 >: -0.014748660869192376 0.019922445601397450 +< 0 0 0 >: 0.004916220289730791 -0.006640815200465815 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: -0.012053716636300216 0.144055293275742763 +< -2 -1 3 >: 0.017046529544057974 -0.203724949482189194 +< -2 0 2 >: -0.011159573138849526 0.133369285993312298 +< -2 1 1 >: 0.006442982555756092 -0.077000793169867049 +< -2 2 0 >: -0.001440694697251595 0.017217900784922423 +< -1 -1 2 >: -0.009111753312483532 0.108895566014311593 +< -1 0 1 >: 0.015782019683255495 -0.188612653055758361 +< -1 1 0 >: -0.005762778789006382 0.068871603139689708 +< 0 0 0 >: -0.004322084091754785 0.051653702354767267 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: -0.004380200531294019 -0.041906832467186635 +< -2 0 2 >: 0.012389077994539682 0.118530421662385019 +< -2 1 1 >: -0.006785777484300248 -0.064921785695087261 +< -1 -2 3 >: 0.006925705143584370 0.066260520059701594 +< -1 -1 2 >: -0.005364628136369064 -0.051325178140453370 +< -1 0 1 >: 0.003917770457221650 0.037482610447329825 +< 0 -3 3 >: -0.006925705143584369 -0.066260520059701594 +< 0 -1 1 >: 0.004155423086150621 0.039756312035820945 +< 0 0 0 >: -0.002770282057433748 -0.026504208023880638 +< 1 -3 2 >: 0.006925705143584370 0.066260520059701594 +< 1 -2 1 >: -0.005364628136369064 -0.051325178140453370 +< 2 -3 1 >: -0.004380200531294019 -0.041906832467186635 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: 0.000809802232324886 0.001889120792213550 +< -2 -1 3 >: -0.001214703348487329 -0.002833681188320325 +< -2 0 2 >: 0.002903696387932681 0.006773793652026266 +< -2 1 1 >: -0.001530382369911856 -0.003570102723398841 +< -1 -3 4 >: -0.001515001252202218 -0.003534221383347035 +< -1 -2 3 >: 0.001431541624742326 0.003339525306636759 +< -1 -1 2 >: -0.000973929376415711 -0.002271999460723093 +< -1 0 1 >: 0.000684407802138027 0.001596598475235387 +< 0 -4 4 >: 0.001749372761563141 0.004080967334102282 +< 0 -3 3 >: -0.000437343190390785 -0.001020241833525570 +< 0 -2 2 >: -0.000499820789018040 -0.001165990666886367 +< 0 -1 1 >: 0.001062119176663335 0.002477730167133528 +< 0 0 0 >: -0.000624775986272550 -0.001457488333607958 +< 1 -4 3 >: -0.001515001252202218 -0.003534221383347035 +< 1 -3 2 >: 0.001431541624742326 0.003339525306636759 +< 1 -2 1 >: -0.000973929376415711 -0.002271999460723093 +< 2 -4 2 >: 0.000809802232324886 0.001889120792213550 +< 2 -3 1 >: -0.001214703348487329 -0.002833681188320325 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.035701527119409944 -0.053420162550066437 +< 0 1 -1 >: 0.041224572585744086 -0.061684290456868816 +< 1 -2 1 >: -0.023801018079606620 0.035613441700044275 +< 1 -1 0 >: -0.067319445132933850 0.100730024509972343 +< 1 0 -1 >: -0.058300349653793382 0.087234760149465171 +< 2 -2 0 >: 0.053220694359701913 -0.079634076554024699 +< 2 -1 -1 >: 0.075265427762403719 -0.112619591089759025 +< 3 -2 -1 >: -0.092180946645098072 0.137930266605400254 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.003482305721539481 0.020452352358404691 +< 1 -1 0 >: 0.006964611443078962 -0.040904704716809383 +< 2 -2 0 >: -0.006964611443078961 0.040904704716809376 +< 3 -3 0 >: 0.006964611443078961 -0.040904704716809376 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: 0.004382834526596494 -0.117676364726824578 +< -3 0 3 >: -0.005367854108607040 0.144123524183184498 +< -3 1 2 >: 0.004969667226395071 -0.133432455538847611 +< -3 2 1 >: -0.003704171247924070 0.099454680329860490 +< -3 3 0 >: 0.001014429074675037 -0.027236785933064969 +< -2 -2 4 >: -0.002829107521781848 0.075959766804870224 +< -2 -1 3 >: 0.002530430693744072 -0.067940480852288751 +< -2 0 2 >: 0.001171361798674831 -0.031450331380630539 +< -2 1 1 >: -0.003825651614589406 0.102716352165315231 +< -2 2 0 >: 0.002367001174241754 -0.063552500510484930 +< -1 -1 2 >: -0.002138604267113434 0.057420186460613150 +< -1 0 1 >: 0.002619244608083346 -0.070325078881984707 +< -1 1 0 >: 0.000338143024891679 -0.009078928644354996 +< 0 0 0 >: -0.001014429074675037 0.027236785933064969 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.007723239197808061 -0.134033210982121453 +< 0 1 -1 >: 0.009458997598045913 -0.164156487746500074 +< 1 -2 1 >: -0.006688521344805530 0.116076165661316608 +< 1 -1 0 >: -0.014955988395943478 0.259554196986230779 +< 1 0 -1 >: -0.012211513389682590 0.211925114404698856 +< 2 -3 1 >: 0.003861619598904031 -0.067016605491060754 +< 2 -2 0 >: 0.013377042689611065 -0.232152331322633299 +< 2 -1 -1 >: 0.014955988395943479 -0.259554196986230834 +< 3 -3 0 >: -0.010216885116633056 0.177309271841072369 +< 3 -2 -1 >: -0.017696164117102734 0.307108667481779118 +< 4 -3 -1 >: 0.020433770233266119 -0.354618543682144849 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.003908715996914536 -0.054969785859003528 +< 1 -1 0 >: -0.007817431993829071 0.109939571718007015 +< 2 -2 0 >: 0.007817431993829071 -0.109939571718007015 +< 3 -3 0 >: -0.007817431993829071 0.109939571718007015 +< 4 -4 0 >: 0.007817431993829071 -0.109939571718007029 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 3 ) +l=( 4 4 4 ) +num_ms=13 +< -4 0 4 >: 0.000775532495355726 -0.009285757436870396 +< -4 1 3 >: -0.001634966056532032 0.019576095533571761 +< -4 2 2 >: 0.000926938625917656 -0.011098602947887106 +< -3 -1 4 >: -0.000817483028266016 0.009788047766785877 +< -3 0 3 >: 0.001163298743033588 -0.013928636155305596 +< -3 1 2 >: -0.000617959083945104 0.007399068631924736 +< -2 -2 4 >: 0.000463469312958828 -0.005549301473943552 +< -2 -1 3 >: -0.000308979541972552 0.003699534315962368 +< -2 0 2 >: -0.000609346960636641 0.007295952271826740 +< -2 1 1 >: 0.000700699738513728 -0.008389755228673614 +< -1 -1 2 >: 0.000350349869256864 -0.004194877614336807 +< -1 0 1 >: -0.000498556604157252 0.005969415495130970 +< 0 0 0 >: 0.000166185534719084 -0.001989805165043657 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.066664158356713826 -0.065458414025154135 +< 1 -1 0 >: 0.133328316713427625 0.130916828050308243 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: 0.043462810338660528 0.002981869019847740 +< -1 0 1 >: -0.061465695839783299 -0.004216999609088842 +< -1 1 0 >: 0.017743618019513272 0.001217342929739994 +< 0 0 0 >: 0.017743618019513272 0.001217342929739995 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.044287821139775037 -0.044567938890902138 +< 1 -1 0 >: 0.088575642279550088 0.089135877781804290 +< 2 -2 0 >: -0.088575642279550101 -0.089135877781804304 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 2 2 2 ) +num_ms=7 +< -2 0 2 >: 0.106016957408160653 0.033269414514770987 +< -2 1 1 >: -0.129843724866185284 -0.040746544801166656 +< -2 2 0 >: 0.053008478704080340 0.016634707257385500 +< -1 -1 2 >: -0.064921862433092642 -0.020373272400583328 +< -1 0 1 >: 0.053008478704080313 0.016634707257385490 +< -1 1 0 >: 0.026504239352040156 0.008317353628692745 +< 0 0 0 >: -0.026504239352040156 -0.008317353628692745 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: -0.045985631644394974 0.036820920571881154 +< -2 -1 3 >: 0.065033503945796753 -0.052072645251816839 +< -2 0 2 >: -0.042574422077117542 0.034089548357576195 +< -2 1 1 >: 0.024580354046816563 -0.019681609920799384 +< -2 2 0 >: -0.005496334255969388 0.004400941768954168 +< -1 -1 2 >: -0.034761870060940378 0.027833999679331350 +< -1 0 1 >: 0.060209325111656158 -0.048209901622457731 +< -1 1 0 >: -0.021985337023877557 0.017603767075816675 +< 0 0 0 >: -0.016489002767908163 0.013202825306862500 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 2 3 3 ) +num_ms=14 +< -2 -1 3 >: -0.009379752710374514 0.102811600243705448 +< -2 0 2 >: 0.013264973494717440 -0.145397559433929291 +< -2 1 1 >: -0.014531050415529753 0.159275046216322297 +< -2 2 0 >: 0.013264973494717440 -0.145397559433929291 +< -1 -2 3 >: 0.014830691226960565 -0.162559413328415808 +< -1 -1 2 >: -0.011487804026952545 0.125917980118040507 +< -1 0 1 >: 0.004194752934507063 -0.045978745404091879 +< -1 1 0 >: 0.004194752934507063 -0.045978745404091879 +< 0 -3 3 >: -0.014830691226960563 0.162559413328415781 +< 0 -1 1 >: 0.008898414736176335 -0.097535647997049446 +< 0 0 0 >: -0.005932276490784225 0.065023765331366321 +< 1 -3 2 >: 0.014830691226960565 -0.162559413328415808 +< 1 -2 1 >: -0.011487804026952545 0.125917980118040507 +< 2 -3 1 >: -0.009379752710374514 0.102811600243705448 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.029546446403111212 -0.003892591581908146 +< 0 1 -1 >: -0.034117297568866202 -0.004494777595319877 +< 1 -2 1 >: 0.019697630935407467 0.002595061054605430 +< 1 -1 0 >: 0.055713313630946164 0.007339941077218454 +< 1 0 -1 >: 0.048249144933409205 0.006356575435152097 +< 2 -2 0 >: -0.044045241767273875 -0.005802732923860036 +< 2 -1 -1 >: -0.062289378265280616 -0.008206303599751746 +< 3 -2 -1 >: 0.076288596572573142 0.010050628246878286 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.001030179959723282 -0.043275519382215084 +< 1 -1 0 >: -0.002060359919446563 0.086551038764430169 +< 2 -2 0 >: 0.002060359919446563 -0.086551038764430155 +< 3 -3 0 >: -0.002060359919446563 0.086551038764430155 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 3 3 2 ) +num_ms=12 +< -3 1 2 >: 0.008917378502174089 -0.073728040405108039 +< -3 2 1 >: -0.014099613412345441 0.116574267550532379 +< -3 3 0 >: 0.014099613412345439 -0.116574267550532365 +< -2 1 1 >: 0.010921513586795328 -0.090298039363907942 +< -2 3 -1 >: -0.014099613412345441 0.116574267550532379 +< -1 1 0 >: -0.008459768047407262 0.069944560530319402 +< -1 2 -1 >: 0.010921513586795328 -0.090298039363907942 +< -1 3 -2 >: 0.008917378502174089 -0.073728040405108039 +< 0 0 0 >: 0.005639845364938176 -0.046629707020212949 +< 0 1 -1 >: -0.007975945804782610 0.065944364077469092 +< 0 2 -2 >: -0.025222155237177756 0.208534389336190729 +< 1 1 -2 >: 0.013814743372299319 -0.114218989054996417 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: -0.001068781669214567 0.066023814167766440 +< -3 0 3 >: 0.001308984868007883 -0.080862327791683272 +< -3 1 2 >: -0.001211884501099818 0.074863968383936982 +< -3 2 1 >: 0.000903285375112537 -0.055800307457292704 +< -3 3 0 >: -0.000247374887906826 0.015281543555041478 +< -2 -2 4 >: 0.000689895600933297 -0.042618188787475440 +< -2 -1 3 >: -0.000617061384425968 0.038118866882685780 +< -2 0 2 >: -0.000285643916247519 0.017645606570272372 +< -2 1 1 >: 0.000932909123915620 -0.057630309732092856 +< -2 2 0 >: -0.000577208071782594 0.035656934961763448 +< -1 -1 2 >: 0.000521512054476276 -0.032216322531331831 +< -1 0 1 >: -0.000638719214088709 0.039456775795345955 +< -1 1 0 >: -0.000082458295968942 0.005093847851680496 +< 0 0 0 >: 0.000247374887906826 -0.015281543555041478 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.005641052905865435 0.092111697634158968 +< 0 1 -1 >: -0.006908850615707313 0.112813329272608967 +< 1 -2 1 >: 0.004885295120571495 -0.079771070136892649 +< 1 -1 0 >: 0.010923851979745896 -0.178373535463995453 +< 1 0 -1 >: 0.008919287792023091 -0.145641381834342720 +< 2 -3 1 >: -0.002820526452932718 0.046055848817079498 +< 2 -2 0 >: -0.009770590241142994 0.159542140273785354 +< 2 -1 -1 >: -0.010923851979745896 0.178373535463995453 +< 3 -3 0 >: 0.007462411560739097 -0.121852322389980630 +< 3 -2 -1 >: 0.012925275970189483 -0.211054413399709206 +< 4 -3 -1 >: -0.014924823121478199 0.243704644779961344 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.001879958236216916 0.030209742754573738 +< 1 -1 0 >: 0.003759916472433831 -0.060419485509147455 +< 2 -2 0 >: -0.003759916472433831 0.060419485509147455 +< 3 -3 0 >: 0.003759916472433831 -0.060419485509147455 +< 4 -4 0 >: -0.003759916472433832 0.060419485509147469 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 4 4 2 ) +num_ms=18 +< -4 2 2 >: 0.000165183908643678 0.008762327111258185 +< -4 3 1 >: -0.000309030795976405 -0.016392812980584381 +< -4 4 0 >: 0.000356838026489723 0.018928789974231159 +< -3 1 2 >: -0.000247775862965517 -0.013143490666887279 +< -3 2 1 >: 0.000292006654862109 0.015489752298363482 +< -3 3 0 >: -0.000089209506622431 -0.004732197493557788 +< -3 4 -1 >: -0.000309030795976405 -0.016392812980584381 +< -2 1 1 >: -0.000198662654556260 -0.010538236916089957 +< -2 2 0 >: -0.000101953721854207 -0.005408225706923190 +< -2 3 -1 >: 0.000292006654862109 0.015489752298363482 +< -2 4 -2 >: 0.000165183908643678 0.008762327111258185 +< -1 1 0 >: 0.000216651658940189 0.011492479627211774 +< -1 2 -1 >: -0.000198662654556260 -0.010538236916089957 +< -1 3 -2 >: -0.000247775862965517 -0.013143490666887279 +< 0 0 0 >: -0.000127442152317758 -0.006760282133653986 +< 0 1 -1 >: 0.000139605883202891 0.007405518039402884 +< 0 2 -2 >: 0.000592297600237808 0.031418952143166520 +< 1 1 -2 >: -0.000312168244900560 -0.016559241744705820 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 3 4 ) +l=( 4 4 4 ) +num_ms=19 +< -4 0 4 >: -0.000195030428604774 0.001789977071893170 +< -4 1 3 >: 0.000308370183714971 -0.002830202253330689 +< -4 2 2 >: -0.000349658921938763 0.003209147709568985 +< -4 3 1 >: 0.000308370183714971 -0.002830202253330690 +< -4 4 0 >: -0.000097515214302387 0.000894988535946585 +< -3 -1 4 >: 0.000308370183714971 -0.002830202253330689 +< -3 0 3 >: -0.000292545642907161 0.002684965607839755 +< -3 1 2 >: 0.000116552973979588 -0.001069715903189661 +< -3 2 1 >: 0.000116552973979588 -0.001069715903189661 +< -3 3 0 >: -0.000146272821453581 0.001342482803919877 +< -2 -2 4 >: -0.000174829460969381 0.001604573854784492 +< -2 -1 3 >: 0.000116552973979588 -0.001069715903189661 +< -2 0 2 >: 0.000153238193903751 -0.001406410556487491 +< -2 1 1 >: -0.000264317300327118 0.002425887645712020 +< -2 2 0 >: 0.000076619096951876 -0.000703205278243745 +< -1 -1 2 >: -0.000132158650163559 0.001212943822856010 +< -1 0 1 >: 0.000125376704103069 -0.001150699546217038 +< -1 1 0 >: 0.000062688352051535 -0.000575349773108519 +< 0 0 0 >: -0.000062688352051535 0.000575349773108519 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.047525227733783315 0.060775651937650811 +< 0 1 -1 >: 0.047525227733783308 0.060775651937650797 +< 1 -1 0 >: -0.082316109076194202 -0.105266517019133088 +< 1 0 -1 >: -0.082316109076194202 -0.105266517019133088 +< 2 -1 -1 >: 0.116412557857336854 0.148869336032236232 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.021861474116540425 -0.014568241311156417 +< 0 1 -1 >: 0.025243455932133292 -0.016821956085231161 +< 1 -2 1 >: -0.014574316077693612 0.009712160874104274 +< 1 -1 0 >: -0.041222390918773125 0.027470139256215206 +< 1 0 -1 >: -0.035699637740390464 0.023789838441378525 +< 2 -2 0 >: 0.032589161475291034 -0.021717051922910940 +< 2 -1 -1 >: 0.046088034144723358 -0.030712549364141351 +< 3 -2 -1 >: -0.056446083451270369 0.037615037321093128 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.006240588588765760 -0.068885280705849511 +< 0 1 -1 >: -0.008320784785021016 -0.091847040941132718 +< 0 2 -2 >: -0.002080196196255254 -0.022961760235283176 +< 1 -2 1 >: 0.004651460101363241 0.051344056769144740 +< 1 -1 0 >: 0.011393703807254461 0.125766740408897265 +< 1 0 -1 >: 0.011393703807254463 0.125766740408897265 +< 1 1 -2 >: 0.004651460101363241 0.051344056769144740 +< 2 -2 0 >: -0.008056565224940611 -0.088930514990859411 +< 2 -1 -1 >: -0.013156315920370455 -0.145222922860357234 +< 2 0 -2 >: -0.008056565224940615 -0.088930514990859438 +< 3 -2 -1 >: 0.012306606661546433 0.135843605512339538 +< 3 -1 -2 >: 0.012306606661546432 0.135843605512339510 +< 4 -2 -2 >: -0.017404170047550040 -0.192111869277211050 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.003062949483190131 -0.030827964827846322 +< 0 1 -1 >: -0.003751331670868632 -0.037756391818345079 +< 1 -2 1 >: 0.002652592062951071 0.026697800687888084 +< 1 -1 0 >: 0.005931376169334998 0.059698097187858415 +< 1 0 -1 >: 0.004842948362458217 0.048743292241777474 +< 2 -3 1 >: -0.001531474741595066 -0.015413982413923165 +< 2 -2 0 >: -0.005305184125902145 -0.053395601375776189 +< 2 -1 -1 >: -0.005931376169334998 -0.059698097187858422 +< 3 -3 0 >: 0.004051901305437450 0.040781564180363744 +< 3 -2 -1 >: 0.007018098928272326 0.070635741172521055 +< 4 -3 -1 >: -0.008103802610874903 -0.081563128360727516 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.000836442954682002 0.008642052578707270 +< 0 1 -1 >: -0.000278814318227334 -0.002880684192902426 +< 0 2 -2 >: -0.001951700227591339 -0.020164789350316965 +< 0 3 -3 >: -0.000836442954682002 -0.008642052578707270 +< 1 -3 2 >: 0.001527128914485346 0.015778157135012204 +< 1 -2 1 >: 0.001577211960883616 0.016295610618065604 +< 1 -1 0 >: -0.001079843211178640 -0.011156841904794044 +< 1 0 -1 >: -0.001079843211178640 -0.011156841904794039 +< 1 1 -2 >: 0.001577211960883616 0.016295610618065604 +< 1 2 -3 >: 0.001527128914485347 0.015778157135012207 +< 2 -3 1 >: -0.002048858437916820 -0.021168619148136378 +< 2 -2 0 >: -0.000482920565047420 -0.004989491382667540 +< 2 -1 -1 >: 0.001763376579730752 0.018219046538431028 +< 2 0 -2 >: -0.000482920565047420 -0.004989491382667541 +< 2 1 -3 >: -0.002048858437916819 -0.021168619148136378 +< 3 -3 0 >: 0.002213020043980647 0.022864721940403888 +< 3 -2 -1 >: -0.001043227653333645 -0.010778533289336286 +< 3 -1 -2 >: -0.001043227653333645 -0.010778533289336284 +< 3 0 -3 >: 0.002213020043980648 0.022864721940403891 +< 4 -3 -1 >: -0.001806923299434725 -0.018668967288202939 +< 4 -2 -2 >: 0.002332727948861615 0.024101533132700335 +< 4 -1 -3 >: -0.001806923299434725 -0.018668967288202939 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 2 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.029237905706183832 -0.128485553661727453 +< 0 1 -1 >: -0.029237905706183828 -0.128485553661727425 +< 1 -1 0 >: 0.050641538190018397 0.222543506980729361 +< 1 0 -1 >: 0.050641538190018397 0.222543506980729361 +< 2 -1 -1 >: -0.071617950127759039 -0.314724045790218954 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.005655341211660518 0.076721839767011066 +< 0 1 -1 >: -0.006530225541822766 0.088590749684414313 +< 1 -2 1 >: 0.003770227474440344 -0.051147893178007359 +< 1 -1 0 >: 0.010663813655170397 -0.144668088438296677 +< 1 0 -1 >: 0.009235133526600950 -0.125286239704498703 +< 2 -2 0 >: -0.008430484923485962 0.114370166051922240 +< 2 -1 -1 >: -0.011922506116175751 0.161743839961491359 +< 3 -2 -1 >: 0.014602028219921103 -0.198094938472018478 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 2 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.003688550512002725 0.059394131097942435 +< 0 1 -1 >: 0.004918067349336969 0.079192174797256612 +< 0 2 -2 >: 0.001229516837334242 0.019798043699314150 +< 1 -2 1 >: -0.002749283227759917 -0.044269771533177842 +< 1 -1 0 >: -0.006734341066403744 -0.108438351285873855 +< 1 0 -1 >: -0.006734341066403745 -0.108438351285873869 +< 1 1 -2 >: -0.002749283227759917 -0.044269771533177842 +< 2 -2 0 >: 0.004761898234877131 0.076677493534930349 +< 2 -1 -1 >: 0.007776147255005907 0.125213822610756947 +< 2 0 -2 >: 0.004761898234877133 0.076677493534930377 +< 3 -2 -1 >: -0.007273919704333691 -0.117126806074435222 +< 3 -1 -2 >: -0.007273919704333691 -0.117126806074435208 +< 4 -2 -2 >: 0.010286875897481597 0.165642317667909655 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.001338310405543282 0.013816890326506145 +< 0 1 -1 >: 0.001639088805519132 0.016922165565968459 +< 1 -2 1 >: -0.001159010809349536 -0.011965778024057789 +< 1 -1 0 >: -0.002591626956362612 -0.026756293065466334 +< 1 0 -1 >: -0.002116054548910202 -0.021846421806253478 +< 2 -3 1 >: 0.000669155202771641 0.006908445163253073 +< 2 -2 0 >: 0.002318021618699074 0.023931556048115588 +< 2 -1 -1 >: 0.002591626956362613 0.026756293065466334 +< 3 -3 0 >: -0.001770418255038761 -0.018278027848094645 +< 3 -2 -1 >: -0.003066454368374569 -0.031658472895058770 +< 4 -3 -1 >: 0.003540836510077523 0.036556055696189305 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 2 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.000290279039957704 0.008903859516862032 +< 0 1 -1 >: 0.000096759679985902 -0.002967953172287346 +< 0 2 -2 >: 0.000677317759901310 -0.020775672206011408 +< 0 3 -3 >: 0.000290279039957704 -0.008903859516862032 +< 1 -3 2 >: -0.000529974593852594 0.016256149020807947 +< 1 -2 1 >: -0.000547355406907770 0.016789278514948054 +< 1 -1 0 >: 0.000374748629169756 -0.011494833208592358 +< 1 0 -1 >: 0.000374748629169756 -0.011494833208592353 +< 1 1 -2 >: -0.000547355406907770 0.016789278514948051 +< 1 2 -3 >: -0.000529974593852594 0.016256149020807950 +< 2 -3 1 >: 0.000711035530921346 -0.021809912557735935 +< 2 -2 0 >: 0.000167592681859687 -0.005140645688886903 +< 2 -1 -1 >: -0.000611961948848916 0.018770984026300282 +< 2 0 -2 >: 0.000167592681859687 -0.005140645688886904 +< 2 1 -3 >: 0.000711035530921345 -0.021809912557735931 +< 3 -3 0 >: -0.000768006150542667 0.023557397990272653 +< 3 -2 -1 >: 0.000362041571361131 -0.011105063910688094 +< 3 -1 -2 >: 0.000362041571361131 -0.011105063910688093 +< 3 0 -3 >: -0.000768006150542667 0.023557397990272656 +< 4 -3 -1 >: 0.000627074396049552 -0.019234534914611308 +< 4 -2 -2 >: -0.000809549564244330 0.024831677798778224 +< 4 -1 -3 >: 0.000627074396049552 -0.019234534914611308 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 3 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.012791305455401133 -0.031734570064752096 +< 0 1 -1 >: -0.012791305455401131 -0.031734570064752096 +< 1 -1 0 >: 0.022155190943887720 0.054965887708504996 +< 1 0 -1 >: 0.022155190943887720 0.054965887708504996 +< 2 -1 -1 >: -0.031332171509811581 -0.077733503865244358 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.027599415306187654 -0.092072968743109149 +< 0 1 -1 >: -0.031869059713007422 -0.106316706577844075 +< 1 -2 1 >: 0.018399610204125096 0.061381979162072740 +< 1 -1 0 >: 0.052041956586104221 0.173614454832612009 +< 1 0 -1 >: 0.045069656466213116 0.150354528349227939 +< 2 -2 0 >: -0.041142779175922503 -0.137254277999870250 +< 2 -1 -1 >: -0.058184676304310949 -0.194106861441143613 +< 3 -2 -1 >: 0.071261383897284550 0.237731383051958428 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 3 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.003208876008607552 -0.015865073805428828 +< 0 1 -1 >: -0.004278501344810070 -0.021153431740571781 +< 0 2 -2 >: -0.001069625336202517 -0.005288357935142944 +< 1 -2 1 >: 0.002391754962204895 0.011825127832330046 +< 1 -1 0 >: 0.005858579247171660 0.028965529332392329 +< 1 0 -1 >: 0.005858579247171660 0.028965529332392333 +< 1 1 -2 >: 0.002391754962204895 0.011825127832330046 +< 2 -2 0 >: -0.004142641113793858 -0.020481722211592460 +< 2 -1 -1 >: -0.006764904610846626 -0.033446512314553430 +< 2 0 -2 >: -0.004142641113793859 -0.020481722211592467 +< 3 -2 -1 >: 0.006327988826998846 0.031286347465893614 +< 3 -1 -2 >: 0.006327988826998845 0.031286347465893614 +< 4 -2 -2 >: -0.008949127621687177 -0.044245576903383849 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000311875931422909 0.030493197373766243 +< 0 1 -1 >: 0.000381968447520683 0.037346387095851676 +< 1 -2 1 >: -0.000270092479441173 -0.026407883568294495 +< 1 -1 0 >: -0.000603945144241926 -0.059049822800606208 +< 1 0 -1 >: -0.000493119145341435 -0.048213978421083034 +< 2 -3 1 >: 0.000155937965711454 0.015246598686883125 +< 2 -2 0 >: 0.000540184958882345 0.052815767136589011 +< 2 -1 -1 >: 0.000603945144241926 0.059049822800606215 +< 3 -3 0 >: -0.000412573077225826 -0.040338708465096684 +< 3 -2 -1 >: -0.000714597531590169 -0.069868692573256244 +< 4 -3 -1 >: 0.000825146154451652 0.080677416930193396 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 3 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.000434757122193576 -0.025981169198161836 +< 0 1 -1 >: -0.000144919040731192 0.008660389732720618 +< 0 2 -2 >: -0.001014433285118343 0.060622728129044283 +< 0 3 -3 >: -0.000434757122193576 0.025981169198161836 +< 1 -3 2 >: 0.000793754276204838 -0.047434908133972144 +< 1 -2 1 >: 0.000819785891392602 -0.048990562461800780 +< 1 -1 0 >: -0.000561269031300261 0.033541545206492641 +< 1 0 -1 >: -0.000561269031300261 0.033541545206492628 +< 1 1 -2 >: 0.000819785891392602 -0.048990562461800773 +< 1 2 -3 >: 0.000793754276204838 -0.047434908133972151 +< 2 -3 1 >: -0.001064933111415097 0.063640607456411674 +< 2 -2 0 >: -0.000251007141530568 0.015000235030419943 +< 2 -1 -1 >: 0.000916548490074559 -0.054773113960267988 +< 2 0 -2 >: -0.000251007141530568 0.015000235030419945 +< 2 1 -3 >: -0.001064933111415097 0.063640607456411660 +< 3 -3 0 >: 0.001150259226038322 -0.068739712469027631 +< 3 -2 -1 >: -0.000542237399236058 0.032404211215775282 +< 3 -1 -2 >: -0.000542237399236058 0.032404211215775275 +< 3 0 -3 >: 0.001150259226038322 -0.068739712469027645 +< 4 -3 -1 >: -0.000939182725240862 0.056125740204916043 +< 4 -2 -2 >: 0.001212479684634518 -0.072458019035734608 +< 4 -1 -3 >: -0.000939182725240862 0.056125740204916043 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 2 1 1 ) +num_ms=4 +< 0 -1 1 >: 0.017006555442343647 0.051682027384418273 +< 0 0 0 >: 0.017006555442343651 0.051682027384418280 +< 1 -1 0 >: -0.058912436175752418 -0.179031794535957051 +< 2 -1 -1 >: 0.041657383116094210 0.126594595964371892 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 2 2 2 ) +num_ms=8 +< -2 0 2 >: -0.073419485635343396 -0.030314404211117290 +< -2 1 1 >: 0.044960069246047618 0.018563705543428739 +< -1 -1 2 >: 0.044960069246047618 0.018563705543428739 +< -1 0 1 >: -0.036709742817671677 -0.015157202105558635 +< 0 -2 2 >: -0.036709742817671677 -0.015157202105558635 +< 0 -1 1 >: -0.018354871408835838 -0.007578601052779317 +< 0 0 0 >: 0.018354871408835838 0.007578601052779317 +< 1 -2 1 >: 0.044960069246047618 0.018563705543428739 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: 0.010399637935952335 -0.034587632831313740 +< -2 0 2 >: -0.029414618025587074 0.097828598880849688 +< -2 1 1 >: 0.016111049813012111 -0.053582930376166016 +< -1 -2 3 >: -0.016443271359350829 0.054687849310284906 +< -1 -1 2 >: 0.012736903226387035 -0.042361025923726855 +< -1 0 1 >: -0.009301718946470012 0.030936119276648424 +< 0 -3 3 >: 0.016443271359350826 -0.054687849310284906 +< 0 -1 1 >: -0.009865962815610493 0.032812709586170934 +< 0 0 0 >: 0.006577308543740331 -0.021875139724113962 +< 1 -3 2 >: -0.016443271359350829 0.054687849310284906 +< 1 -2 1 >: 0.012736903226387035 -0.042361025923726855 +< 2 -3 1 >: 0.010399637935952335 -0.034587632831313740 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: -0.000056969662490620 -0.003666580543715266 +< -2 -1 3 >: 0.000085454493735930 0.005499870815572900 +< -2 0 2 >: -0.000204275311418739 -0.013147205892832026 +< -2 1 1 >: 0.000107662542303903 0.006929185914756131 +< -1 -3 4 >: 0.000106580479240023 0.006859544087796920 +< -1 -2 3 >: -0.000100709086672565 -0.006481659915569307 +< -1 -1 2 >: 0.000068516022368586 0.004409706913583733 +< -1 0 1 >: -0.000048148152644395 -0.003098826146825754 +< 0 -4 4 >: -0.000123068536759173 -0.007920719251215312 +< 0 -3 3 >: 0.000030767134189793 0.001980179812803828 +< 0 -2 2 >: 0.000035162439074049 0.002263062643204376 +< 0 -1 1 >: -0.000074720183032355 -0.004809008116809297 +< 0 0 0 >: 0.000043953048842562 0.002828828304005469 +< 1 -4 3 >: 0.000106580479240023 0.006859544087796920 +< 1 -3 2 >: -0.000100709086672565 -0.006481659915569307 +< 1 -2 1 >: 0.000068516022368586 0.004409706913583733 +< 2 -4 2 >: -0.000056969662490620 -0.003666580543715266 +< 2 -3 1 >: 0.000085454493735930 0.005499870815572900 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.025159180427669910 0.062119674465192128 +< 0 1 -1 >: 0.029051319185011158 0.071729621548901154 +< 1 -2 1 >: -0.016772786951779934 -0.041413116310128069 +< 1 -1 0 >: -0.047440605572003344 -0.117133981491835112 +< 1 0 -1 >: -0.041084769596272469 -0.101441003618345432 +< 2 -2 0 >: 0.037505091796301425 0.092602543229551637 +< 2 -1 -1 >: 0.053040209476377380 0.130959772545472752 +< 3 -2 -1 >: -0.064960724533728753 -0.160392309783676773 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 3 2 3 ) +num_ms=14 +< -3 0 3 >: 0.002833752401334180 -0.079207572764643866 +< -3 1 2 >: -0.002833752401334180 0.079207572764643866 +< -3 2 1 >: 0.001792222382637516 -0.050095267573958942 +< -2 -1 3 >: -0.002833752401334180 0.079207572764643866 +< -2 1 1 >: 0.002195015171528512 -0.061353922042195599 +< -1 -2 3 >: 0.001792222382637516 -0.050095267573958942 +< -1 -1 2 >: 0.002195015171528512 -0.061353922042195599 +< -1 0 1 >: -0.001700251440800508 0.047524543658786306 +< 0 -2 2 >: -0.002534585200314599 0.070845406813801901 +< 0 -1 1 >: -0.000801506215674825 0.022403284729282640 +< 0 0 0 >: 0.001133500960533672 -0.031683029105857546 +< 1 -2 1 >: 0.002776498976262111 -0.077607254815098989 +< 1 -1 0 >: -0.000801506215674825 0.022403284729282640 +< 2 -2 0 >: -0.002534585200314599 0.070845406813801901 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 4 2 2 ) +num_ms=9 +< 0 -2 2 >: 0.000834529747187740 0.010078086610853210 +< 0 -1 1 >: 0.003338118988750962 0.040312346443412847 +< 0 0 0 >: 0.002503589241563220 0.030234259832559625 +< 1 -2 1 >: -0.003732130487915003 -0.045070573489996490 +< 1 -1 0 >: -0.009141815348876177 -0.110399907465101838 +< 2 -2 0 >: 0.006464239625545608 0.078064523210940845 +< 2 -1 -1 >: 0.005278029552555514 0.063739416293486326 +< 3 -2 -1 >: -0.009874289131465252 -0.119245528901591236 +< 4 -2 -2 >: 0.006982176804255703 0.084319322112491588 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000572908359465638 -0.024115899432731829 +< 0 1 -1 >: -0.000701666575032910 -0.029535824149233642 +< 1 -2 1 >: 0.000496153193337710 0.020884981543856498 +< 1 -1 0 >: 0.001109432267556715 0.046700238440891648 +< 1 0 -1 >: 0.000905847653230952 0.038130585015497570 +< 2 -3 1 >: -0.000286454179732819 -0.012057949716365918 +< 2 -2 0 >: -0.000992306386675420 -0.041769963087713018 +< 2 -1 -1 >: -0.001109432267556715 -0.046700238440891648 +< 3 -3 0 >: 0.000757886521588038 0.031902336270826032 +< 3 -2 -1 >: 0.001312697961762130 0.055256467301218123 +< 4 -3 -1 >: -0.001515773043176077 -0.063804672541652077 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 4 3 3 ) +num_ms=14 +< 0 -3 3 >: -0.000232922969764295 -0.008537019114105015 +< 0 -2 2 >: -0.000543486929450021 -0.019919711266245036 +< 0 -1 1 >: -0.000077640989921432 -0.002845673038035007 +< 0 0 0 >: 0.000232922969764295 0.008537019114105015 +< 1 -3 2 >: 0.000850514431339986 0.031172786284320568 +< 1 -2 1 >: 0.000878407527543690 0.032195115235748417 +< 1 -1 0 >: -0.000601404521897524 -0.022042488570122077 +< 2 -3 1 >: -0.001141084850592472 -0.041822681507888343 +< 2 -2 0 >: -0.000268956278587725 -0.009857700567211020 +< 2 -1 -1 >: 0.000491044735883803 0.017997616552643158 +< 3 -3 0 >: 0.001232512505261881 0.045173659027453628 +< 3 -2 -1 >: -0.000581011966911931 -0.021295067086214238 +< 4 -3 -1 >: -0.001006342246496992 -0.036884138143910797 +< 4 -2 -2 >: 0.000649591126877968 0.023808608795096702 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 3 4 4 ) +l=( 4 4 4 ) +num_ms=25 +< -4 0 4 >: 0.000449825338994940 -0.008002256070840756 +< -4 1 3 >: -0.000711236310240683 0.012652677801883255 +< -4 2 2 >: 0.000403233085777721 -0.007173394046316527 +< -3 -1 4 >: -0.000355618155120342 0.006326338900941627 +< -3 0 3 >: 0.000674738008492410 -0.012003384106261129 +< -3 1 2 >: -0.000268822057185147 0.004782262697544351 +< -2 -2 4 >: 0.000403233085777720 -0.007173394046316526 +< -2 -1 3 >: -0.000134411028592573 0.002391131348772176 +< -2 0 2 >: -0.000353434194924595 0.006287486912803448 +< -2 1 1 >: 0.000304815561531721 -0.005422576200807108 +< -1 -3 4 >: -0.000355618155120341 0.006326338900941624 +< -1 -2 3 >: -0.000134411028592573 0.002391131348772175 +< -1 -1 2 >: 0.000304815561531721 -0.005422576200807109 +< -1 0 1 >: -0.000289173432211033 0.005144307474111914 +< 0 -4 4 >: 0.000224912669497470 -0.004001128035420377 +< 0 -3 3 >: 0.000337369004246205 -0.006001692053130567 +< 0 -2 2 >: -0.000176717097462298 0.003143743456401726 +< 0 -1 1 >: -0.000144586716105516 0.002572153737055957 +< 0 0 0 >: 0.000144586716105516 -0.002572153737055958 +< 1 -4 3 >: -0.000355618155120341 0.006326338900941624 +< 1 -3 2 >: -0.000134411028592573 0.002391131348772175 +< 1 -2 1 >: 0.000304815561531721 -0.005422576200807109 +< 2 -4 2 >: 0.000403233085777720 -0.007173394046316526 +< 2 -3 1 >: -0.000134411028592573 0.002391131348772176 +< 3 -4 1 >: -0.000355618155120342 0.006326338900941627 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 1 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: -0.157554155758129116 0.231164493466297694 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 1 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.184133567952436655 -0.154604107376737965 +< 1 -1 >: -0.368267135904873255 0.309208214753475874 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 1 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: -0.144488809584725070 -0.364079015494222169 +< 1 -1 >: 0.288977619169450195 0.728158030988444449 +< 2 -2 >: -0.288977619169450251 -0.728158030988444671 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 1 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: -0.089201606941624448 0.126277646492835266 +< 1 -1 >: 0.178403213883248896 -0.252555292985670532 +< 2 -2 >: -0.178403213883248868 0.252555292985670476 +< 3 -3 >: 0.178403213883248868 -0.252555292985670476 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 1 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: 0.031206805162126219 -0.074117671226575033 +< 1 -1 >: -0.062413610324252418 0.148235342453150010 +< 2 -2 >: 0.062413610324252418 -0.148235342453150010 +< 3 -3 >: -0.062413610324252418 0.148235342453150010 +< 4 -4 >: 0.062413610324252425 -0.148235342453150037 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 1 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.002505517869991374 -0.034819070698867929 +< 1 -1 >: -0.005011035739982747 0.069638141397735859 +< 2 -2 >: 0.005011035739982749 -0.069638141397735859 +< 3 -3 >: -0.005011035739982750 0.069638141397735873 +< 4 -4 >: 0.005011035739982749 -0.069638141397735859 +< 5 -5 >: -0.005011035739982743 0.069638141397735789 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 1 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: 0.011027347746966754 0.049545417789944347 +< 1 -1 >: -0.022054695493933515 -0.099090835579888722 +< 2 -2 >: 0.022054695493933504 0.099090835579888681 +< 3 -3 >: -0.022054695493933515 -0.099090835579888722 +< 4 -4 >: 0.022054695493933501 0.099090835579888667 +< 5 -5 >: -0.022054695493933504 -0.099090835579888681 +< 6 -6 >: 0.022054695493933490 0.099090835579888625 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.009881859225126983 -0.219792647952851444 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.038037296734070511 -0.051050933697750711 +< 1 -1 0 >: -0.076074593468141008 0.102101867395501394 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.023970409040645662 -0.097244131034850759 +< 1 -1 0 >: -0.047940818081291331 0.194488262069701517 +< 2 -2 0 >: 0.047940818081291338 -0.194488262069701573 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.004853574855062973 -0.030948741139870253 +< 0 1 -1 >: -0.005604425498205210 -0.035736528056368254 +< 1 -2 1 >: 0.003235716570041981 0.020632494093246825 +< 1 -1 0 >: 0.009151988514697448 0.058357505944504888 +< 1 0 -1 >: 0.007925854548871399 0.050539082649442610 +< 2 -2 0 >: -0.007235282206536331 -0.046135659337862796 +< 2 -1 -1 >: -0.010232234224080410 -0.065245675144630491 +< 3 -2 -1 >: 0.012531876388819979 0.079909306013867865 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.011630735346167934 0.003140347900163450 +< 1 -1 0 >: 0.023261470692335869 -0.006280695800326900 +< 2 -2 0 >: -0.023261470692335865 0.006280695800326899 +< 3 -3 0 >: 0.023261470692335865 -0.006280695800326899 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.002697459723056831 0.062847678113761199 +< 0 1 -1 >: -0.003303699961599229 0.076972371448698451 +< 1 -2 1 >: 0.002336068645852552 -0.054427685815384479 +< 1 -1 0 >: 0.005223608292232188 -0.121704005341200780 +< 1 0 -1 >: 0.004265058310713298 -0.099370904246300101 +< 2 -3 1 >: -0.001348729861528416 0.031423839056880606 +< 2 -2 0 >: -0.004672137291705105 0.108855371630768999 +< 2 -1 -1 >: -0.005223608292232189 0.121704005341200794 +< 3 -3 0 >: 0.003568403799410768 -0.083139663383424545 +< 3 -2 -1 >: 0.006180656682501273 -0.144002121104265135 +< 4 -3 -1 >: -0.007136807598821539 0.166279326766849145 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.001556648333714049 -0.001179970747050745 +< 1 -1 0 >: -0.003113296667428097 0.002359941494101490 +< 2 -2 0 >: 0.003113296667428097 -0.002359941494101490 +< 3 -3 0 >: -0.003113296667428097 0.002359941494101490 +< 4 -4 0 >: 0.003113296667428097 -0.002359941494101490 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 1 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.003147239138375993 -0.045268139294386202 +< 0 1 -1 >: -0.001723813869951654 0.024794381027821315 +< 0 2 -2 >: -0.007313522861677441 0.105193649760573202 +< 1 -3 2 >: 0.006118932231508618 -0.088011321799897457 +< 1 -2 1 >: 0.004906060282112865 -0.070566045499783847 +< 1 -1 0 >: -0.005350306535239187 0.076955836800456520 +< 1 0 -1 >: -0.001723813869951654 0.024794381027821315 +< 1 1 -2 >: 0.007709129987537763 -0.110883842876479149 +< 2 -4 2 >: -0.004079288154339078 0.058674214533264969 +< 2 -3 1 >: -0.007211230790867793 0.103722337443164808 +< 2 -2 0 >: 0.002517791310700795 -0.036214511435508967 +< 2 -1 -1 >: 0.004906060282112865 -0.070566045499783847 +< 2 0 -2 >: -0.007313522861677441 0.105193649760573202 +< 3 -4 1 >: 0.007631649327731125 -0.109769404110774904 +< 3 -3 0 >: 0.002203067396863194 -0.031687697506070325 +< 3 -2 -1 >: -0.007211230790867793 0.103722337443164808 +< 3 -1 -2 >: 0.006118932231508618 -0.088011321799897457 +< 4 -4 0 >: -0.008812269587452780 0.126750790024281357 +< 4 -3 -1 >: 0.007631649327731125 -0.109769404110774904 +< 4 -2 -2 >: -0.004079288154339078 0.058674214533264969 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.011930248142467558 0.034879821696619094 +< 1 -1 0 >: -0.023860496284935112 -0.069759643393238174 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.010800971050317396 -0.087271967525785019 +< 1 -1 0 >: -0.021601942100634795 0.174543935051570037 +< 2 -2 0 >: 0.021601942100634802 -0.174543935051570093 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.013126827675406438 0.050469449847610731 +< 0 1 -1 >: -0.015157554984003466 0.058277100910740717 +< 1 -2 1 >: 0.008751218450270956 -0.033646299898407145 +< 1 -1 0 >: 0.024752183639325697 -0.095166107279999773 +< 1 0 -1 >: 0.021436019830793605 -0.082416266483754982 +< 2 -2 0 >: -0.019568319340756223 0.075235413764182649 +< 2 -1 -1 >: -0.027673782604545193 0.106398942516058526 +< 3 -2 -1 >: 0.033893323316922491 -0.130311559168031166 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.024882056454765392 0.048496728546899577 +< 1 -1 0 >: -0.049764112909530783 -0.096993457093799154 +< 2 -2 0 >: 0.049764112909530776 0.096993457093799140 +< 3 -3 0 >: -0.049764112909530776 -0.096993457093799140 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000918343606543681 0.027461293300710472 +< 0 1 -1 >: 0.001124736622289629 0.033633078131825353 +< 1 -2 1 >: -0.000795308892669849 -0.023782177619190686 +< 1 -1 0 >: -0.001778364747119867 -0.053178565809484490 +< 1 0 -1 >: -0.001452028735665771 -0.043420117162084146 +< 2 -3 1 >: 0.000459171803271841 0.013730646650355239 +< 2 -2 0 >: 0.001590617785339699 0.047564355238381394 +< 2 -1 -1 >: 0.001778364747119867 0.053178565809484497 +< 3 -3 0 >: -0.001214854400510364 -0.036327876376941994 +< 3 -2 -1 >: -0.002104189545482582 -0.062921727615944750 +< 4 -3 -1 >: 0.002429708801020729 0.072655752753884015 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.009851657119976582 -0.006144135502695961 +< 1 -1 0 >: 0.019703314239953158 0.012288271005391916 +< 2 -2 0 >: -0.019703314239953158 -0.012288271005391916 +< 3 -3 0 >: 0.019703314239953158 0.012288271005391916 +< 4 -4 0 >: -0.019703314239953161 -0.012288271005391919 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 2 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.003578339080263088 -0.000467045563529370 +< 0 1 -1 >: 0.001959937032662382 0.000255811390527748 +< 0 2 -2 >: 0.008315308598965265 0.001085315813681586 +< 1 -3 2 >: -0.006957086313049306 -0.000908040357472688 +< 1 -2 1 >: -0.005578078584352461 -0.000728051980934257 +< 1 -1 0 >: 0.006083176436447249 0.000793977457999930 +< 1 0 -1 >: 0.001959937032662382 0.000255811390527748 +< 1 1 -2 >: -0.008765104873304628 -0.001144023317277582 +< 2 -4 2 >: 0.004638057542032871 0.000605360238315125 +< 2 -3 1 >: 0.008199004848762133 0.001070135823933324 +< 2 -2 0 >: -0.002862671264210471 -0.000373636450823496 +< 2 -1 -1 >: -0.005578078584352461 -0.000728051980934257 +< 2 0 -2 >: 0.008315308598965265 0.001085315813681586 +< 3 -4 1 >: -0.008677011131214942 -0.001132525303675511 +< 3 -3 0 >: -0.002504837356184161 -0.000326931894470559 +< 3 -2 -1 >: 0.008199004848762133 0.001070135823933324 +< 3 -1 -2 >: -0.006957086313049306 -0.000908040357472688 +< 4 -4 0 >: 0.010019349424736645 0.001307727577882237 +< 4 -3 -1 >: -0.008677011131214942 -0.001132525303675511 +< 4 -2 -2 >: 0.004638057542032871 0.000605360238315125 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.013468787859311522 -0.061572797573190549 +< 1 -1 0 >: -0.026937575718623038 0.123145595146381071 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.038797971985155805 0.053059172670396101 +< 1 -1 0 >: 0.077595943970311623 -0.106118345340792217 +< 2 -2 0 >: -0.077595943970311637 0.106118345340792244 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.036749560678448812 -0.103331079045556190 +< 0 1 -1 >: 0.042434737500605800 -0.119316452605212675 +< 1 -2 1 >: -0.024499707118965867 0.068887386030370770 +< 1 -1 0 >: -0.069295636163620417 0.194842951201162518 +< 1 0 -1 >: -0.060011781289098898 0.168738945488538378 +< 2 -2 0 >: 0.054783010546843217 -0.154036877956178458 +< 2 -1 -1 >: 0.077474876502973980 -0.217841041911236821 +< 3 -2 -1 >: -0.094886957658714105 0.266799698859387480 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.019572126169034785 0.084843622212785935 +< 1 -1 0 >: 0.039144252338069570 -0.169687244425571870 +< 2 -2 0 >: -0.039144252338069563 0.169687244425571870 +< 3 -3 0 >: 0.039144252338069563 -0.169687244425571870 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.005990785587919729 -0.048647248739531211 +< 0 1 -1 >: 0.007337183924411334 -0.059580468401051793 +< 1 -2 1 >: -0.005188172507764179 0.042129753232654540 +< 1 -1 0 >: -0.011601106406356261 0.094204992103507079 +< 1 0 -1 >: -0.009472263715768623 0.076918053958836927 +< 2 -3 1 >: 0.002995392793959865 -0.024323624369765609 +< 2 -2 0 >: 0.010376345015528362 -0.084259506465309109 +< 2 -1 -1 >: 0.011601106406356263 -0.094204992103507093 +< 3 -3 0 >: -0.007925064411772738 0.064354261066149970 +< 3 -2 -1 >: -0.013726614214446344 0.111464849850123462 +< 4 -3 -1 >: 0.015850128823545480 -0.128708522132299996 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.012567434723074462 -0.015502730665534242 +< 1 -1 0 >: -0.025134869446148917 0.031005461331068473 +< 2 -2 0 >: 0.025134869446148917 -0.031005461331068473 +< 3 -3 0 >: -0.025134869446148917 0.031005461331068473 +< 4 -4 0 >: 0.025134869446148921 -0.031005461331068480 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 3 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.002206809792468274 0.020213622302955207 +< 0 1 -1 >: -0.001208719503458168 -0.011071456904218091 +< 0 2 -2 >: -0.005128162544686243 -0.046972213527523406 +< 1 -3 2 >: 0.004290528610708245 0.039299773416302003 +< 1 -2 1 >: 0.003440076014876023 0.031509918750353257 +< 1 -1 0 >: -0.003751576647196064 -0.034363157915023847 +< 1 0 -1 >: -0.001208719503458168 -0.011071456904218091 +< 1 1 -2 >: 0.005405557950924511 0.049513060495582073 +< 2 -4 2 >: -0.002860352407138830 -0.026199848944201336 +< 2 -3 1 >: -0.005056436459177827 -0.046315227136269919 +< 2 -2 0 >: 0.001765447833974619 0.016170897842364168 +< 2 -1 -1 >: 0.003440076014876023 0.031509918750353257 +< 2 0 -2 >: -0.005128162544686243 -0.046972213527523406 +< 3 -4 1 >: 0.005351229356473814 0.049015429167216192 +< 3 -3 0 >: 0.001544766854727791 0.014149535612068638 +< 3 -2 -1 >: -0.005056436459177827 -0.046315227136269919 +< 3 -1 -2 >: 0.004290528610708245 0.039299773416302003 +< 4 -4 0 >: -0.006179067418911166 -0.056598142448274574 +< 4 -3 -1 >: 0.005351229356473814 0.049015429167216192 +< 4 -2 -2 >: -0.002860352407138830 -0.026199848944201336 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.059083716408346074 0.136148585985658210 +< 1 -1 0 >: 0.118167432816692133 -0.272297171971316365 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.009352930572533689 -0.044273101196926970 +< 1 -1 0 >: -0.018705861145067382 0.088546202393853954 +< 2 -2 0 >: 0.018705861145067386 -0.088546202393853982 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.026234572998636890 0.014909810897346160 +< 0 1 -1 >: -0.030293075565675776 0.017216366670298435 +< 1 -2 1 >: 0.017489715332424584 -0.009939873931564102 +< 1 -1 0 >: 0.049468385250319040 -0.028114209044593472 +< 1 0 -1 >: 0.042840878310971699 -0.024347619239924168 +< 2 -2 0 >: -0.039108192390421716 0.022226233798755431 +< 2 -1 -1 >: -0.055307336078430656 0.031432641278675205 +< 3 -2 -1 >: 0.067737376212388942 -0.038496966200349016 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.002524005065410506 -0.051232649910169847 +< 1 -1 0 >: -0.005048010130821012 0.102465299820339695 +< 2 -2 0 >: 0.005048010130821011 -0.102465299820339681 +< 3 -3 0 >: -0.005048010130821011 0.102465299820339681 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.005334637759604893 0.033713120893056552 +< 0 1 -1 >: -0.006533570236808009 0.041289971912375642 +< 1 -2 1 >: 0.004619931819805540 -0.029196419134242896 +< 1 -1 0 >: 0.010330481600499498 -0.065285177883742690 +< 1 0 -1 >: 0.008434802906144621 -0.053305124527334276 +< 2 -3 1 >: -0.002667318879802447 0.016856560446528279 +< 2 -2 0 >: -0.009239863639611084 0.058392838268485812 +< 2 -1 -1 >: -0.010330481600499500 0.065285177883742690 +< 3 -3 0 >: 0.007057062423264657 -0.044598266901441710 +< 3 -2 -1 >: 0.012223190669279531 -0.077246464202814460 +< 4 -3 -1 >: -0.014114124846529319 0.089196533802883449 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.003828032263925754 -0.011598754992030929 +< 1 -1 0 >: 0.007656064527851504 0.023197509984061851 +< 2 -2 0 >: -0.007656064527851504 -0.023197509984061851 +< 3 -3 0 >: 0.007656064527851504 0.023197509984061851 +< 4 -4 0 >: -0.007656064527851506 -0.023197509984061854 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 1 4 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.001401747909936194 0.010543239399376297 +< 0 1 -1 >: 0.000767768950207773 -0.005774770048215617 +< 0 2 -2 >: 0.003257367786458360 -0.024500274365317376 +< 1 -3 2 >: -0.002725309418649495 0.020498400200578571 +< 1 -2 1 >: -0.002185108739471674 0.016435283684473549 +< 1 -1 0 >: 0.002382971446891529 -0.017923506978939702 +< 1 0 -1 >: 0.000767768950207773 -0.005774770048215617 +< 1 1 -2 >: -0.003433567127356465 0.025825556764479719 +< 2 -4 2 >: 0.001816872945766330 -0.013665600133719048 +< 2 -3 1 >: 0.003211807951264375 -0.024157596308841317 +< 2 -2 0 >: -0.001121398327948955 0.008434591519501039 +< 2 -1 -1 >: -0.002185108739471674 0.016435283684473549 +< 2 0 -2 >: 0.003257367786458360 -0.024500274365317376 +< 3 -4 1 >: -0.003399058039178160 0.025565996842514420 +< 3 -3 0 >: -0.000981223536955335 0.007380267579563404 +< 3 -2 -1 >: 0.003211807951264375 -0.024157596308841317 +< 3 -1 -2 >: -0.002725309418649495 0.020498400200578571 +< 4 -4 0 >: 0.003924894147821343 -0.029521070318253628 +< 4 -3 -1 >: -0.003399058039178160 0.025565996842514420 +< 4 -2 -2 >: 0.001816872945766330 -0.013665600133719048 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 2 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.287026989817026290 -0.066729552024546113 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 2 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: -0.005767666807775936 -0.096451267935127302 +< 1 -1 >: 0.011535333615551870 0.192902535870254577 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 2 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: 0.057515597339940411 0.044271616939913321 +< 1 -1 >: -0.115031194679880835 -0.088543233879826655 +< 2 -2 >: 0.115031194679880863 0.088543233879826669 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 2 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: 0.032601265583660076 0.138180925507352059 +< 1 -1 >: -0.065202531167320152 -0.276361851014704119 +< 2 -2 >: 0.065202531167320138 0.276361851014704063 +< 3 -3 >: -0.065202531167320138 -0.276361851014704063 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 2 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: -0.020388227653746625 0.002279263934942535 +< 1 -1 >: 0.040776455307493235 -0.004558527869885069 +< 2 -2 >: -0.040776455307493235 0.004558527869885069 +< 3 -3 >: 0.040776455307493235 -0.004558527869885069 +< 4 -4 >: -0.040776455307493242 0.004558527869885070 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 2 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: -0.001555261349867393 0.025661933919382016 +< 1 -1 >: 0.003110522699734786 -0.051323867838764033 +< 2 -2 >: -0.003110522699734787 0.051323867838764047 +< 3 -3 >: 0.003110522699734787 -0.051323867838764053 +< 4 -4 >: -0.003110522699734787 0.051323867838764047 +< 5 -5 >: 0.003110522699734783 -0.051323867838763991 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 2 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: -0.005821332904486398 -0.127693554634757372 +< 1 -1 >: 0.011642665808972798 0.255387109269514800 +< 2 -2 >: -0.011642665808972795 -0.255387109269514689 +< 3 -3 >: 0.011642665808972798 0.255387109269514800 +< 4 -4 >: -0.011642665808972791 -0.255387109269514634 +< 5 -5 >: 0.011642665808972795 0.255387109269514689 +< 6 -6 >: -0.011642665808972788 -0.255387109269514578 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.018455587456866641 0.464400210681951586 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.000112749367497700 -0.063197505042209404 +< 1 -1 0 >: -0.000225498734995400 0.126395010084418780 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.024360220296848232 0.044872287240805497 +< 0 1 -1 >: 0.024360220296848228 0.044872287240805490 +< 1 -1 0 >: -0.042193139237711737 -0.077721081352899790 +< 1 0 -1 >: -0.042193139237711737 -0.077721081352899790 +< 2 -1 -1 >: 0.059670109749068327 0.109914207331573532 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.016306322357343566 0.094452916810822768 +< 1 -1 0 >: 0.032612644714687139 -0.188905833621645564 +< 2 -2 0 >: -0.032612644714687146 0.188905833621645619 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 2 2 2 ) +num_ms=10 +< 0 0 0 >: 0.003325328308296832 0.027448792220999947 +< 0 1 -1 >: -0.003325328308296832 -0.027448792220999947 +< 0 2 -2 >: -0.006650656616593668 -0.054897584441999929 +< 1 -2 1 >: 0.008145357582559630 0.067235534997126076 +< 1 -1 0 >: -0.003325328308296832 -0.027448792220999947 +< 1 0 -1 >: -0.003325328308296832 -0.027448792220999947 +< 1 1 -2 >: 0.008145357582559630 0.067235534997126076 +< 2 -2 0 >: -0.006650656616593664 -0.054897584441999894 +< 2 -1 -1 >: 0.008145357582559630 0.067235534997126076 +< 2 0 -2 >: -0.006650656616593668 -0.054897584441999929 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.016730983793628286 -0.003411413597293024 +< 0 1 -1 >: 0.019319275994117108 -0.003939161117428552 +< 1 -2 1 >: -0.011153989195752187 0.002274275731528682 +< 1 -1 0 >: -0.031548245590391440 0.006432623168207710 +< 1 0 -1 >: -0.027321582126109373 0.005570815076640215 +< 2 -2 0 >: 0.024941078062000105 -0.005085435135276196 +< 2 -1 -1 >: 0.035272010855486619 -0.007191891338876251 +< 3 -2 -1 >: -0.043199214398925684 0.008808232032894277 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.005652004549836375 -0.007069154502153570 +< 1 -1 0 >: -0.011304009099672749 0.014138309004307140 +< 2 -2 0 >: 0.011304009099672748 -0.014138309004307138 +< 3 -3 0 >: -0.011304009099672748 0.014138309004307138 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.022641065281083991 -0.011572589255505880 +< 0 1 -1 >: 0.030188087041445336 -0.015430119007341179 +< 0 2 -2 >: 0.007547021760361332 -0.003857529751835294 +< 1 -2 1 >: -0.016875653683838067 0.008625698750331610 +< 1 -1 0 >: -0.041336740601322496 0.021128560613274960 +< 1 0 -1 >: -0.041336740601322502 0.021128560613274963 +< 1 1 -2 >: -0.016875653683838067 0.008625698750331610 +< 2 -2 0 >: 0.029229489591344412 -0.014940148486357718 +< 2 -1 -1 >: 0.047731556627190558 -0.024397160315327248 +< 2 0 -2 >: 0.029229489591344422 -0.014940148486357724 +< 3 -2 -1 >: -0.044648782859086571 0.022821453777538071 +< 3 -1 -2 >: -0.044648782859086564 0.022821453777538067 +< 4 -2 -2 >: 0.063142914262771591 -0.032274409445265030 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000364239024064384 -0.000939032880186161 +< 0 1 -1 >: -0.000446099876683532 -0.001150075704076073 +< 1 -2 1 >: 0.000315440247889408 0.000813226329230084 +< 1 -1 0 >: 0.000705345837120102 0.001818429353251093 +< 1 0 -1 >: 0.000575912464380168 0.001484741349588133 +< 2 -3 1 >: -0.000182119512032192 -0.000469516440093080 +< 2 -2 0 >: -0.000630880495778817 -0.001626452658460169 +< 2 -1 -1 >: -0.000705345837120102 -0.001818429353251093 +< 3 -3 0 >: 0.000481842937729616 0.001242223736942646 +< 3 -2 -1 >: 0.000834576449415942 0.002151594626752740 +< 4 -3 -1 >: -0.000963685875459232 -0.002484447473885294 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.000635830977452394 0.048298488990391457 +< 0 1 -1 >: 0.000211943659150798 -0.016099496330130497 +< 0 2 -2 >: 0.001483605614055586 -0.112696474310913397 +< 0 3 -3 >: 0.000635830977452394 -0.048298488990391457 +< 1 -3 2 >: -0.001160863230370783 0.088180573044841046 +< 1 -2 1 >: -0.001198934388920157 0.091072504229785634 +< 1 -1 0 >: 0.000820854262225302 -0.062353081168922811 +< 1 0 -1 >: 0.000820854262225302 -0.062353081168922783 +< 1 1 -2 >: -0.001198934388920156 0.091072504229785620 +< 1 2 -3 >: -0.001160863230370783 0.088180573044841060 +< 2 -3 1 >: 0.001557461457413442 -0.118306653373890153 +< 2 -2 0 >: 0.000367097185991242 -0.027885145620054671 +< 2 -1 -1 >: -0.001340449397093820 0.101822155169468895 +< 2 0 -2 >: 0.000367097185991242 -0.027885145620054678 +< 2 1 -3 >: 0.001557461457413442 -0.118306653373890139 +< 3 -3 0 >: -0.001682250642210152 0.127785790568766905 +< 3 -2 -1 >: 0.000793020557841482 -0.060238799366972705 +< 3 -1 -2 >: 0.000793020557841482 -0.060238799366972691 +< 3 0 -3 >: -0.001682250642210152 0.127785790568766905 +< 4 -3 -1 >: 0.001373551897628060 -0.104336661090544638 +< 4 -2 -2 >: -0.001773247874888357 0.134698050267522212 +< 4 -1 -3 >: 0.001373551897628060 -0.104336661090544638 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.001729464105349662 -0.024105254666445555 +< 1 -1 0 >: 0.003458928210699323 0.048210509332891095 +< 2 -2 0 >: -0.003458928210699323 -0.048210509332891095 +< 3 -3 0 >: 0.003458928210699323 0.048210509332891095 +< 4 -4 0 >: -0.003458928210699323 -0.048210509332891102 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.001876784661961253 0.010877525676841630 +< 0 1 -1 >: 0.001027957294935886 -0.005957866183047810 +< 0 2 -2 >: 0.004361253444116070 -0.025277085476610721 +< 1 -3 2 >: -0.003648886422275981 0.021148327005565227 +< 1 -2 1 >: -0.002925617750444584 0.016956384419632271 +< 1 -1 0 >: 0.003190533925334130 -0.018491793650630767 +< 1 0 -1 >: 0.001027957294935886 -0.005957866183047810 +< 1 1 -2 >: -0.004597164778886885 0.026644387572284225 +< 2 -4 2 >: 0.002432590948183987 -0.014098884670376817 +< 2 -3 1 >: 0.004300253888284776 -0.024923542393976265 +< 2 -2 0 >: -0.001501427729569003 0.008702020541473307 +< 2 -1 -1 >: -0.002925617750444584 0.016956384419632271 +< 2 0 -2 >: 0.004361253444116070 -0.025277085476610721 +< 3 -4 1 >: -0.004550960945136021 0.026376597986094652 +< 3 -3 0 >: -0.001313749263372877 0.007614267973789138 +< 3 -2 -1 >: 0.004300253888284776 -0.024923542393976265 +< 3 -1 -2 >: -0.003648886422275981 0.021148327005565227 +< 4 -4 0 >: 0.005254997053491508 -0.030457071895156562 +< 4 -3 -1 >: -0.004550960945136021 0.026376597986094652 +< 4 -2 -2 >: 0.002432590948183987 -0.014098884670376817 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 1 ) +l=( 4 4 4 ) +num_ms=31 +< 0 0 0 >: 0.000655470119741609 -0.009793161264484037 +< 0 1 -1 >: -0.000655470119741609 0.009793161264484034 +< 0 2 -2 >: -0.000801130146350855 0.011969419323258259 +< 0 3 -3 >: 0.001529430279397088 -0.022850709617129407 +< 0 4 -4 >: 0.001019620186264725 -0.015233806411419609 +< 1 -4 3 >: -0.001612161068440831 0.024086762847081025 +< 1 -3 2 >: -0.000609339608639231 0.009103940625995212 +< 1 -2 1 >: 0.001381852344377855 -0.020645796726069452 +< 1 -1 0 >: -0.000655470119741609 0.009793161264484035 +< 1 0 -1 >: -0.000655470119741609 0.009793161264484034 +< 1 1 -2 >: 0.001381852344377855 -0.020645796726069445 +< 1 2 -3 >: -0.000609339608639231 0.009103940625995212 +< 1 3 -4 >: -0.001612161068440832 0.024086762847081028 +< 2 -4 2 >: 0.001828018825917694 -0.027311821877985636 +< 2 -3 1 >: -0.000609339608639231 0.009103940625995210 +< 2 -2 0 >: -0.000801130146350856 0.011969419323258268 +< 2 -1 -1 >: 0.001381852344377855 -0.020645796726069452 +< 2 0 -2 >: -0.000801130146350855 0.011969419323258259 +< 2 1 -3 >: -0.000609339608639231 0.009103940625995212 +< 2 2 -4 >: 0.001828018825917694 -0.027311821877985639 +< 3 -4 1 >: -0.001612161068440830 0.024086762847081014 +< 3 -3 0 >: 0.001529430279397088 -0.022850709617129417 +< 3 -2 -1 >: -0.000609339608639231 0.009103940625995210 +< 3 -1 -2 >: -0.000609339608639231 0.009103940625995212 +< 3 0 -3 >: 0.001529430279397088 -0.022850709617129407 +< 3 1 -4 >: -0.001612161068440832 0.024086762847081028 +< 4 -4 0 >: 0.001019620186264725 -0.015233806411419607 +< 4 -3 -1 >: -0.001612161068440830 0.024086762847081014 +< 4 -2 -2 >: 0.001828018825917694 -0.027311821877985636 +< 4 -1 -3 >: -0.001612161068440831 0.024086762847081025 +< 4 0 -4 >: 0.001019620186264725 -0.015233806411419609 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 2 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.003160276460310858 -0.290714607686225146 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.033165383753138482 -0.065714662622380016 +< 1 -1 0 >: 0.066330767506276950 0.131429325244760004 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.022326309815497613 0.053284706814357853 +< 1 -1 0 >: 0.044652619630995226 -0.106569413628715720 +< 2 -2 0 >: -0.044652619630995240 0.106569413628715748 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.005907741309733746 -0.106135249692557762 +< 0 1 -1 >: 0.006821672070954898 -0.122554429961012692 +< 1 -2 1 >: -0.003938494206489162 0.070756833128371818 +< 1 -1 0 >: -0.011139743844289673 0.200130546081426747 +< 1 0 -1 >: -0.009647301160806174 0.173318136979767723 +< 2 -2 0 >: 0.008806740774698863 -0.158217088747648532 +< 2 -1 -1 >: 0.012454612243883268 -0.223752752706112140 +< 3 -2 -1 >: -0.015253722470866923 0.274040036336561321 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.010723934618256343 0.042211665913045954 +< 1 -1 0 >: 0.021447869236512686 -0.084423331826091907 +< 2 -2 0 >: -0.021447869236512682 0.084423331826091894 +< 3 -3 0 >: 0.021447869236512682 -0.084423331826091894 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000392382834446121 0.002302098388691950 +< 0 1 -1 >: 0.000480568864109982 0.002819483194989307 +< 1 -2 1 >: -0.000339813502639284 -0.001993675686618451 +< 1 -1 0 >: -0.000759846091573744 -0.004457994360367426 +< 1 0 -1 >: -0.000620411735801258 -0.003639937153035087 +< 2 -3 1 >: 0.000196191417223061 0.001151049194345975 +< 2 -2 0 >: 0.000679627005278569 0.003987351373236904 +< 2 -1 -1 >: 0.000759846091573744 0.004457994360367427 +< 3 -3 0 >: -0.000519073699337532 -0.003045389915040704 +< 3 -2 -1 >: -0.000899062020125338 -0.005274770061708367 +< 4 -3 -1 >: 0.001038147398675065 0.006090779830081409 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.009590808832438397 0.015162806903201789 +< 1 -1 0 >: -0.019181617664876787 -0.030325613806403567 +< 2 -2 0 >: 0.019181617664876787 0.030325613806403567 +< 3 -3 0 >: -0.019181617664876787 -0.030325613806403567 +< 4 -4 0 >: 0.019181617664876791 0.030325613806403574 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 2 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.002321808667863386 0.034548359254821651 +< 0 1 -1 >: -0.001271706981599796 -0.018922915688658188 +< 0 2 -2 >: -0.005395395782228952 -0.080283132019629097 +< 1 -3 2 >: 0.004514111978321516 0.067169687365781591 +< 1 -2 1 >: 0.003619341520373877 0.053855562192744191 +< 1 -1 0 >: -0.003947074735367755 -0.058732210733196795 +< 1 0 -1 >: -0.001271706981599796 -0.018922915688658188 +< 1 1 -2 >: 0.005687246516636438 0.084625851624673926 +< 2 -4 2 >: -0.003009407985547677 -0.044779791577187721 +< 2 -3 1 >: -0.005319931984844275 -0.079160235710874188 +< 2 -2 0 >: 0.001857446934290709 0.027638687403857328 +< 2 -1 -1 >: 0.003619341520373877 0.053855562192744191 +< 2 0 -2 >: -0.005395395782228952 -0.080283132019629097 +< 3 -4 1 >: 0.005630086809470477 0.083775318966490986 +< 3 -3 0 >: 0.001625266067504369 0.024183851478375144 +< 3 -2 -1 >: -0.005319931984844275 -0.079160235710874188 +< 3 -1 -2 >: 0.004514111978321516 0.067169687365781591 +< 4 -4 0 >: -0.006501064270017480 -0.096735405913500619 +< 4 -3 -1 >: 0.005630086809470477 0.083775318966490986 +< 4 -2 -2 >: -0.003009407985547677 -0.044779791577187721 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.047209873545272368 0.112362011082415572 +< 1 -1 0 >: -0.094419747090544723 -0.224724022164831116 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.055540104125378409 -0.064077659113268695 +< 1 -1 0 >: -0.111080208250756832 0.128155318226537418 +< 2 -2 0 >: 0.111080208250756859 -0.128155318226537446 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.026824954147321351 0.039363876600757679 +< 0 1 -1 >: -0.030974788995910687 0.045453489503589295 +< 1 -2 1 >: 0.017883302764880895 -0.026242584400505111 +< 1 -1 0 >: 0.050581618620237676 -0.074225237541829914 +< 1 0 -1 >: 0.043804966689661794 -0.064280941313159104 +< 2 -2 0 >: -0.039988280644483627 0.058680202624805007 +< 2 -1 -1 >: -0.056551968823410272 0.082986338394800518 +< 3 -2 -1 >: 0.069261733783568757 -0.101637092344598848 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.009447121937352258 -0.102258967371407938 +< 1 -1 0 >: -0.018894243874704515 0.204517934742815877 +< 2 -2 0 >: 0.018894243874704512 -0.204517934742815849 +< 3 -3 0 >: -0.018894243874704512 0.204517934742815849 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000656854021824935 -0.027812928638570465 +< 0 1 -1 >: -0.000804478594483028 -0.034063741708469431 +< 1 -2 1 >: 0.000568852269478372 0.024086702754645764 +< 1 -1 0 >: 0.001271992343708669 0.053859504713219375 +< 1 0 -1 >: 0.001038577399604373 0.043976101448804351 +< 2 -3 1 >: -0.000328427010912468 -0.013906464319285236 +< 2 -2 0 >: -0.001137704538956744 -0.048173405509291549 +< 2 -1 -1 >: -0.001271992343708669 -0.053859504713219382 +< 3 -3 0 >: 0.000868936194710686 0.036793046205021850 +< 3 -2 -1 >: 0.001505041637774471 0.063727425392327133 +< 4 -3 -1 >: -0.001737872389421372 -0.073586092410043727 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.012398524780334092 0.043462566869807581 +< 1 -1 0 >: 0.024797049560668173 -0.086925133739615135 +< 2 -2 0 >: -0.024797049560668173 0.086925133739615135 +< 3 -3 0 >: 0.024797049560668173 -0.086925133739615135 +< 4 -4 0 >: -0.024797049560668180 0.086925133739615149 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 3 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.001535119704393886 -0.049500517208194067 +< 0 1 -1 >: 0.000840819690567194 0.027112549883100540 +< 0 2 -2 >: 0.003567295829731425 0.115028807265593586 +< 1 -3 2 >: -0.002984613823557992 -0.096240004939014620 +< 1 -2 1 >: -0.002393014791339294 -0.077163669724976694 +< 1 -1 0 >: 0.002609703497469606 0.084150879253929903 +< 1 0 -1 >: 0.000840819690567194 0.027112549883100540 +< 1 1 -2 >: -0.003760259969857169 -0.121251009163933582 +< 2 -4 2 >: 0.001989742549038661 0.064160003292676404 +< 2 -3 1 >: 0.003517401123101609 0.113419933523006736 +< 2 -2 0 >: -0.001228095763515109 -0.039600413766555265 +< 2 -1 -1 >: -0.002393014791339294 -0.077163669724976694 +< 2 0 -2 >: 0.003567295829731425 0.115028807265593586 +< 3 -4 1 >: -0.003722467453194459 -0.120032375127741550 +< 3 -3 0 >: -0.001074583793075720 -0.034650362045735836 +< 3 -2 -1 >: 0.003517401123101609 0.113419933523006736 +< 3 -1 -2 >: -0.002984613823557992 -0.096240004939014620 +< 4 -4 0 >: 0.004298335172302881 0.138601448182943371 +< 4 -3 -1 >: -0.003722467453194459 -0.120032375127741550 +< 4 -2 -2 >: 0.001989742549038661 0.064160003292676404 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.014680923368191412 -0.058637077745640601 +< 1 -1 0 >: 0.029361846736382816 0.117274155491281173 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.021502947095046354 0.082736453508225102 +< 1 -1 0 >: 0.043005894190092715 -0.165472907016450232 +< 2 -2 0 >: -0.043005894190092729 0.165472907016450260 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.020176428560983086 0.043726297438351325 +< 0 1 -1 >: 0.023297732921937667 0.050490779193395542 +< 1 -2 1 >: -0.013450952373988719 -0.029150864958900874 +< 1 -1 0 >: -0.038045038548258865 -0.082451097159568484 +< 1 0 -1 >: -0.032947969870750403 -0.071404744710085261 +< 2 -2 0 >: 0.030077243870350958 0.065183315651018980 +< 2 -1 -1 >: 0.042535646200253359 0.092183129034117475 +< 3 -2 -1 >: -0.052095314535087429 -0.112900814513364450 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.002654179181349309 0.065491871130055904 +< 1 -1 0 >: 0.005308358362698618 -0.130983742260111807 +< 2 -2 0 >: -0.005308358362698617 0.130983742260111780 +< 3 -3 0 >: 0.005308358362698617 -0.130983742260111780 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000529039402438292 0.014985092581065959 +< 0 1 -1 >: 0.000647938294900369 0.018352915285988685 +< 1 -2 1 >: -0.000458161562114500 -0.012977470853264844 +< 1 -1 0 >: -0.001024480397565514 -0.029018507003922393 +< 1 0 -1 >: -0.000836484741839719 -0.023693511752329897 +< 2 -3 1 >: 0.000264519701219146 0.007492546290532981 +< 2 -2 0 >: 0.000916323124229000 0.025954941706529698 +< 2 -1 -1 >: 0.001024480397565514 0.029018507003922396 +< 3 -3 0 >: -0.000699853346302969 -0.019823414171389764 +< 3 -2 -1 >: -0.001212181553643839 -0.034335160524327980 +< 4 -3 -1 >: 0.001399706692605938 0.039646828342779543 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.004087506620450706 -0.024883374261687737 +< 1 -1 0 >: -0.008175013240901408 0.049766748523375461 +< 2 -2 0 >: 0.008175013240901408 -0.049766748523375461 +< 3 -3 0 >: -0.008175013240901408 0.049766748523375461 +< 4 -4 0 >: 0.008175013240901410 -0.049766748523375468 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 2 4 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.001167370367493290 0.009436401675653811 +< 0 1 -1 >: -0.000639395083239171 -0.005168530059435140 +< 0 2 -2 >: -0.002712723595294528 -0.021928215922758586 +< 1 -3 2 >: 0.002269627395218733 0.018346461715780141 +< 1 -2 1 >: 0.001819750308973858 0.014709894428574443 +< 1 -1 0 >: -0.001984529624738593 -0.016041882848611477 +< 1 0 -1 >: -0.000639395083239171 -0.005168530059435140 +< 1 1 -2 >: 0.002859461741203844 0.023114369113296007 +< 2 -4 2 >: -0.001513084930145822 -0.012230974477186761 +< 2 -3 1 >: -0.002674781536543210 -0.021621512483345859 +< 2 -2 0 >: 0.000933896293994632 0.007549121340523051 +< 2 -1 -1 >: 0.001819750308973858 0.014709894428574443 +< 2 0 -2 >: -0.002712723595294528 -0.021928215922758586 +< 3 -4 1 >: 0.002830722702848224 0.022882058000004694 +< 3 -3 0 >: 0.000817159257245303 0.006605481172957665 +< 3 -2 -1 >: -0.002674781536543210 -0.021621512483345859 +< 3 -1 -2 >: 0.002269627395218733 0.018346461715780141 +< 4 -4 0 >: -0.003268637028981213 -0.026421924691830669 +< 4 -3 -1 >: 0.002830722702848224 0.022882058000004694 +< 4 -2 -2 >: -0.001513084930145822 -0.012230974477186761 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 3 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: -0.245281708527948977 0.559268363567744231 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 3 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: -0.145119885809440269 -0.061365845190963948 +< 1 -1 >: 0.290239771618880482 0.122731690381927869 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 3 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: -0.090566246377035614 -0.084976941526146571 +< 1 -1 >: 0.181132492754071256 0.169953883052293142 +< 2 -2 >: -0.181132492754071284 -0.169953883052293198 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 3 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: -0.051110005163533430 -0.022849868411288696 +< 1 -1 >: 0.102220010327066860 0.045699736822577393 +< 2 -2 >: -0.102220010327066846 -0.045699736822577386 +< 3 -3 >: 0.102220010327066846 0.045699736822577386 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 3 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: 0.008081311756303928 0.040428258540914440 +< 1 -1 >: -0.016162623512607849 -0.080856517081828852 +< 2 -2 >: 0.016162623512607849 0.080856517081828852 +< 3 -3 >: -0.016162623512607849 -0.080856517081828852 +< 4 -4 >: 0.016162623512607853 0.080856517081828866 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 3 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.000042027964679000 0.000652235133231223 +< 1 -1 >: -0.000084055929358001 -0.001304470266462445 +< 2 -2 >: 0.000084055929358001 0.001304470266462445 +< 3 -3 >: -0.000084055929358001 -0.001304470266462446 +< 4 -4 >: 0.000084055929358001 0.001304470266462445 +< 5 -5 >: -0.000084055929358001 -0.001304470266462444 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 3 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: -0.011536460262933116 0.013132408814001066 +< 1 -1 >: 0.023072920525866240 -0.026264817628002136 +< 2 -2 >: -0.023072920525866229 0.026264817628002125 +< 3 -3 >: 0.023072920525866240 -0.026264817628002136 +< 4 -4 >: -0.023072920525866226 0.026264817628002122 +< 5 -5 >: 0.023072920525866229 -0.026264817628002125 +< 6 -6 >: -0.023072920525866215 0.026264817628002111 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.005191241746347684 -0.155144029183842513 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.049017226878351014 -0.126224630147017125 +< 1 -1 0 >: 0.098034453756702014 0.252449260294034195 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.006085618806556616 -0.014309749310589969 +< 0 1 -1 >: 0.006085618806556615 -0.014309749310589965 +< 1 -1 0 >: -0.010540600968452734 0.024785212849515542 +< 1 0 -1 >: -0.010540600968452734 0.024785212849515542 +< 2 -1 -1 >: 0.014906660845148835 -0.035051584158088782 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.007027679783514151 0.021483606466834285 +< 1 -1 0 >: -0.014055359567028304 -0.042967212933668578 +< 2 -2 0 >: 0.014055359567028308 0.042967212933668592 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 2 2 2 ) +num_ms=10 +< 0 0 0 >: -0.032375079188961889 -0.054437665386157477 +< 0 1 -1 >: 0.032375079188961889 0.054437665386157477 +< 0 2 -2 >: 0.064750158377923819 0.108875330772315024 +< 1 -2 1 >: -0.079302424395155294 -0.133344502984455632 +< 1 -1 0 >: 0.032375079188961889 0.054437665386157477 +< 1 0 -1 >: 0.032375079188961889 0.054437665386157477 +< 1 1 -2 >: -0.079302424395155294 -0.133344502984455632 +< 2 -2 0 >: 0.064750158377923778 0.108875330772314954 +< 2 -1 -1 >: -0.079302424395155294 -0.133344502984455632 +< 2 0 -2 >: 0.064750158377923819 0.108875330772315024 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.016301924233295455 0.035769565686963475 +< 0 1 -1 >: -0.018823840688804019 0.041303136756328712 +< 1 -2 1 >: 0.010867949488863632 -0.023846377124642309 +< 1 -1 0 >: 0.030739203124673396 -0.067447739886265387 +< 1 0 -1 >: 0.026620930798057146 -0.058411456169350749 +< 2 -2 0 >: -0.024301473833133178 0.053322120267796189 +< 2 -1 -1 >: -0.034367473880471823 0.075408865657206656 +< 3 -2 -1 >: 0.042091387377792257 -0.092356621471121184 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.005810194013240329 0.019740242534463631 +< 1 -1 0 >: 0.011620388026480659 -0.039480485068927262 +< 2 -2 0 >: -0.011620388026480657 0.039480485068927255 +< 3 -3 0 >: 0.011620388026480657 -0.039480485068927255 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.030395364395211857 0.083940308665567717 +< 0 1 -1 >: -0.040527152526949155 0.111920411554090327 +< 0 2 -2 >: -0.010131788131737287 0.027980102888522575 +< 1 -2 1 >: 0.022655366996190168 -0.062565412076174706 +< 1 -1 0 >: 0.055494089076156355 -0.153253335133592711 +< 1 0 -1 >: 0.055494089076156362 -0.153253335133592739 +< 1 1 -2 >: 0.022655366996190168 -0.062565412076174706 +< 2 -2 0 >: -0.039240246701520459 0.108366472512417947 +< 2 -1 -1 >: -0.064079054533103891 0.176961708587175387 +< 2 0 -2 >: -0.039240246701520473 0.108366472512417988 +< 3 -2 -1 >: 0.059940466932819618 -0.165532521027835638 +< 3 -1 -2 >: 0.059940466932819611 -0.165532521027835638 +< 4 -2 -2 >: -0.084768621271369513 0.234098336251374661 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000060364084857908 -0.033485278125448638 +< 0 1 -1 >: -0.000073930603345969 -0.041010922651264187 +< 1 -2 1 >: 0.000052276830963148 0.028999101509425890 +< 1 -1 0 >: 0.000116894547681864 0.064843962261493054 +< 1 0 -1 >: 0.000095443998511335 0.052944873480315562 +< 2 -3 1 >: -0.000030182042428954 -0.016742639062724322 +< 2 -2 0 >: -0.000104553661926296 -0.057998203018851800 +< 2 -1 -1 >: -0.000116894547681864 -0.064843962261493068 +< 3 -3 0 >: 0.000079854178327012 0.044296859250884099 +< 3 -2 -1 >: 0.000138311494059050 0.076724410838258719 +< 4 -3 -1 >: -0.000159708356654024 -0.088593718501768226 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.000233797391050202 0.009216789555698943 +< 0 1 -1 >: -0.000077932463683401 -0.003072263185232983 +< 0 2 -2 >: -0.000545527245783804 -0.021505842296630866 +< 0 3 -3 >: -0.000233797391050202 -0.009216789555698943 +< 1 -3 2 >: 0.000426853683213507 0.016827478491447757 +< 1 -2 1 >: 0.000440852588360856 0.017379345054944186 +< 1 -1 0 >: -0.000301831133974725 -0.011898824151573490 +< 1 0 -1 >: -0.000301831133974725 -0.011898824151573485 +< 1 1 -2 >: 0.000440852588360855 0.017379345054944182 +< 1 2 -3 >: 0.000426853683213507 0.016827478491447761 +< 2 -3 1 >: -0.000572684311266937 -0.022576431478075691 +< 2 -2 0 >: -0.000134982986658666 -0.005321315931046913 +< 2 -1 -1 >: 0.000492888177815803 0.019430698473640005 +< 2 0 -2 >: -0.000134982986658666 -0.005321315931046914 +< 2 1 -3 >: -0.000572684311266937 -0.022576431478075688 +< 3 -3 0 >: 0.000618569753894552 0.024385333050796903 +< 3 -2 -1 >: -0.000291596578410488 -0.011495356241140623 +< 3 -1 -2 >: -0.000291596578410488 -0.011495356241140621 +< 3 0 -3 >: 0.000618569753894553 0.024385333050796907 +< 4 -3 -1 >: -0.000505060089120207 -0.019910541060759547 +< 4 -2 -2 >: 0.000652029771332198 0.025704397980766888 +< 4 -1 -3 >: -0.000505060089120207 -0.019910541060759547 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.000558486550436971 0.001763741065189403 +< 1 -1 0 >: -0.001116973100873941 -0.003527482130378805 +< 2 -2 0 >: 0.001116973100873941 0.003527482130378805 +< 3 -3 0 >: -0.001116973100873941 -0.003527482130378805 +< 4 -4 0 >: 0.001116973100873941 0.003527482130378806 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.000216751494657636 -0.018274738668965874 +< 0 1 -1 >: 0.000118719682996948 0.010009486601504544 +< 0 2 -2 >: 0.000503684957444755 0.042466655112718528 +< 1 -3 2 >: -0.000421413069860543 -0.035530152793420526 +< 1 -2 1 >: -0.000337882141227168 -0.028487498282723286 +< 1 -1 0 >: 0.000368477540917981 0.031067055737241982 +< 1 0 -1 >: 0.000118719682996948 0.010009486601504544 +< 1 1 -2 >: -0.000530930562896803 -0.044763784921675029 +< 2 -4 2 >: 0.000280942046573695 0.023686768528947015 +< 2 -3 1 >: 0.000496640065631717 0.041872686628036337 +< 2 -2 0 >: -0.000173401195726109 -0.014619790935172704 +< 2 -1 -1 >: -0.000337882141227168 -0.028487498282723286 +< 2 0 -2 >: 0.000503684957444755 0.042466655112718528 +< 3 -4 1 >: -0.000525594441908928 -0.044313886217569563 +< 3 -3 0 >: -0.000151726046260345 -0.012792317068276108 +< 3 -2 -1 >: 0.000496640065631717 0.041872686628036337 +< 3 -1 -2 >: -0.000421413069860543 -0.035530152793420526 +< 4 -4 0 >: 0.000606904185041381 0.051169268273104446 +< 4 -3 -1 >: -0.000525594441908928 -0.044313886217569563 +< 4 -2 -2 >: 0.000280942046573695 0.023686768528947015 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 1 ) +l=( 4 4 4 ) +num_ms=31 +< 0 0 0 >: -0.000325122105032178 0.005743213611392538 +< 0 1 -1 >: 0.000325122105032178 -0.005743213611392535 +< 0 2 -2 >: 0.000397371461705995 -0.007019483302813096 +< 0 3 -3 >: -0.000758618245075082 0.013400831759915913 +< 0 4 -4 >: -0.000505745496716721 0.008933887839943946 +< 1 -4 3 >: 0.000799653842999024 -0.014125716967352335 +< 1 -3 2 >: 0.000302240743358929 -0.005339019169442825 +< 1 -2 1 >: -0.000685417579713449 0.012107757400587716 +< 1 -1 0 >: 0.000325122105032178 -0.005743213611392537 +< 1 0 -1 >: 0.000325122105032178 -0.005743213611392535 +< 1 1 -2 >: -0.000685417579713449 0.012107757400587714 +< 1 2 -3 >: 0.000302240743358929 -0.005339019169442825 +< 1 3 -4 >: 0.000799653842999024 -0.014125716967352337 +< 2 -4 2 >: -0.000906722230076788 0.016017057508328471 +< 2 -3 1 >: 0.000302240743358929 -0.005339019169442823 +< 2 -2 0 >: 0.000397371461705995 -0.007019483302813102 +< 2 -1 -1 >: -0.000685417579713449 0.012107757400587716 +< 2 0 -2 >: 0.000397371461705995 -0.007019483302813096 +< 2 1 -3 >: 0.000302240743358929 -0.005339019169442825 +< 2 2 -4 >: -0.000906722230076788 0.016017057508328474 +< 3 -4 1 >: 0.000799653842999024 -0.014125716967352328 +< 3 -3 0 >: -0.000758618245075082 0.013400831759915919 +< 3 -2 -1 >: 0.000302240743358929 -0.005339019169442823 +< 3 -1 -2 >: 0.000302240743358929 -0.005339019169442825 +< 3 0 -3 >: -0.000758618245075082 0.013400831759915913 +< 3 1 -4 >: 0.000799653842999024 -0.014125716967352337 +< 4 -4 0 >: -0.000505745496716721 0.008933887839943944 +< 4 -3 -1 >: 0.000799653842999024 -0.014125716967352328 +< 4 -2 -2 >: -0.000906722230076788 0.016017057508328471 +< 4 -1 -3 >: 0.000799653842999024 -0.014125716967352335 +< 4 0 -4 >: -0.000505745496716721 0.008933887839943946 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.018778803118206799 0.097831166433084232 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.080195260248957248 0.231864109412112884 +< 1 -1 0 >: -0.160390520497914441 -0.463728218824225658 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.003623467502519982 0.019712479171376876 +< 0 1 -1 >: -0.003623467502519981 0.019712479171376873 +< 1 -1 0 >: 0.006276029813939318 -0.034143015467967990 +< 1 0 -1 >: 0.006276029813939318 -0.034143015467967990 +< 2 -1 -1 >: -0.008875646480730874 0.048285515535114697 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.033924763634886182 0.146941163170304895 +< 1 -1 0 >: -0.067849527269772378 -0.293882326340609790 +< 2 -2 0 >: 0.067849527269772392 0.293882326340609901 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 2 2 2 ) +num_ms=10 +< 0 0 0 >: 0.039246049473245823 0.031493586671176986 +< 0 1 -1 >: -0.039246049473245823 -0.031493586671176986 +< 0 2 -2 >: -0.078492098946491701 -0.062987173342354014 +< 1 -2 1 >: 0.096132795629476825 0.077143217514501067 +< 1 -1 0 >: -0.039246049473245823 -0.031493586671176986 +< 1 0 -1 >: -0.039246049473245823 -0.031493586671176986 +< 1 1 -2 >: 0.096132795629476825 0.077143217514501067 +< 2 -2 0 >: -0.078492098946491645 -0.062987173342353972 +< 2 -1 -1 >: 0.096132795629476825 0.077143217514501067 +< 2 0 -2 >: -0.078492098946491701 -0.062987173342354014 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.000626888692694647 0.032468049842558626 +< 0 1 -1 >: 0.000723868710958374 0.037490874633326801 +< 1 -2 1 >: -0.000417925795129765 -0.021645366561705744 +< 1 -1 0 >: -0.001182072655076146 -0.061222341908202721 +< 1 0 -1 >: -0.001023704948414863 -0.053020103371680199 +< 2 -2 0 >: 0.000934510487460805 0.048400511029874950 +< 2 -1 -1 >: 0.001321597405546962 0.068448659124237726 +< 3 -2 -1 >: -0.001618619644488072 -0.083832144216041252 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.012528122968272454 -0.115052983924417720 +< 1 -1 0 >: -0.025056245936544909 0.230105967848835441 +< 2 -2 0 >: 0.025056245936544905 -0.230105967848835413 +< 3 -3 0 >: -0.025056245936544905 0.230105967848835413 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.039041347200888643 -0.011178525647991046 +< 0 1 -1 >: 0.052055129601184878 -0.014904700863988067 +< 0 2 -2 >: 0.013013782400296216 -0.003726175215997016 +< 1 -2 1 >: -0.029099702091452719 0.008331981079044289 +< 1 -1 0 >: -0.071279421791059630 0.020409102190182504 +< 1 0 -1 >: -0.071279421791059644 0.020409102190182507 +< 1 1 -2 >: -0.029099702091452719 0.008331981079044289 +< 2 -2 0 >: 0.050402162507514413 -0.014431414556607262 +< 2 -1 -1 >: 0.082306386717498320 -0.023566401286840899 +< 2 0 -2 >: 0.050402162507514434 -0.014431414556607267 +< 3 -2 -1 >: -0.076990574960050073 0.022044349863646801 +< 3 -1 -2 >: -0.076990574960050059 0.022044349863646798 +< 4 -2 -2 >: 0.108881115283405189 -0.031175418550866783 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000437096148983159 0.014621722902882639 +< 0 1 -1 >: -0.000535331266772138 0.017907880136214450 +< 1 -2 1 >: 0.000378536368915764 -0.012662783480993112 +< 1 -1 0 >: 0.000846433052851586 -0.028314844647862016 +< 1 0 -1 >: 0.000691109693637537 -0.023118973844479050 +< 2 -3 1 >: -0.000218548074491580 0.007310861451441321 +< 2 -2 0 >: -0.000757072737831527 0.025325566961986231 +< 2 -1 -1 >: -0.000846433052851586 0.028314844647862020 +< 3 -3 0 >: 0.000578223854616738 -0.019342721270162445 +< 3 -2 -1 >: 0.001001513094344511 -0.033502575996564574 +< 4 -3 -1 >: -0.001156447709233477 0.038685442540324903 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.000448111692132453 0.025490836760937236 +< 0 1 -1 >: 0.000149370564044151 -0.008496945586979086 +< 0 2 -2 >: 0.001045593948309058 -0.059478619108853555 +< 0 3 -3 >: 0.000448111692132453 -0.025490836760937236 +< 1 -3 2 >: -0.000818136273542517 0.046539687678824153 +< 1 -2 1 >: -0.000844967509962230 0.048065982751408137 +< 1 -1 0 >: 0.000578509706956606 -0.032908528752000586 +< 1 0 -1 >: 0.000578509706956606 -0.032908528752000572 +< 1 1 -2 >: -0.000844967509962230 0.048065982751408130 +< 1 2 -3 >: -0.000818136273542517 0.046539687678824160 +< 2 -3 1 >: 0.001097644993499658 -0.062439543180876148 +< 2 -2 0 >: 0.000258717406079691 -0.014717141465795915 +< 2 -1 -1 >: -0.000944702395527139 0.053739402418740478 +< 2 0 -2 >: 0.000258717406079691 -0.014717141465795919 +< 2 1 -3 >: 0.001097644993499658 -0.062439543180876141 +< 3 -3 0 >: -0.001185592096962811 0.067442414780383153 +< 3 -2 -1 >: 0.000558893474322388 -0.031792659220536520 +< 3 -1 -2 >: 0.000558893474322388 -0.031792659220536514 +< 3 0 -3 >: -0.001185592096962811 0.067442414780383167 +< 4 -3 -1 >: 0.000968031893545068 -0.055066501077692384 +< 4 -2 -2 >: -0.001249723800765893 0.071090547202605103 +< 4 -1 -3 >: 0.000968031893545068 -0.055066501077692384 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.002688524825348421 -0.031280983902182924 +< 1 -1 0 >: 0.005377049650696841 0.062561967804365820 +< 2 -2 0 >: -0.005377049650696841 -0.062561967804365820 +< 3 -3 0 >: 0.005377049650696841 0.062561967804365820 +< 4 -4 0 >: -0.005377049650696842 -0.062561967804365834 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: 0.000415328282348928 -0.007188021197386673 +< 0 1 -1 >: -0.000227484669012383 0.003937041353633975 +< 0 2 -2 >: -0.000965135712447799 0.016703451833798691 +< 1 -3 2 >: 0.000807490470785560 -0.013975110454476670 +< 1 -2 1 >: 0.000647432718163791 -0.011205016127780219 +< 1 -1 0 >: -0.000706058079993178 0.012219636035557343 +< 1 0 -1 >: -0.000227484669012383 0.003937041353633975 +< 1 1 -2 >: 0.001017342367501456 -0.017606984193906716 +< 2 -4 2 >: -0.000538326980523707 0.009316740302984447 +< 2 -3 1 >: -0.000951636646059978 0.016469825616985775 +< 2 -2 0 >: 0.000332262625879143 -0.005750416957909340 +< 2 -1 -1 >: 0.000647432718163791 -0.011205016127780219 +< 2 0 -2 >: -0.000965135712447799 0.016703451833798691 +< 3 -4 1 >: 0.001007117561588119 -0.017430025087658122 +< 3 -3 0 >: 0.000290729797644250 -0.005031614838170669 +< 3 -2 -1 >: -0.000951636646059978 0.016469825616985775 +< 3 -1 -2 >: 0.000807490470785560 -0.013975110454476670 +< 4 -4 0 >: -0.001162919190577000 0.020126459352682684 +< 4 -3 -1 >: 0.001007117561588119 -0.017430025087658122 +< 4 -2 -2 >: -0.000538326980523707 0.009316740302984447 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 2 ) +l=( 4 4 4 ) +num_ms=31 +< 0 0 0 >: 0.000303706996230653 -0.002598029442864748 +< 0 1 -1 >: -0.000303706996230653 0.002598029442864747 +< 0 2 -2 >: -0.000371197439837464 0.003175369319056911 +< 0 3 -3 >: 0.000708649657871523 -0.006062068700017741 +< 0 4 -4 >: 0.000472433105247682 -0.004041379133345162 +< 1 -4 3 >: -0.000746982327324361 0.006389981474824025 +< 1 -3 2 >: -0.000282332781694358 0.002415185980670587 +< 1 -2 1 >: 0.000640270566278024 -0.005477126978420593 +< 1 -1 0 >: -0.000303706996230653 0.002598029442864747 +< 1 0 -1 >: -0.000303706996230653 0.002598029442864747 +< 1 1 -2 >: 0.000640270566278024 -0.005477126978420592 +< 1 2 -3 >: -0.000282332781694358 0.002415185980670587 +< 1 3 -4 >: -0.000746982327324361 0.006389981474824026 +< 2 -4 2 >: 0.000846998345083074 -0.007245557942011760 +< 2 -3 1 >: -0.000282332781694358 0.002415185980670586 +< 2 -2 0 >: -0.000371197439837465 0.003175369319056914 +< 2 -1 -1 >: 0.000640270566278024 -0.005477126978420593 +< 2 0 -2 >: -0.000371197439837464 0.003175369319056911 +< 2 1 -3 >: -0.000282332781694358 0.002415185980670587 +< 2 2 -4 >: 0.000846998345083074 -0.007245557942011761 +< 3 -4 1 >: -0.000746982327324361 0.006389981474824022 +< 3 -3 0 >: 0.000708649657871523 -0.006062068700017744 +< 3 -2 -1 >: -0.000282332781694358 0.002415185980670586 +< 3 -1 -2 >: -0.000282332781694358 0.002415185980670587 +< 3 0 -3 >: 0.000708649657871523 -0.006062068700017741 +< 3 1 -4 >: -0.000746982327324361 0.006389981474824026 +< 4 -4 0 >: 0.000472433105247682 -0.004041379133345162 +< 4 -3 -1 >: -0.000746982327324361 0.006389981474824022 +< 4 -2 -2 >: 0.000846998345083074 -0.007245557942011760 +< 4 -1 -3 >: -0.000746982327324361 0.006389981474824025 +< 4 0 -4 >: 0.000472433105247682 -0.004041379133345162 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 3 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.002178592250819812 -0.198859745376887886 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.144434674241241234 0.026404400773172472 +< 1 -1 0 >: 0.288869348482482413 -0.052808801546344930 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.066933773019674625 -0.060517553976457361 +< 1 -1 0 >: 0.133867546039349278 0.121035107952914736 +< 2 -2 0 >: -0.133867546039349306 -0.121035107952914764 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.008216152462939682 0.080644103798288486 +< 0 1 -1 >: 0.009487195672362459 0.093119790072995909 +< 1 -2 1 >: -0.005477434975293119 -0.053762735865525636 +< 1 -1 0 >: -0.015492525658152539 -0.152063980422617595 +< 1 0 -1 >: -0.013416920788742326 -0.131691270046566333 +< 2 -2 0 >: 0.012247916947090298 0.120217132051681344 +< 2 -1 -1 >: 0.017321170257394370 0.170012698577085036 +< 3 -2 -1 >: -0.021214014439244287 -0.208222180653728994 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.014229741031922949 0.121632073985388084 +< 1 -1 0 >: 0.028459482063845899 -0.243264147970776168 +< 2 -2 0 >: -0.028459482063845895 0.243264147970776112 +< 3 -3 0 >: 0.028459482063845895 -0.243264147970776112 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000098084456858408 0.018122032281549901 +< 0 1 -1 >: -0.000120128435500565 0.022194866096021060 +< 1 -2 1 >: 0.000084943631355780 -0.015694140324023886 +< 1 -1 0 >: 0.000189939733967207 -0.035093164612937988 +< 1 0 -1 >: 0.000155085143366546 -0.028653448920397725 +< 2 -3 1 >: -0.000049042228429204 0.009061016140774954 +< 2 -2 0 >: -0.000169887262711560 0.031388280648047787 +< 2 -1 -1 >: -0.000189939733967207 0.035093164612937995 +< 3 -3 0 >: 0.000129753540164096 -0.023973195334032745 +< 3 -2 -1 >: 0.000224739724026143 -0.041522792338317870 +< 4 -3 -1 >: -0.000259507080328191 0.047946390668065504 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.003056338219503456 0.047063152839364790 +< 1 -1 0 >: -0.006112676439006910 -0.094126305678729552 +< 2 -2 0 >: 0.006112676439006910 0.094126305678729552 +< 3 -3 0 >: -0.006112676439006910 -0.094126305678729552 +< 4 -4 0 >: 0.006112676439006912 0.094126305678729566 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 3 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.000321265665724485 0.015693481158689460 +< 0 1 -1 >: 0.000175964452069215 -0.008595673636396527 +< 0 2 -2 >: 0.000746553943835503 -0.036468354702974493 +< 1 -3 2 >: -0.000624611842458531 0.030511614613444728 +< 1 -2 1 >: -0.000500803610186023 0.024463716043027536 +< 1 -1 0 >: 0.000546151631731625 -0.026678917969772075 +< 1 0 -1 >: 0.000175964452069215 -0.008595673636396527 +< 1 1 -2 >: -0.000786936952900536 0.038441021126770898 +< 2 -4 2 >: 0.000416407894972354 -0.020341076408963151 +< 2 -3 1 >: 0.000736112115686417 -0.035958282663528865 +< 2 -2 0 >: -0.000257012532579588 0.012554784926951570 +< 2 -1 -1 >: -0.000500803610186023 0.024463716043027536 +< 2 0 -2 >: 0.000746553943835503 -0.036468354702974493 +< 3 -4 1 >: -0.000779027838067147 0.038054669400265070 +< 3 -3 0 >: -0.000224885966007140 0.010985436811082617 +< 3 -2 -1 >: 0.000736112115686417 -0.035958282663528865 +< 3 -1 -2 >: -0.000624611842458531 0.030511614613444728 +< 4 -4 0 >: 0.000899543864028559 -0.043941747244330483 +< 4 -3 -1 >: -0.000779027838067147 0.038054669400265070 +< 4 -2 -2 >: 0.000416407894972354 -0.020341076408963151 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.105451860684968465 0.081293634195520742 +< 1 -1 0 >: -0.210903721369936875 -0.162587268391041456 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.030457193645041694 -0.051104929393587219 +< 1 -1 0 >: -0.060914387290083395 0.102209858787174451 +< 2 -2 0 >: 0.060914387290083409 -0.102209858787174479 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.007340629660088890 -0.092579558798564845 +< 0 1 -1 >: -0.008476229020547340 -0.106901666387616348 +< 1 -2 1 >: 0.004893753106725926 0.061719705865709878 +< 1 -1 0 >: 0.013841624028874549 0.174569690201930389 +< 1 0 -1 >: 0.011987198038638465 0.151181786445651084 +< 2 -2 0 >: -0.010942764611739954 -0.138009457867019819 +< 2 -1 -1 >: -0.015475406123778998 -0.195174847051297645 +< 3 -2 -1 >: 0.018953424282800318 0.239039392950714580 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.006013331113252285 -0.048220230959381494 +< 1 -1 0 >: -0.012026662226504571 0.096440461918762987 +< 2 -2 0 >: 0.012026662226504569 -0.096440461918762974 +< 3 -3 0 >: -0.012026662226504569 0.096440461918762974 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000113806136745823 -0.008979004277503451 +< 0 1 -1 >: 0.000139383482312336 -0.010996989439075493 +< 1 -2 1 >: -0.000098559005528448 0.007776045805007128 +< 1 -1 0 >: -0.000220384636156388 0.017387767016148015 +< 1 0 -1 >: -0.000179943301910691 0.014197052318652740 +< 2 -3 1 >: 0.000056903068372911 -0.004489502138751727 +< 2 -2 0 >: 0.000197118011056896 -0.015552091610014264 +< 2 -1 -1 >: 0.000220384636156388 -0.017387767016148019 +< 3 -3 0 >: -0.000150551367751228 0.011878106169629662 +< 3 -2 -1 >: -0.000260762618094114 0.020573483383495926 +< 4 -3 -1 >: 0.000301102735502457 -0.023756212339259331 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.000810472149903069 -0.033694185263296240 +< 1 -1 0 >: 0.001620944299806138 0.067388370526592467 +< 2 -2 0 >: -0.001620944299806138 -0.067388370526592467 +< 3 -3 0 >: 0.001620944299806138 0.067388370526592467 +< 4 -4 0 >: -0.001620944299806138 -0.067388370526592467 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 3 4 ) +l=( 4 4 2 ) +num_ms=20 +< 0 0 0 >: -0.000093237885069566 0.004741555114419998 +< 0 1 -1 >: 0.000051068492866675 -0.002597056693821822 +< 0 2 -2 >: 0.000216665265666018 -0.011018378395963953 +< 1 -3 2 >: -0.000181275166921143 0.009218636761129689 +< 1 -2 1 >: -0.000145343478717680 0.007391352928557148 +< 1 -1 0 >: 0.000158504404618262 -0.008060643694513994 +< 1 0 -1 >: 0.000051068492866675 -0.002597056693821822 +< 1 1 -2 >: -0.000228385243116698 0.011614390617612904 +< 2 -4 2 >: 0.000120850111280762 -0.006145757840753126 +< 2 -3 1 >: 0.000213634832984439 -0.010864267611817319 +< 2 -2 0 >: -0.000074590308055653 0.003793244091535999 +< 2 -1 -1 >: -0.000145343478717680 0.007391352928557148 +< 2 0 -2 >: 0.000216665265666018 -0.011018378395963953 +< 3 -4 1 >: -0.000226089855783058 0.011497660111088900 +< 3 -3 0 >: -0.000065266519548696 0.003319088580093997 +< 3 -2 -1 >: 0.000213634832984439 -0.010864267611817319 +< 3 -1 -2 >: -0.000181275166921143 0.009218636761129689 +< 4 -4 0 >: 0.000261066078194784 -0.013276354320375992 +< 4 -3 -1 >: -0.000226089855783058 0.011497660111088900 +< 4 -2 -2 >: 0.000120850111280762 -0.006145757840753126 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 4 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.054250151605964823 0.208595392086789289 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 4 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.103192119057310613 -0.093246219760853732 +< 1 -1 >: -0.206384238114621199 0.186492439521707437 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 4 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: 0.044390859739626594 0.169408665353573712 +< 1 -1 >: -0.088781719479253202 -0.338817330707147479 +< 2 -2 >: 0.088781719479253215 0.338817330707147590 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 4 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: 0.011637781623393110 -0.226875186972397141 +< 1 -1 >: -0.023275563246786219 0.453750373944794283 +< 2 -2 >: 0.023275563246786216 -0.453750373944794172 +< 3 -3 >: -0.023275563246786216 0.453750373944794172 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 4 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: -0.002673631050075407 -0.052584537499551505 +< 1 -1 >: 0.005347262100150813 0.105169074999102968 +< 2 -2 >: -0.005347262100150813 -0.105169074999102968 +< 3 -3 >: 0.005347262100150813 0.105169074999102968 +< 4 -4 >: -0.005347262100150814 -0.105169074999102996 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 4 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.000756246807439673 -0.017237829886004301 +< 1 -1 >: -0.001512493614879346 0.034475659772008602 +< 2 -2 >: 0.001512493614879346 -0.034475659772008609 +< 3 -3 >: -0.001512493614879346 0.034475659772008616 +< 4 -4 >: 0.001512493614879346 -0.034475659772008609 +< 5 -5 >: -0.001512493614879344 0.034475659772008567 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 4 4 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: 0.010487613030069814 -0.003629149816459060 +< 1 -1 >: -0.020975226060139636 0.007258299632918121 +< 2 -2 >: 0.020975226060139626 -0.007258299632918118 +< 3 -3 >: -0.020975226060139636 0.007258299632918121 +< 4 -4 >: 0.020975226060139622 -0.007258299632918117 +< 5 -5 >: -0.020975226060139626 0.007258299632918118 +< 6 -6 >: 0.020975226060139615 -0.007258299632918114 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.001213408047735315 0.035697451364269411 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.018657268269850258 0.028650874808118284 +< 1 -1 0 >: -0.037314536539700509 -0.057301749616236554 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.018430445854120365 0.003240291627703445 +< 0 1 -1 >: -0.018430445854120361 0.003240291627703444 +< 1 -1 0 >: 0.031922468625483646 -0.005612349730522423 +< 1 0 -1 >: 0.031922468625483646 -0.005612349730522423 +< 2 -1 -1 >: -0.045145188074588581 0.007937061105685796 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.002825899779315056 0.010538572521290751 +< 1 -1 0 >: 0.005651799558630113 -0.021077145042581506 +< 2 -2 0 >: -0.005651799558630114 0.021077145042581513 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.000633670587875195 0.057629644903303641 +< 0 1 -1 >: 0.000731699768974584 0.066544981996449773 +< 1 -2 1 >: -0.000422447058583463 -0.038419763268869082 +< 1 -1 0 >: -0.001194860719266710 -0.108667500555996693 +< 1 0 -1 >: -0.001034779736869117 -0.094108816047252714 +< 2 -2 0 >: 0.000944620339887460 0.085909202348640815 +< 2 -1 -1 >: 0.001335894895962328 0.121493959094102377 +< 3 -2 -1 >: -0.001636130422548062 -0.148799103305561398 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.001618336463487219 -0.001267267722437297 +< 1 -1 0 >: 0.003236672926974437 0.002534535444874594 +< 2 -2 0 >: -0.003236672926974437 -0.002534535444874593 +< 3 -3 0 >: 0.003236672926974437 0.002534535444874593 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.000736986042581823 0.070591808985609933 +< 0 1 -1 >: -0.000982648056775764 0.094122411980813281 +< 0 2 -2 >: -0.000245662014193941 0.023530602995203317 +< 1 -2 1 >: 0.000549316963227170 -0.052616027848834769 +< 1 -1 0 >: 0.001345546266961758 -0.128882420521714808 +< 1 0 -1 >: 0.001345546266961758 -0.128882420521714836 +< 1 1 -2 >: 0.000549316963227170 -0.052616027848834769 +< 2 -2 0 >: -0.000951444889768903 0.091133633526640778 +< 2 -1 -1 >: -0.001553702998874934 0.148820600364045208 +< 2 0 -2 >: -0.000951444889768904 0.091133633526640806 +< 3 -2 -1 >: 0.001453356075648306 -0.139208924664065675 +< 3 -1 -2 >: 0.001453356075648306 -0.139208924664065647 +< 4 -2 -2 >: -0.002055355873139172 0.196871149263296047 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000196073051354437 0.040098960077170558 +< 0 1 -1 >: -0.000240139464064447 0.049110995702650720 +< 1 -2 1 >: 0.000169804243470474 -0.034726718092167715 +< 1 -1 0 >: 0.000379693831267904 -0.077651302289558827 +< 1 0 -1 >: 0.000310018715029592 -0.063402022824010071 +< 2 -3 1 >: -0.000098036525677219 0.020049480038585282 +< 2 -2 0 >: -0.000339608486940947 0.069453436184335457 +< 2 -1 -1 >: -0.000379693831267904 0.077651302289558841 +< 3 -3 0 >: 0.000259380266342719 -0.053045938098250339 +< 3 -2 -1 >: 0.000449259799786336 -0.091878259921323202 +< 4 -3 -1 >: -0.000518760532685437 0.106091876196500706 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.001238384706671072 0.007037363188932728 +< 0 1 -1 >: -0.000412794902223691 -0.002345787729644244 +< 0 2 -2 >: -0.002889564315565836 -0.016420514107509696 +< 0 3 -3 >: -0.001238384706671072 -0.007037363188932728 +< 1 -3 2 >: 0.002260970795710549 0.012848408546449815 +< 1 -2 1 >: 0.002335120596812877 0.013269779286845118 +< 1 -1 0 >: -0.001598747781711674 -0.009085196810649860 +< 1 0 -1 >: -0.001598747781711673 -0.009085196810649857 +< 1 1 -2 >: 0.002335120596812877 0.013269779286845116 +< 1 2 -3 >: 0.002260970795710549 0.012848408546449816 +< 2 -3 1 >: -0.003033410636610348 -0.017237948947530637 +< 2 -2 0 >: -0.000714981743756859 -0.004063023531515472 +< 2 -1 -1 >: 0.002610744195066736 0.014836064265902182 +< 2 0 -2 >: -0.000714981743756859 -0.004063023531515472 +< 2 1 -3 >: -0.003033410636610347 -0.017237948947530633 +< 3 -3 0 >: 0.003276457961277329 0.018619112883556454 +< 3 -2 -1 >: -0.001544537095127900 -0.008777133986427054 +< 3 -1 -2 >: -0.001544537095127900 -0.008777133986427054 +< 3 0 -3 >: 0.003276457961277329 0.018619112883556454 +< 4 -3 -1 >: -0.002675216722936367 -0.015202442009331218 +< 4 -2 -2 >: 0.003453689938476042 0.019626268241274603 +< 4 -1 -3 >: -0.002675216722936367 -0.015202442009331218 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 1 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.000356821089702680 0.020718344046613824 +< 1 -1 0 >: 0.000713642179405360 -0.041436688093227633 +< 2 -2 0 >: -0.000713642179405360 0.041436688093227633 +< 3 -3 0 >: 0.000713642179405360 -0.041436688093227633 +< 4 -4 0 >: -0.000713642179405360 0.041436688093227640 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.001741909027330715 0.001028033309054385 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.026292349867263188 -0.145147277541537695 +< 1 -1 0 >: 0.052584699734526362 0.290294555083075334 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: 0.007695818301156227 0.021265540175698535 +< 0 1 -1 >: 0.007695818301156226 0.021265540175698535 +< 1 -1 0 >: -0.013329548303420990 -0.036832996034707056 +< 1 0 -1 >: -0.013329548303420990 -0.036832996034707056 +< 2 -1 -1 >: 0.018850827991005240 0.052089722535117143 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.013713591503660897 -0.063837175218931175 +< 1 -1 0 >: 0.027427183007321797 0.127674350437862377 +< 2 -2 0 >: -0.027427183007321804 -0.127674350437862405 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.005666625340128594 -0.011330464497213925 +< 0 1 -1 >: 0.006543255331039994 -0.013083293455019908 +< 1 -2 1 >: -0.003777750226752395 0.007553642998142613 +< 1 -1 0 >: -0.010685091211862547 0.021364928746595711 +< 1 0 -1 >: -0.009253560431226816 0.018502571044596301 +< 2 -2 0 >: 0.008447306309033601 -0.016890459221612204 +< 2 -1 -1 >: 0.011946295147755128 -0.023886716505913688 +< 3 -2 -1 >: -0.014631163714343320 0.029255133535002604 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.003440334564960547 0.020755218162560776 +< 1 -1 0 >: -0.006880669129921094 -0.041510436325121552 +< 2 -2 0 >: 0.006880669129921093 0.041510436325121546 +< 3 -3 0 >: -0.006880669129921093 -0.041510436325121546 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: -0.011655980059018163 -0.029947069094655394 +< 0 1 -1 >: -0.015541306745357556 -0.039929425459540542 +< 0 2 -2 >: -0.003885326686339389 -0.009982356364885134 +< 1 -2 1 >: 0.008687854585448877 0.022321227407510850 +< 1 -1 0 >: 0.021280810693848823 0.054675617581028582 +< 1 0 -1 >: 0.021280810693848826 0.054675617581028589 +< 1 1 -2 >: 0.008687854585448877 0.022321227407510850 +< 2 -2 0 >: -0.015047805550767695 -0.038661499957107714 +< 2 -1 -1 >: -0.024572963565334172 -0.063133965057031782 +< 2 0 -2 >: -0.015047805550767700 -0.038661499957107728 +< 3 -2 -1 >: 0.022985902659789888 0.059056416677992732 +< 3 -1 -2 >: 0.022985902659789885 0.059056416677992725 +< 4 -2 -2 >: -0.032506975284862648 -0.083518385411173943 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.001114057647065003 -0.005461004065584623 +< 0 1 -1 >: 0.001364436389677444 -0.006688336721973384 +< 1 -2 1 >: -0.000964802223638611 0.004729368250966384 +< 1 -1 0 >: -0.002157363356898890 0.010575188899790122 +< 1 0 -1 >: -0.001761479804726704 0.008634605579343473 +< 2 -3 1 >: 0.000557028823532502 -0.002730502032792312 +< 2 -2 0 >: 0.001929604447277223 -0.009458736501932772 +< 2 -1 -1 >: 0.002157363356898890 -0.010575188899790124 +< 3 -3 0 >: -0.001473759740161883 0.007224229333124788 +< 3 -2 -1 >: -0.002552626748109889 0.012512732250501564 +< 4 -3 -1 >: 0.002947519480323767 -0.014448458666249581 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: -0.000040013265781497 0.005034179208135279 +< 0 1 -1 >: 0.000013337755260499 -0.001678059736045094 +< 0 2 -2 >: 0.000093364286823494 -0.011746418152315649 +< 0 3 -3 >: 0.000040013265781497 -0.005034179208135279 +< 1 -3 2 >: -0.000073053894226585 0.009191111702730620 +< 1 -2 1 >: -0.000075449737524044 0.009492539348748748 +< 1 -1 0 >: 0.000051656903999703 -0.006499097411643860 +< 1 0 -1 >: 0.000051656903999703 -0.006499097411643858 +< 1 1 -2 >: -0.000075449737524044 0.009492539348748746 +< 1 2 -3 >: -0.000073053894226585 0.009191111702730622 +< 2 -3 1 >: 0.000098012084107035 -0.012331170333659710 +< 2 -2 0 >: 0.000023101669770103 -0.002906484720965719 +< 2 -1 -1 >: -0.000084355370994139 0.010612981631446890 +< 2 0 -2 >: 0.000023101669770103 -0.002906484720965719 +< 2 1 -3 >: 0.000098012084107035 -0.012331170333659708 +< 3 -3 0 >: -0.000105865150401372 0.013319186240058017 +< 3 -2 -1 >: 0.000049905310493429 -0.006278724606821053 +< 3 -1 -2 >: 0.000049905310493429 -0.006278724606821052 +< 3 0 -3 >: -0.000105865150401372 0.013319186240058019 +< 4 -3 -1 >: 0.000086438533342120 -0.010875070025746987 +< 4 -2 -2 >: -0.000111591666701542 0.014039655032852510 +< 4 -1 -3 >: 0.000086438533342120 -0.010875070025746987 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 2 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.000421853567774246 -0.023896840608999721 +< 1 -1 0 >: -0.000843707135548492 0.047793681217999429 +< 2 -2 0 >: 0.000843707135548492 -0.047793681217999429 +< 3 -3 0 >: -0.000843707135548492 0.047793681217999429 +< 4 -4 0 >: 0.000843707135548492 -0.047793681217999436 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: -0.014109861976344697 0.193509596104425502 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: 0.049685918092498657 0.008458786461950975 +< 1 -1 0 >: -0.099371836184997300 -0.016917572923901947 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 2 1 1 ) +num_ms=5 +< 0 0 0 >: -0.012106686397669158 0.038685893459240055 +< 0 1 -1 >: -0.012106686397669156 0.038685893459240048 +< 1 -1 0 >: 0.020969395952066008 -0.067005933007600285 +< 1 0 -1 >: 0.020969395952066008 -0.067005933007600285 +< 2 -1 -1 >: -0.029655204150183224 0.094760699218811348 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: 0.024701085634451905 0.107843322975982550 +< 1 -1 0 >: -0.049402171268903818 -0.215686645951965128 +< 2 -2 0 >: 0.049402171268903824 0.215686645951965184 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: -0.012234782769779649 -0.029335212186955249 +< 0 1 -1 >: -0.014127510251217744 -0.033873385305746795 +< 1 -2 1 >: 0.008156521846519762 0.019556808124636827 +< 1 -1 0 >: 0.023070127634281387 0.055315006573179483 +< 1 0 -1 >: 0.019979316599837066 0.047904200902876622 +< 2 -2 0 >: -0.018238537308780303 -0.043730352389608131 +< 2 -1 -1 >: -0.025793186819924790 -0.061844057436738500 +< 3 -2 -1 >: 0.031590073274548013 0.075743192171692342 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: -0.002867619014356497 0.014286109322940568 +< 1 -1 0 >: 0.005735238028712993 -0.028572218645881137 +< 2 -2 0 >: -0.005735238028712992 0.028572218645881130 +< 3 -3 0 >: 0.005735238028712992 -0.028572218645881130 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 4 2 2 ) +num_ms=13 +< 0 0 0 >: 0.014951251518046636 -0.018095272181581044 +< 0 1 -1 >: 0.019935002024062190 -0.024127029575441401 +< 0 2 -2 >: 0.004983750506015547 -0.006031757393860349 +< 1 -2 1 >: -0.011144004914349736 0.013487419556458715 +< 1 -1 0 >: -0.027297125731225006 0.033037295860158862 +< 1 0 -1 >: -0.027297125731225010 0.033037295860158869 +< 1 1 -2 >: -0.011144004914349736 0.013487419556458715 +< 2 -2 0 >: 0.019301982711450991 -0.023360895934784576 +< 2 -1 -1 >: 0.031520005778051641 -0.038148183316320063 +< 2 0 -2 >: 0.019301982711450998 -0.023360895934784586 +< 3 -2 -1 >: -0.029484265612651068 0.035684357974378855 +< 3 -1 -2 >: -0.029484265612651064 0.035684357974378855 +< 4 -2 -2 >: 0.041697048306021799 -0.050465303011943068 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: -0.000827935056385834 -0.019614086301770382 +< 0 1 -1 >: -0.001014009214153857 -0.024022251605125295 +< 1 -2 1 >: 0.000717012791513834 0.016986297009353522 +< 1 -1 0 >: 0.001603289342561818 0.037982514798915859 +< 1 0 -1 >: 0.001309080266439585 0.031012593468351547 +< 2 -3 1 >: -0.000413967528192917 -0.009807043150885193 +< 2 -2 0 >: -0.001434025583027669 -0.033972594018707059 +< 2 -1 -1 >: -0.001603289342561818 -0.037982514798915866 +< 3 -3 0 >: 0.001095255130454578 0.025946997274121506 +< 3 -2 -1 >: 0.001897037533197809 0.044941517582629625 +< 4 -3 -1 >: -0.002190510260909157 -0.051893994548243033 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 4 3 3 ) +num_ms=22 +< 0 0 0 >: 0.000188613045151763 -0.003056798319884722 +< 0 1 -1 >: -0.000062871015050588 0.001018932773294908 +< 0 2 -2 >: -0.000440097105354114 0.007132529413064352 +< 0 3 -3 >: -0.000188613045151763 0.003056798319884722 +< 1 -3 2 >: 0.000344358731564537 -0.005580924645149182 +< 1 -2 1 >: 0.000355652168658816 -0.005763954188560354 +< 1 -1 0 >: -0.000243498394250082 0.003946309661876115 +< 1 0 -1 >: -0.000243498394250082 0.003946309661876113 +< 1 1 -2 >: 0.000355652168658816 -0.005763954188560353 +< 1 2 -3 >: 0.000344358731564537 -0.005580924645149183 +< 2 -3 1 >: -0.000462005719454344 0.007487596130314481 +< 2 -2 0 >: -0.000108895792391045 0.001764843332843839 +< 2 -1 -1 >: 0.000397631212733167 -0.006444296692407796 +< 2 0 -2 >: -0.000108895792391045 0.001764843332843840 +< 2 1 -3 >: -0.000462005719454344 0.007487596130314480 +< 3 -3 0 >: 0.000499023211494162 -0.008087528162495042 +< 3 -2 -1 >: -0.000235241797878007 0.003812497337824949 +< 3 -1 -2 >: -0.000235241797878007 0.003812497337824948 +< 3 0 -3 >: 0.000499023211494162 -0.008087528162495044 +< 4 -3 -1 >: -0.000407450745988557 0.006603439092833897 +< 4 -2 -2 >: 0.000526016651204489 -0.008525003211413563 +< 4 -1 -3 >: -0.000407450745988557 0.006603439092833897 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 3 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: -0.000151112971668910 0.010079340615102923 +< 1 -1 0 >: 0.000302225943337819 -0.020158681230205838 +< 2 -2 0 >: -0.000302225943337819 0.020158681230205838 +< 3 -3 0 >: 0.000302225943337819 -0.020158681230205838 +< 4 -4 0 >: -0.000302225943337819 0.020158681230205842 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 0 0 0 ) +num_ms=1 +< 0 0 0 >: 0.005541515991558750 -0.060359180371488269 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 1 1 0 ) +num_ms=2 +< 0 0 0 >: -0.039526815180770912 -0.005101713824901174 +< 1 -1 0 >: 0.079053630361541810 0.010203427649802347 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 1 1 2 ) +num_ms=4 +< -1 -1 2 >: -0.004177952841598594 -0.081072442466747066 +< -1 0 1 >: 0.005908517571543944 0.114653747671186163 +< -1 1 0 >: -0.001705642105221264 -0.033097686040779374 +< 0 0 0 >: -0.001705642105221265 -0.033097686040779381 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 2 2 0 ) +num_ms=3 +< 0 0 0 >: -0.009429509908910956 -0.051590743999683941 +< 1 -1 0 >: 0.018859019817821916 0.103181487999367882 +< 2 -2 0 >: -0.018859019817821919 -0.103181487999367910 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 2 2 2 ) +num_ms=5 +< -2 0 2 >: -0.002347060540487584 -0.126608246332323732 +< -2 1 1 >: 0.001916366906538493 0.103375200247597623 +< -1 -1 2 >: 0.000958183453269246 0.051687600123798812 +< -1 0 1 >: -0.001173530270243791 -0.063304123166161852 +< 0 0 0 >: 0.000391176756747930 0.021101374388720614 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 2 2 4 ) +num_ms=9 +< -2 -2 4 >: -0.001504842363776750 -0.051768039787223226 +< -2 -1 3 >: 0.002128168480086666 0.073211063964561091 +< -2 0 2 >: -0.001393213307373752 -0.047927891760836408 +< -2 1 1 >: 0.000804372078050805 0.027671181209810151 +< -2 2 0 >: -0.000179863064572437 -0.006187464220285037 +< -1 -1 2 >: -0.001137553901973678 -0.039132959753797068 +< -1 0 1 >: 0.001970301154566636 0.067780274544124580 +< -1 1 0 >: -0.000719452258289746 -0.024749856881140151 +< 0 0 0 >: -0.000539589193717310 -0.018562392660855107 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 2 3 3 ) +num_ms=12 +< -2 -1 3 >: -0.004223553912545217 0.023819573153742578 +< -2 0 2 >: 0.011946014449070792 -0.067371926807921673 +< -2 1 1 >: -0.006543101586038722 0.036901124055285721 +< -1 -2 3 >: 0.006678025092079245 -0.037662052029413307 +< -1 -1 2 >: -0.005172775993435635 0.029172900058783004 +< -1 0 1 >: 0.003777661462034523 -0.021304873906718983 +< 0 -3 3 >: -0.006678025092079244 0.037662052029413300 +< 0 -1 1 >: 0.004006815055247546 -0.022597231217647975 +< 0 0 0 >: -0.002671210036831698 0.015064820811765321 +< 1 -3 2 >: 0.006678025092079245 -0.037662052029413307 +< 1 -2 1 >: -0.005172775993435635 0.029172900058783004 +< 2 -3 1 >: -0.004223553912545217 0.023819573153742578 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 2 4 4 ) +num_ms=18 +< -2 -2 4 >: 0.000240220309580954 0.004324166557239217 +< -2 -1 3 >: -0.000360330464371431 -0.006486249835858826 +< -2 0 2 >: 0.000861354559662963 0.015505102742217962 +< -2 1 1 >: -0.000453973713584393 -0.008171906670055223 +< -1 -3 4 >: -0.000449411047898350 -0.008089774870267481 +< -1 -2 3 >: 0.000424653524708561 0.007644118739009841 +< -1 -1 2 >: -0.000288907102220368 -0.005200569559457665 +< -1 0 1 >: 0.000203023216714545 0.003654587764005484 +< 0 -4 4 >: 0.000518935178961808 0.009341267398064795 +< 0 -3 3 >: -0.000129733794740452 -0.002335316849516198 +< 0 -2 2 >: -0.000148267193989088 -0.002668933542304228 +< 0 -1 1 >: 0.000315067787226812 0.005671483777396482 +< 0 0 0 >: -0.000185333992486360 -0.003336166927880284 +< 1 -4 3 >: -0.000449411047898350 -0.008089774870267481 +< 1 -3 2 >: 0.000424653524708561 0.007644118739009841 +< 1 -2 1 >: -0.000288907102220368 -0.005200569559457665 +< 2 -4 2 >: 0.000240220309580954 0.004324166557239217 +< 2 -3 1 >: -0.000360330464371431 -0.006486249835858826 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 3 2 1 ) +num_ms=8 +< 0 0 0 >: 0.008760751724334374 0.041747788186835638 +< 0 1 -1 >: 0.010116044732695853 0.048206193495482053 +< 1 -2 1 >: -0.005840501149556247 -0.027831858791223751 +< 1 -1 0 >: -0.016519431873516198 -0.078720384337202992 +< 1 0 -1 >: -0.014306247658551386 -0.068173852631692400 +< 2 -2 0 >: 0.013059757593073438 0.062233928197351449 +< 2 -1 -1 >: 0.018469286309429463 0.088012065296447797 +< 3 -2 -1 >: -0.022620163685736622 -0.107792325592406077 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 3 3 0 ) +num_ms=4 +< 0 0 0 >: 0.000591058405233963 -0.019472467390641453 +< 1 -1 0 >: -0.001182116810467926 0.038944934781282907 +< 2 -2 0 >: 0.001182116810467926 -0.038944934781282900 +< 3 -3 0 >: -0.001182116810467926 0.038944934781282900 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 3 3 4 ) +num_ms=14 +< -3 -1 4 >: 0.000271764969167761 -0.055075168110579449 +< -3 0 3 >: -0.000332842752212108 0.067453029684461763 +< -3 1 2 >: 0.000308152510061585 -0.062449370672429283 +< -3 2 1 >: -0.000229683319978297 0.046547012658544523 +< -3 3 0 >: 0.000062901367717395 -0.012747424408781675 +< -2 -2 4 >: -0.000175423533278218 0.035550868146974654 +< -2 -1 3 >: 0.000156903578105317 -0.031797663134306930 +< -2 0 2 >: 0.000072632243168067 -0.014719457827769010 +< -2 1 1 >: -0.000237215912847353 0.048073547957933012 +< -2 2 0 >: 0.000146769858007255 -0.029743990287157244 +< -1 -1 2 >: -0.000132607726617837 0.026873930288383602 +< -1 0 1 >: 0.000162410633082093 -0.032913708294832901 +< -1 1 0 >: 0.000020967122572465 -0.004249141469593896 +< 0 0 0 >: -0.000062901367717395 0.012747424408781675 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 4 3 1 ) +num_ms=11 +< 0 0 0 >: 0.000112956969057605 0.019211722353957333 +< 0 1 -1 >: 0.000138343468541241 0.023529458423608391 +< 1 -2 1 >: -0.000097823604738379 -0.016637839608980427 +< 1 -1 0 >: -0.000218740229999086 -0.037203340364418754 +< 1 0 -1 >: -0.000178600649905598 -0.030376400206638364 +< 2 -3 1 >: 0.000056478484528803 0.009605861176978668 +< 2 -2 0 >: 0.000195647209476758 0.033275679217960860 +< 2 -1 -1 >: 0.000218740229999086 0.037203340364418760 +< 3 -3 0 >: -0.000149428024489021 -0.025414719802895756 +< 3 -2 -1 >: -0.000258816930489631 -0.044019585958742349 +< 4 -3 -1 >: 0.000298856048978042 0.050829439605791532 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 4 4 0 ) +num_ms=5 +< 0 0 0 >: 0.000040901533397538 0.008179721997529900 +< 1 -1 0 >: -0.000081803066795075 -0.016359443995059793 +< 2 -2 0 >: 0.000081803066795075 0.016359443995059793 +< 3 -3 0 >: -0.000081803066795075 -0.016359443995059793 +< 4 -4 0 >: 0.000081803066795075 0.016359443995059796 +ctilde_basis_func: rank=3 ndens=2 mu0=0 mu=( 0 0 0 ) +n=( 4 4 4 ) +l=( 4 4 4 ) +num_ms=13 +< -4 0 4 >: -0.000089621725821500 -0.004671772164949175 +< -4 1 3 >: 0.000188939187620711 0.009848960500410162 +< -4 2 2 >: -0.000107118450719780 -0.005583835747839332 +< -3 -1 4 >: 0.000094469593810355 0.004924480250205079 +< -3 0 3 >: -0.000134432588732250 -0.007007658247423763 +< -3 1 2 >: 0.000071412300479853 0.003722557165226221 +< -2 -2 4 >: -0.000053559225359890 -0.002791917873919665 +< -2 -1 3 >: 0.000035706150239927 0.001861278582613110 +< -2 0 2 >: 0.000070417070288322 0.003670678129602923 +< -2 1 1 >: -0.000080973937551733 -0.004220983071604355 +< -1 -1 2 >: -0.000040486968775867 -0.002110491535802177 +< -1 0 1 >: 0.000057613966599536 0.003003282106038756 +< 0 0 0 >: -0.000019204655533179 -0.001001094035346252 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 1 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: -0.036354686618942797 0.112716151876300436 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 1 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.012575790814374094 0.044298713022054285 +< 1 -1 >: -0.025151581628748185 -0.088597426044108557 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 1 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: 0.024515135306401561 0.272026568680671377 +< 1 -1 >: -0.049030270612803128 -0.544053137361342865 +< 2 -2 >: 0.049030270612803142 0.544053137361342976 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 1 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: 0.007582177999163661 -0.070781616545872547 +< 1 -1 >: -0.015164355998327321 0.141563233091745094 +< 2 -2 >: 0.015164355998327319 -0.141563233091745094 +< 3 -3 >: -0.015164355998327319 0.141563233091745094 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 1 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: -0.009642092538547307 0.027222201050041573 +< 1 -1 >: 0.019284185077094607 -0.054444402100083125 +< 2 -2 >: -0.019284185077094607 0.054444402100083125 +< 3 -3 >: 0.019284185077094607 -0.054444402100083125 +< 4 -4 >: -0.019284185077094611 0.054444402100083139 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 1 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.000765366179527079 -0.013233978357391383 +< 1 -1 >: -0.001530732359054158 0.026467956714782765 +< 2 -2 >: 0.001530732359054158 -0.026467956714782772 +< 3 -3 >: -0.001530732359054159 0.026467956714782775 +< 4 -4 >: 0.001530732359054158 -0.026467956714782772 +< 5 -5 >: -0.001530732359054157 0.026467956714782741 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 1 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: 0.011966394369992209 -0.043960679058516534 +< 1 -1 >: -0.023932788739984421 0.087921358117033083 +< 2 -2 >: 0.023932788739984414 -0.087921358117033055 +< 3 -3 >: -0.023932788739984421 0.087921358117033083 +< 4 -4 >: 0.023932788739984407 -0.087921358117033027 +< 5 -5 >: -0.023932788739984414 0.087921358117033055 +< 6 -6 >: 0.023932788739984397 -0.087921358117032999 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 2 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.022654895781669057 0.005925444934381353 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 2 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.000930388542384164 -0.019540938019308115 +< 1 -1 >: -0.001860777084768328 0.039081876038616223 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 2 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: -0.016769561527053545 0.107666259659159783 +< 1 -1 >: 0.033539123054107091 -0.215332519318319593 +< 2 -2 >: -0.033539123054107105 0.215332519318319648 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 2 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: -0.011757247699702073 0.050365927147369705 +< 1 -1 >: 0.023514495399404145 -0.100731854294739409 +< 2 -2 >: -0.023514495399404142 0.100731854294739395 +< 3 -3 >: 0.023514495399404142 -0.100731854294739395 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 2 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: 0.006244736507749126 -0.007390267531366143 +< 1 -1 >: -0.012489473015498249 0.014780535062732280 +< 2 -2 >: 0.012489473015498249 -0.014780535062732280 +< 3 -3 >: -0.012489473015498249 0.014780535062732280 +< 4 -4 >: 0.012489473015498251 -0.014780535062732284 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 2 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: -0.000345498946750941 0.002458373216535279 +< 1 -1 >: 0.000690997893501882 -0.004916746433070557 +< 2 -2 >: -0.000690997893501882 0.004916746433070558 +< 3 -3 >: 0.000690997893501882 -0.004916746433070559 +< 4 -4 >: -0.000690997893501882 0.004916746433070558 +< 5 -5 >: 0.000690997893501881 -0.004916746433070553 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 2 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: -0.019269466067705292 0.071391366733516939 +< 1 -1 >: 0.038538932135410590 -0.142782733467033907 +< 2 -2 >: -0.038538932135410577 0.142782733467033851 +< 3 -3 >: 0.038538932135410590 -0.142782733467033907 +< 4 -4 >: -0.038538932135410570 0.142782733467033823 +< 5 -5 >: 0.038538932135410577 -0.142782733467033851 +< 6 -6 >: -0.038538932135410556 0.142782733467033768 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 3 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.009916635737881018 -0.678214416426462074 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 3 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: -0.017546705953354277 -0.073117899737826647 +< 1 -1 >: 0.035093411906708546 0.146235799475653266 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 3 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: 0.004749098007251869 -0.257069405099209003 +< 1 -1 >: -0.009498196014503739 0.514138810198418117 +< 2 -2 >: 0.009498196014503742 -0.514138810198418228 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 3 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: 0.027176926052467926 -0.108355590420074283 +< 1 -1 >: -0.054353852104935853 0.216711180840148565 +< 2 -2 >: 0.054353852104935846 -0.216711180840148510 +< 3 -3 >: -0.054353852104935846 0.216711180840148510 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 3 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: 0.000211150248804564 0.002501125696239490 +< 1 -1 >: -0.000422300497609128 -0.005002251392478979 +< 2 -2 >: 0.000422300497609128 0.005002251392478979 +< 3 -3 >: -0.000422300497609128 -0.005002251392478979 +< 4 -4 >: 0.000422300497609128 0.005002251392478980 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 3 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.000099590275967354 -0.005481190461921377 +< 1 -1 >: -0.000199180551934708 0.010962380923842753 +< 2 -2 >: 0.000199180551934708 -0.010962380923842757 +< 3 -3 >: -0.000199180551934708 0.010962380923842758 +< 4 -4 >: 0.000199180551934708 -0.010962380923842757 +< 5 -5 >: -0.000199180551934708 0.010962380923842744 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 3 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: 0.028820822741815019 0.043553113576786734 +< 1 -1 >: -0.057641645483630044 -0.087106227153573496 +< 2 -2 >: 0.057641645483630023 0.087106227153573454 +< 3 -3 >: -0.057641645483630044 -0.087106227153573496 +< 4 -4 >: 0.057641645483630009 0.087106227153573440 +< 5 -5 >: -0.057641645483630023 -0.087106227153573454 +< 6 -6 >: 0.057641645483629989 0.087106227153573398 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 4 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: -0.015195924588765826 -0.167087048140837691 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 4 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.013684484211213044 0.034395304368322346 +< 1 -1 >: -0.027368968422426084 -0.068790608736644679 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 4 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: -0.005928702549188424 -0.130153406570613472 +< 1 -1 >: 0.011857405098376850 0.260306813141227000 +< 2 -2 >: -0.011857405098376851 -0.260306813141227056 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 4 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: -0.015008760973931355 0.153801142295301702 +< 1 -1 >: 0.030017521947862710 -0.307602284590603403 +< 2 -2 >: -0.030017521947862707 0.307602284590603348 +< 3 -3 >: 0.030017521947862707 -0.307602284590603348 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 4 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: -0.001151840097758326 0.013431027541694857 +< 1 -1 >: 0.002303680195516651 -0.026862055083389708 +< 2 -2 >: -0.002303680195516651 0.026862055083389708 +< 3 -3 >: 0.002303680195516651 -0.026862055083389708 +< 4 -4 >: -0.002303680195516651 0.026862055083389711 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 4 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: -0.000652423778863231 0.026695406667047394 +< 1 -1 >: 0.001304847557726462 -0.053390813334094789 +< 2 -2 >: -0.001304847557726462 0.053390813334094796 +< 3 -3 >: 0.001304847557726462 -0.053390813334094803 +< 4 -4 >: -0.001304847557726462 0.053390813334094796 +< 5 -5 >: 0.001304847557726461 -0.053390813334094740 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 4 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: -0.022661669008512072 -0.089577314277810058 +< 1 -1 >: 0.045323338017024151 0.179154628555620143 +< 2 -2 >: -0.045323338017024137 -0.179154628555620060 +< 3 -3 >: 0.045323338017024151 0.179154628555620143 +< 4 -4 >: -0.045323338017024123 -0.179154628555620032 +< 5 -5 >: 0.045323338017024137 0.179154628555620060 +< 6 -6 >: -0.045323338017024109 -0.179154628555619949 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 5 ) +l=( 0 0 ) +num_ms=1 +< 0 0 >: 0.000927204096660696 0.214065283656125371 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 5 ) +l=( 1 1 ) +num_ms=2 +< 0 0 >: 0.000094655033139699 0.004208753371838363 +< 1 -1 >: -0.000189310066279397 -0.008417506743676724 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 5 ) +l=( 2 2 ) +num_ms=3 +< 0 0 >: 0.000351584678183165 0.036688837956052121 +< 1 -1 >: -0.000703169356366331 -0.073377675912104257 +< 2 -2 >: 0.000703169356366331 0.073377675912104270 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 5 ) +l=( 3 3 ) +num_ms=4 +< 0 0 >: 0.002788351180694639 -0.034407768721874142 +< 1 -1 >: -0.005576702361389278 0.068815537443748284 +< 2 -2 >: 0.005576702361389277 -0.068815537443748284 +< 3 -3 >: -0.005576702361389277 0.068815537443748284 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 5 ) +l=( 4 4 ) +num_ms=5 +< 0 0 >: 0.000317570803659664 -0.001123830834830057 +< 1 -1 >: -0.000635141607319327 0.002247661669660114 +< 2 -2 >: 0.000635141607319327 -0.002247661669660114 +< 3 -3 >: -0.000635141607319327 0.002247661669660114 +< 4 -4 >: 0.000635141607319327 -0.002247661669660114 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 5 ) +l=( 5 5 ) +num_ms=6 +< 0 0 >: 0.000488890061324461 -0.017808170881300944 +< 1 -1 >: -0.000977780122648922 0.035616341762601887 +< 2 -2 >: 0.000977780122648922 -0.035616341762601894 +< 3 -3 >: -0.000977780122648922 0.035616341762601901 +< 4 -4 >: 0.000977780122648922 -0.035616341762601894 +< 5 -5 >: -0.000977780122648921 0.035616341762601852 +ctilde_basis_func: rank=2 ndens=2 mu0=0 mu=( 0 0 ) +n=( 5 5 ) +l=( 6 6 ) +num_ms=7 +< 0 0 >: 0.005721847329407898 0.062910453316038589 +< 1 -1 >: -0.011443694658815798 -0.125820906632077206 +< 2 -2 >: 0.011443694658815794 0.125820906632077151 +< 3 -3 >: -0.011443694658815798 -0.125820906632077206 +< 4 -4 >: 0.011443694658815791 0.125820906632077123 +< 5 -5 >: -0.011443694658815794 -0.125820906632077151 +< 6 -6 >: 0.011443694658815787 0.125820906632077067 From 29c78d022a1351f2f89d0bdd3dd274e0ad19ed08 Mon Sep 17 00:00:00 2001 From: Yury Lysogorskiy Date: Wed, 7 Apr 2021 19:54:35 +0200 Subject: [PATCH 04/23] add lib/pace/Makefile.lammps --- lib/pace/Makefile.lammps | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 lib/pace/Makefile.lammps diff --git a/lib/pace/Makefile.lammps b/lib/pace/Makefile.lammps new file mode 100644 index 0000000000..17820716df --- /dev/null +++ b/lib/pace/Makefile.lammps @@ -0,0 +1,3 @@ +pace_SYSINC =-I../../lib/pace/src/USER-PACE +pace_SYSLIB = -L../../lib/pace/ -lpace +pace_SYSPATH = From feda2dc08dc11502dd24dd7c2bc835a21924be95 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Wed, 7 Apr 2021 14:07:58 -0600 Subject: [PATCH 05/23] Updated doc page and spelling --- doc/src/pair_pace.rst | 4 ++-- doc/utils/sphinx-config/false_positives.txt | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/src/pair_pace.rst b/doc/src/pair_pace.rst index 1ebf6210cd..36baaa7ef9 100644 --- a/doc/src/pair_pace.rst +++ b/doc/src/pair_pace.rst @@ -59,9 +59,9 @@ Note that unlike for other potentials, cutoffs are not set in the pair_style or pair_coeff command; they are specified in the ACE file. -The pair_style *mliap* may be followed by an optional keyword +The pair_style *pace* command may be followed by an optional keyword *product* or *recursive*, which determines which of two algorithms - is used for the calculation of basis functions and derivatives. +is used for the calculation of basis functions and derivatives. The default is *recursive*. See the :doc:`pair_coeff ` doc page for alternate ways diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 38a6971f4c..9689125753 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -268,6 +268,7 @@ blueviolet bn bni bo +Bochkarev Bochum bocs bodyflag @@ -343,6 +344,7 @@ Cao Capolungo Caro cartesian +Cas CasP Caswell Cates @@ -1069,6 +1071,7 @@ fuer fx fy fz +Gabor Gahler gainsboro Galindo @@ -1193,6 +1196,7 @@ Halperin Halver Hamaker Hamel +Hammerschmidt haptic Hara Harpertown @@ -1743,6 +1747,7 @@ lx ly Lybrand lyon +Lysogorskiy Lyulin lz Maaravi @@ -1801,8 +1806,10 @@ Materias mathbf mathjax matlab +Matous matplotlib Matsubara +Matteo Mattice Mattox Mattson @@ -1863,6 +1870,7 @@ MEMALIGN membered memcheck Mendelev +Menon mer Meremianin Mersenne @@ -1986,6 +1994,7 @@ mpiio mpirun mplayer mps +Mrovec Mryglod mscg MSCG @@ -2311,6 +2320,7 @@ oneway onn ons OO +Oord opencl openKIM openmp @@ -2331,6 +2341,7 @@ Orsi ortho orthonormal orthorhombic +Ortner oso Otype Ouldridge @@ -2620,6 +2631,7 @@ radians Rafferty rahman Rahman +Ralf Raman ramped ramping @@ -2726,6 +2738,7 @@ Rij RIj Rik Rin +Rinaldi Rino RiRj Risi @@ -2814,6 +2827,7 @@ Sandia sandybrown sanitizer Sanyal +Sarath sc scafacos SCAFACOS From 0151fd00c281aac40fdebd88b76b5ef80e3c2c81 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Apr 2021 17:37:30 -0400 Subject: [PATCH 06/23] correct CMake support for USER-PACE package and align with recent conventions for downloading external code --- cmake/Modules/Packages/USER-PACE.cmake | 34 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/cmake/Modules/Packages/USER-PACE.cmake b/cmake/Modules/Packages/USER-PACE.cmake index c9e8e1bcfe..008d32444c 100644 --- a/cmake/Modules/Packages/USER-PACE.cmake +++ b/cmake/Modules/Packages/USER-PACE.cmake @@ -1,14 +1,26 @@ -set(PACE_EVALUATOR_PATH ${LAMMPS_LIB_SOURCE_DIR}/pace) -message("CMakeLists.txt DEBUG: PACE_EVALUATOR_PATH=${PACE_EVALUATOR_PATH}") -set(PACE_EVALUATOR_SRC_PATH ${PACE_EVALUATOR_PATH}) -FILE(GLOB PACE_EVALUATOR_SOURCE_FILES ${PACE_EVALUATOR_SRC_PATH}/*.cpp) -set(PACE_EVALUATOR_INCLUDE_DIR ${PACE_EVALUATOR_SRC_PATH}) +set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.2.3.tar.gz" CACHE STRING "URL for PACE evaluator library sources") +set(PACELIB_MD5 "9ebb087cba7e4ca041fde52f7e9e640c" CACHE STRING "MD5 checksum of PACE evaluator library tarball") +mark_as_advanced(PACELIB_URL) +mark_as_advanced(PACELIB_MD5) + +# download library sources to build folder +file(DOWNLOAD ${PACELIB_URL} libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5}) + +# uncompress downloaded sources +execute_process( + COMMAND ${CMAKE_COMMAND} -E remove_directory lammps-user-pace* + COMMAND ${CMAKE_COMMAND} -E tar xzf libpace.tar.gz + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +) -##### aceevaluator ##### -add_library(aceevaluator ${PACE_EVALUATOR_SOURCE_FILES}) -target_include_directories(aceevaluator PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR}) -target_compile_options(aceevaluator PRIVATE -O2) -set_target_properties(aceevaluator PROPERTIES OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) -target_link_libraries(lammps PRIVATE aceevaluator) \ No newline at end of file +file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE) +file(GLOB PACE_EVALUATOR_SOURCES ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE/*.cpp) +list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp) + +add_library(pace STATIC ${PACE_EVALUATOR_SOURCES}) +set_target_properties(pace PROPERTIES OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) +target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR}) +target_link_libraries(lammps PRIVATE pace) + From 7b34f025ee088212ee5d26ad62c993e8e7d80678 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Apr 2021 17:46:18 -0400 Subject: [PATCH 07/23] correct src/Makefile for USER-PACE --- src/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index bec0a2b16b..d5f0e600d6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -55,7 +55,7 @@ PACKUSER = user-adios user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-c user-diffraction user-dpd user-drude user-eff user-fep user-h5md \ user-intel user-lb user-manifold user-meamc user-mesodpd user-mesont \ user-mgpt user-misc user-mofff user-molfile \ - user-netcdf user-omp user-phonon user-plumed user-ptm user-qmmm \ + user-netcdf user-omp user-phonon user-pace user-plumed user-ptm user-qmmm \ user-qtb user-quip user-reaction user-reaxc user-scafacos user-smd user-smtbq \ user-sdpd user-sph user-tally user-uef user-vtk user-yaff @@ -70,8 +70,8 @@ PACKSYS = compress mpiio python user-lb PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars user-mesont PACKEXT = kim latte mscg voronoi \ - user-adios user-h5md user-molfile user-netcdf user-plumed user-qmmm user-quip \ - user-smd user-vtk user-pace + user-adios user-h5md user-molfile user-netcdf user-pace user-plumed \ + user-qmmm user-quip user-smd user-vtk PACKALL = $(PACKAGE) $(PACKUSER) From 084c0713d6e69fad23459782978fa4c73889f82b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Apr 2021 18:05:00 -0400 Subject: [PATCH 08/23] resolve whitespace issues --- doc/src/Packages_details.rst | 4 ++-- doc/src/pair_pace.rst | 26 +++++++++++++------------- src/USER-PACE/pair_pace.cpp | 2 +- src/USER-PACE/pair_pace.h | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 549ab3d8f0..1964a83717 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -1363,9 +1363,9 @@ fit to a large archive of quantum mechanical (DFT) data. The USER-PACE package provides an efficient implementation for running simulations with ACE potentials. -**Authors:** +**Authors:** -This package was written by Yury Lysogorskiy^1, +This package was written by Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1. diff --git a/doc/src/pair_pace.rst b/doc/src/pair_pace.rst index 36baaa7ef9..56ae0f32dc 100644 --- a/doc/src/pair_pace.rst +++ b/doc/src/pair_pace.rst @@ -15,8 +15,8 @@ Syntax .. parsed-literal:: - *product* = use product algorithm for basis functions - *recursive* = use recursive algorithm for basis functions + *product* = use product algorithm for basis functions + *recursive* = use recursive algorithm for basis functions Examples """""""" @@ -30,24 +30,24 @@ Examples Description """"""""""" -Pair style *pace* computes interactions using the Atomic Cluster -Expansion (ACE), which is a general expansion of the atomic energy in -multi-body basis functions. :ref:`(Drautz) `. -The *pace* pair style -provides an efficient implementation that +Pair style *pace* computes interactions using the Atomic Cluster +Expansion (ACE), which is a general expansion of the atomic energy in +multi-body basis functions. :ref:`(Drautz) `. +The *pace* pair style +provides an efficient implementation that is described in this paper :ref:`(Lysogorskiy) `. In ACE, the total energy is decomposed into a sum over -atomic energies. The energy of atom *i* is expressed as a -linear or non-linear function of one or more density functions. +atomic energies. The energy of atom *i* is expressed as a +linear or non-linear function of one or more density functions. By projecting the density onto a local atomic base, the lowest order contributions to the energy can be expressed as a set of scalar polynomials in basis function contributions summed over neighbor atoms. Only a single pair_coeff command is used with the *pace* style which -specifies an ACE coefficient file followed by N additional arguments -specifying the mapping of ACE elements to LAMMPS atom types, +specifies an ACE coefficient file followed by N additional arguments +specifying the mapping of ACE elements to LAMMPS atom types, where N is the number of LAMMPS atom types: * ACE coefficient file @@ -61,7 +61,7 @@ the ACE file. The pair_style *pace* command may be followed by an optional keyword *product* or *recursive*, which determines which of two algorithms -is used for the calculation of basis functions and derivatives. +is used for the calculation of basis functions and derivatives. The default is *recursive*. See the :doc:`pair_coeff ` doc page for alternate ways @@ -92,7 +92,7 @@ Restrictions """""""""""" This pair style is part of the USER-PACE package. It is only enabled if LAMMPS -was built with that package. +was built with that package. See the :doc:`Build package ` doc page for more info. Related commands diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index a515b7b4b0..ee1922d886 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -446,7 +446,7 @@ double PairPACE::init_one(int i, int j) { return basis_set->radial_functions->cut(map[i], map[j]); } -/* ---------------------------------------------------------------------- +/* ---------------------------------------------------------------------- extract method for extracting value of scale variable ---------------------------------------------------------------------- */ void *PairPACE::extract(const char *str, int &dim) diff --git a/src/USER-PACE/pair_pace.h b/src/USER-PACE/pair_pace.h index 3fccbd98f0..76b08a65c0 100644 --- a/src/USER-PACE/pair_pace.h +++ b/src/USER-PACE/pair_pace.h @@ -94,4 +94,4 @@ namespace LAMMPS_NS { } #endif -#endif \ No newline at end of file +#endif From 2d1fc67b5df7d47c425565c96e208794e7c2a5bb Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Apr 2021 19:09:43 -0400 Subject: [PATCH 09/23] update .gitignore --- src/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/.gitignore b/src/.gitignore index 6fa3aef513..96a89ae667 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -32,6 +32,9 @@ /pair_kim.cpp /pair_kim.h +/pair_pace.cpp +/pair_pace.h + /superpose3d.h /kokkos.cpp From 2d4b05ffa6db866f30ae100754677ae6bdcd9d6d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Apr 2021 19:13:10 -0400 Subject: [PATCH 10/23] refactor code to more closely match LAMMPS coding conventions - update indentation to 2 characters - remove dead code and unused class members - use convenience functions in many places - reuse code and members from Pair base class - declare local functions/variables static - PIMPL-ify access to the ACE evaluator library functions/classes - correct settings member variables to match implementation --- src/USER-PACE/pair_pace.cpp | 538 ++++++++++++++++-------------------- src/USER-PACE/pair_pace.h | 60 ++-- 2 files changed, 250 insertions(+), 348 deletions(-) diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index ee1922d886..527f2a6f06 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -28,25 +28,33 @@ Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, // Created by Lysogorskiy Yury on 27.02.20. // -#include -#include -#include -#include #include "pair_pace.h" + #include "atom.h" -#include "neighbor.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_const.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "error.h" +#include "neighbor.h" +#include +#include -#include "math_const.h" - +#include "ace_evaluator.h" +#include "ace_recursive.h" +#include "ace_c_basis.h" #include "ace_version.h" +namespace LAMMPS_NS { + struct ACEImpl { + ACECTildeBasisSet *basis_set; + ACERecursiveEvaluator *ace; + }; +} + using namespace LAMMPS_NS; using namespace MathConst; @@ -59,9 +67,8 @@ using namespace MathConst; #define RECURSIVE_KEYWORD "recursive" #define PRODUCT_KEYWORD "product" - -int elements_num_pace = 104; -char const *const elements_pace[104] = {"X", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", +static int elements_num_pace = 104; +static char const *const elements_pace[104] = {"X", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", @@ -71,27 +78,26 @@ char const *const elements_pace[104] = {"X", "H", "He", "Li", "Be", "B", "C", "N "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", "Fm", "Md", "No", "Lr" }; -int AtomicNumberByName_pace(char *elname) { - for (int i = 1; i < elements_num_pace; i++) - if (strcmp(elname, elements_pace[i]) == 0) - return i; - return -1; +static int AtomicNumberByName_pace(char *elname) { + for (int i = 1; i < elements_num_pace; i++) + if (strcmp(elname, elements_pace[i]) == 0) + return i; + return -1; } - /* ---------------------------------------------------------------------- */ PairPACE::PairPACE(LAMMPS *lmp) : Pair(lmp) { - //single_enable = 0; - restartinfo = 0; - one_coeff = 1; - manybody_flag = 1; + single_enable = 0; + restartinfo = 0; + one_coeff = 1; + manybody_flag = 1; - nelements = 0; + aceimpl = new ACEImpl; + aceimpl->ace = nullptr; + aceimpl->basis_set = nullptr; + recursive = false; - ace = NULL; - potential_file_name = NULL; - elements = NULL; - map = NULL; + scale = nullptr; } /* ---------------------------------------------------------------------- @@ -99,170 +105,157 @@ PairPACE::PairPACE(LAMMPS *lmp) : Pair(lmp) { ------------------------------------------------------------------------- */ PairPACE::~PairPACE() { - if (copymode) return; + if (copymode) return; - if (elements) - for (int i = 0; i < nelements; i++) delete[] elements[i]; - delete[] elements; + delete aceimpl->basis_set; + delete aceimpl->ace; + delete aceimpl; - - delete[] potential_file_name; - - delete basis_set; - delete ace; - - if (allocated) { - memory->destroy(setflag); - memory->destroy(cutsq); - memory->destroy(map); - memory->destroy(scale); - } + if (allocated) { + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(scale); + } } /* ---------------------------------------------------------------------- */ void PairPACE::compute(int eflag, int vflag) { - int i, j, ii, jj, inum, jnum; - double delx, dely, delz, evdwl; - double fij[3]; - int *ilist, *jlist, *numneigh, **firstneigh; + int i, j, ii, jj, inum, jnum; + double delx, dely, delz, evdwl; + double fij[3]; + int *ilist, *jlist, *numneigh, **firstneigh; - ev_init(eflag, vflag); + ev_init(eflag, vflag); - // downwards modified by YL + // downwards modified by YL - double **x = atom->x; - double **f = atom->f; - tagint *tag = atom->tag; - int *type = atom->type; + double **x = atom->x; + double **f = atom->f; + tagint *tag = atom->tag; + int *type = atom->type; - // number of atoms in cell - int nlocal = atom->nlocal; + // number of atoms in cell + int nlocal = atom->nlocal; - int newton_pair = force->newton_pair; + int newton_pair = force->newton_pair; - // number of atoms including ghost atoms - int nall = nlocal + atom->nghost; + // number of atoms including ghost atoms + int nall = nlocal + atom->nghost; - // inum: length of the neighborlists list - inum = list->inum; + // inum: length of the neighborlists list + inum = list->inum; - // ilist: list of "i" atoms for which neighbor lists exist - ilist = list->ilist; + // ilist: list of "i" atoms for which neighbor lists exist + ilist = list->ilist; - //numneigh: the length of each these neigbor list - numneigh = list->numneigh; + //numneigh: the length of each these neigbor list + numneigh = list->numneigh; - // the pointer to the list of neighbors of "i" - firstneigh = list->firstneigh; + // the pointer to the list of neighbors of "i" + firstneigh = list->firstneigh; - if (inum != nlocal) { - char str[128]; - snprintf(str,128,"inum: %d nlocal: %d are different",inum, nlocal); - error->all(FLERR,str); + if (inum != nlocal) + error->all(FLERR,fmt::format("inum: {} nlocal: {} are different",inum, nlocal)); + + // Aidan Thompson told RD (26 July 2019) that practically always holds: + // inum = nlocal + // i = ilist(ii) < inum + // j = jlist(jj) < nall + // neighborlist contains neighbor atoms plus skin atoms, + // skin atoms can be removed by setting skin to zero but here + // they are disregarded anyway + + + //determine the maximum number of neighbours + int max_jnum = -1; + int nei = 0; + for (ii = 0; ii < list->inum; ii++) { + i = ilist[ii]; + jnum = numneigh[i]; + nei = nei + jnum; + if (jnum > max_jnum) + max_jnum = jnum; + } + + aceimpl->ace->resize_neighbours_cache(max_jnum); + + //loop over atoms + for (ii = 0; ii < list->inum; ii++) { + i = list->ilist[ii]; + const int itype = type[i]; + + const double xtmp = x[i][0]; + const double ytmp = x[i][1]; + const double ztmp = x[i][2]; + + jlist = firstneigh[i]; + jnum = numneigh[i]; + + // checking if neighbours are actually within cutoff range is done inside compute_atom + // mapping from LAMMPS atom types ('type' array) to ACE species is done inside compute_atom + // by using 'aceimpl->ace->element_type_mapping' array + // x: [r0 ,r1, r2, ..., r100] + // i = 0 ,1 + // jnum(0) = 50 + // jlist(neigh ind of 0-atom) = [1,2,10,7,99,25, .. 50 element in total] + + try { + aceimpl->ace->compute_atom(i, x, type, jnum, jlist); + } catch (exception &e) { + error->one(FLERR, e.what()); + } + // 'compute_atom' will update the `aceimpl->ace->e_atom` and `aceimpl->ace->neighbours_forces(jj, alpha)` arrays + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + const int jtype = type[j]; + j &= NEIGHMASK; + delx = x[j][0] - xtmp; + dely = x[j][1] - ytmp; + delz = x[j][2] - ztmp; + + fij[0] = scale[itype][jtype]*aceimpl->ace->neighbours_forces(jj, 0); + fij[1] = scale[itype][jtype]*aceimpl->ace->neighbours_forces(jj, 1); + fij[2] = scale[itype][jtype]*aceimpl->ace->neighbours_forces(jj, 2); + + f[i][0] += fij[0]; + f[i][1] += fij[1]; + f[i][2] += fij[2]; + f[j][0] -= fij[0]; + f[j][1] -= fij[1]; + f[j][2] -= fij[2]; + + // tally per-atom virial contribution + if (vflag) + ev_tally_xyz(i, j, nlocal, newton_pair, 0.0, 0.0, + fij[0], fij[1], fij[2], + -delx, -dely, -delz); } - - // Aidan Thompson told RD (26 July 2019) that practically always holds: - // inum = nlocal - // i = ilist(ii) < inum - // j = jlist(jj) < nall - // neighborlist contains neighbor atoms plus skin atoms, - // skin atoms can be removed by setting skin to zero but here - // they are disregarded anyway - - - //determine the maximum number of neighbours - int max_jnum = -1; - int nei = 0; - for (ii = 0; ii < list->inum; ii++) { - i = ilist[ii]; - jnum = numneigh[i]; - nei = nei + jnum; - if (jnum > max_jnum) - max_jnum = jnum; + // tally energy contribution + if (eflag) { + // evdwl = energy of atom I + evdwl = scale[1][1]*aceimpl->ace->e_atom; + ev_tally_full(i, 2.0 * evdwl, 0.0, 0.0, 0.0, 0.0, 0.0); } + } - ace->resize_neighbours_cache(max_jnum); + if (vflag_fdotr) virial_fdotr_compute(); - //loop over atoms - for (ii = 0; ii < list->inum; ii++) { - i = list->ilist[ii]; - const int itype = type[i]; - - const double xtmp = x[i][0]; - const double ytmp = x[i][1]; - const double ztmp = x[i][2]; - - jlist = firstneigh[i]; - jnum = numneigh[i]; - - // checking if neighbours are actually within cutoff range is done inside compute_atom - // mapping from LAMMPS atom types ('type' array) to ACE species is done inside compute_atom - // by using 'ace->element_type_mapping' array - // x: [r0 ,r1, r2, ..., r100] - // i = 0 ,1 - // jnum(0) = 50 - // jlist(neigh ind of 0-atom) = [1,2,10,7,99,25, .. 50 element in total] - try { - ace->compute_atom(i, x, type, jnum, jlist); - } catch (exception &e) { - error->all(FLERR, e.what()); - exit(EXIT_FAILURE); - } - // 'compute_atom' will update the `ace->e_atom` and `ace->neighbours_forces(jj, alpha)` arrays - - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - const int jtype = type[j]; - j &= NEIGHMASK; - delx = x[j][0] - xtmp; - dely = x[j][1] - ytmp; - delz = x[j][2] - ztmp; - - fij[0] = scale[itype][jtype]*ace->neighbours_forces(jj, 0); - fij[1] = scale[itype][jtype]*ace->neighbours_forces(jj, 1); - fij[2] = scale[itype][jtype]*ace->neighbours_forces(jj, 2); - - - f[i][0] += fij[0]; - f[i][1] += fij[1]; - f[i][2] += fij[2]; - f[j][0] -= fij[0]; - f[j][1] -= fij[1]; - f[j][2] -= fij[2]; - - // tally per-atom virial contribution - if (vflag) - ev_tally_xyz(i, j, nlocal, newton_pair, 0.0, 0.0, - fij[0], fij[1], fij[2], - -delx, -dely, -delz); - } - - // tally energy contribution - if (eflag) { - // evdwl = energy of atom I - evdwl = scale[1][1]*ace->e_atom; - ev_tally_full(i, 2.0 * evdwl, 0.0, 0.0, 0.0, 0.0, 0.0); - } - } - - if (vflag_fdotr) virial_fdotr_compute(); - - - // end modifications YL + // end modifications YL } /* ---------------------------------------------------------------------- */ void PairPACE::allocate() { - allocated = 1; - int n = atom->ntypes; + allocated = 1; + int n = atom->ntypes; - memory->create(setflag, n + 1, n + 1, "pair:setflag"); - memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); - memory->create(map, n + 1, "pair:map"); - memory->create(scale, n + 1, n + 1,"pair:scale"); + memory->create(setflag, n + 1, n + 1, "pair:setflag"); + memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); + memory->create(scale, n + 1, n + 1,"pair:scale"); + map = new int[n+1]; } /* ---------------------------------------------------------------------- @@ -270,41 +263,24 @@ void PairPACE::allocate() { ------------------------------------------------------------------------- */ void PairPACE::settings(int narg, char **arg) { - if (narg > 1) { - error->all(FLERR, - "Illegal pair_style command. Correct form:\n\tpair_style pace\nor\n\tpair_style pace "); - error->all(FLERR, RECURSIVE_KEYWORD); - error->all(FLERR, "or\n\tpair_style pace "); - error->all(FLERR, PRODUCT_KEYWORD); - } - recursive = true; // default evaluator style: RECURSIVE - if (narg > 0) { - if (strcmp(arg[0], RECURSIVE_KEYWORD) == 0) - recursive = true; - else if (strcmp(arg[0], PRODUCT_KEYWORD) == 0) { - recursive = false; - } else { - error->all(FLERR, - "Illegal pair_style command: pair_style pace "); - error->all(FLERR, arg[0]); - error->all(FLERR, "\nCorrect form:\n\tpair_style pace\nor\n\tpair_style pace recursive"); - } - } - - if (comm->me == 0) { - if (screen) fprintf(screen, "ACE version: %d.%d.%d\n", VERSION_YEAR, VERSION_MONTH, VERSION_DAY); - if (logfile) fprintf(logfile, "ACE version: %d.%d.%d\n", VERSION_YEAR, VERSION_MONTH, VERSION_DAY); - - if (recursive) { - if (screen) fprintf(screen, "Recursive evaluator is used\n"); - if (logfile) fprintf(logfile, "Recursive evaluator is used\n"); - } else { - if (screen) fprintf(screen, "Product evaluator is used\n"); - if (logfile) fprintf(logfile, "Product evaluator is used\n"); - } - } + if (narg > 1) + error->all(FLERR,"Illegal pair_style command."); + recursive = true; // default evaluator style: RECURSIVE + if (narg > 0) { + if (strcmp(arg[0], RECURSIVE_KEYWORD) == 0) + recursive = true; + else if (strcmp(arg[0], PRODUCT_KEYWORD) == 0) { + recursive = false; + } else error->all(FLERR,"Illegal pair_style command"); + } + if (comm->me == 0) { + utils::logmesg(lmp,fmt::format("ACE version: {}.{}.{}\n", + VERSION_YEAR, VERSION_MONTH, VERSION_DAY)); + if (recursive) utils::logmesg(lmp,"Recursive evaluator is used\n"); + else utils::logmesg(lmp,"Product evaluator is used\n"); + } } /* ---------------------------------------------------------------------- @@ -313,110 +289,64 @@ void PairPACE::settings(int narg, char **arg) { void PairPACE::coeff(int narg, char **arg) { - if (narg < 4) - error->all(FLERR, - "Incorrect args for pair coefficients. Correct form:\npair_coeff * * elem1 elem2 ..."); + if (!allocated) allocate(); - if (!allocated) allocate(); + map_element2type(narg-3,arg+3); - //number of provided elements in pair_coeff line - int ntypes_coeff = narg - 3; + char *potential_file_name = arg[2]; + char **elemtypes = &arg[3]; - if (ntypes_coeff != atom->ntypes) { - char error_message[1024]; - snprintf(error_message, 1024, - "Incorrect args for pair coefficients. You provided %d elements in pair_coeff, but structure has %d atom types", - ntypes_coeff, atom->ntypes); - error->all(FLERR, error_message); + //load potential file + aceimpl->basis_set = new ACECTildeBasisSet(); + if (comm->me == 0) + utils::logmesg(lmp,fmt::format("Loading {}\n", potential_file_name)); + aceimpl->basis_set->load(potential_file_name); + + if (comm->me == 0) { + utils::logmesg(lmp,"Total number of basis functions\n"); + + for (SPECIES_TYPE mu = 0; mu < aceimpl->basis_set->nelements; mu++) { + int n_r1 = aceimpl->basis_set->total_basis_size_rank1[mu]; + int n = aceimpl->basis_set->total_basis_size[mu]; + utils::logmesg(lmp,fmt::format("\t{}: {} (r=1) {} (r>1)\n", aceimpl->basis_set->elements_name[mu], n_r1, n)); } + } - char *type1 = arg[0]; - char *type2 = arg[1]; - char *potential_file_name = arg[2]; - char **elemtypes = &arg[3]; + // read args that map atom types to pACE elements + // map[i] = which element the Ith atom type is, -1 if not mapped + // map[0] is not used - // insure I,J args are * * + aceimpl->ace = new ACERecursiveEvaluator(); + aceimpl->ace->set_recursive(recursive); + aceimpl->ace->element_type_mapping.init(atom->ntypes + 1); - if (strcmp(type1, "*") != 0 || strcmp(type2, "*") != 0) - error->all(FLERR, "Incorrect args for pair coefficients"); + const int n = atom->ntypes; + for (int i = 1; i <= n; i++) { + char *elemname = elemtypes[i - 1]; + int atomic_number = AtomicNumberByName_pace(elemname); + if (atomic_number == -1) + error->all(FLERR,fmt::format("'{}' is not a valid element\n", elemname)); - - //load potential file - basis_set = new ACECTildeBasisSet(); - if (comm->me == 0) { - if (screen) fprintf(screen, "Loading %s\n", potential_file_name); - if (logfile) fprintf(logfile, "Loading %s\n", potential_file_name); + SPECIES_TYPE mu = aceimpl->basis_set->get_species_index_by_name(elemname); + if (mu != -1) { + if (comm->me == 0) + utils::logmesg(lmp,fmt::format("Mapping LAMMPS atom type #{}({}) -> " + "ACE species type #{}\n", i, elemname, mu)); + map[i] = mu; + aceimpl->ace->element_type_mapping(i) = mu; // set up LAMMPS atom type to ACE species mapping for ace evaluator + } else { + error->all(FLERR, fmt::format("Element {} is not supported by ACE-potential from file {}", elemname,potential_file_name)); } - basis_set->load(potential_file_name); + } - if (comm->me == 0) { - if (screen) fprintf(screen, "Total number of basis functions\n"); - if (logfile) fprintf(logfile, "Total number of basis functions\n"); - - for (SPECIES_TYPE mu = 0; mu < basis_set->nelements; mu++) { - int n_r1 = basis_set->total_basis_size_rank1[mu]; - int n = basis_set->total_basis_size[mu]; - if (screen) fprintf(screen, "\t%s: %d (r=1) %d (r>1)\n", basis_set->elements_name[mu].c_str(), n_r1, n); - if (logfile) fprintf(logfile, "\t%s: %d (r=1) %d (r>1)\n", basis_set->elements_name[mu].c_str(), n_r1, n); - } + // initialize scale factor + for (int i = 1; i <= n; i++) { + for (int j = i; j <= n; j++) { + scale[i][j] = 1.0; } + } - // read args that map atom types to pACE elements - // map[i] = which element the Ith atom type is, -1 if not mapped - // map[0] is not used - - ace = new ACERecursiveEvaluator(); - ace->set_recursive(recursive); - ace->element_type_mapping.init(atom->ntypes + 1); - - for (int i = 1; i <= atom->ntypes; i++) { - char *elemname = elemtypes[i - 1]; - int atomic_number = AtomicNumberByName_pace(elemname); - if (atomic_number == -1) { - char error_msg[1024]; - snprintf(error_msg, 1024, "String '%s' is not a valid element\n", elemname); - error->all(FLERR, error_msg); - } - SPECIES_TYPE mu = basis_set->get_species_index_by_name(elemname); - if (mu != -1) { - if (comm->me == 0) { - if (screen) - fprintf(screen, "Mapping LAMMPS atom type #%d(%s) -> ACE species type #%d\n", i, elemname, mu); - if (logfile) - fprintf(logfile, "Mapping LAMMPS atom type #%d(%s) -> ACE species type #%d\n", i, elemname, mu); - } - map[i] = mu; - ace->element_type_mapping(i) = mu; // set up LAMMPS atom type to ACE species mapping for ace evaluator - } else { - char error_msg[1024]; - snprintf(error_msg, 1024, "Element %s is not supported by ACE-potential from file %s", elemname, - potential_file_name); - error->all(FLERR, error_msg); - } - } - - // clear setflag since coeff() called once with I,J = * * - int n = atom->ntypes; - for (int i = 1; i <= n; i++) { - for (int j = i; j <= n; j++) { - setflag[i][j] = 1; - scale[i][j] = 1.0; - } - } - - // set setflag i,j for type pairs where both are mapped to elements - - int count = 1; - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) - if (map[i] >= 0 && map[j] >= 0) { - setflag[i][j] = 1; - count++; - } - - if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients"); - - ace->set_basis(*basis_set, 1); + aceimpl->ace->set_basis(*aceimpl->basis_set, 1); } /* ---------------------------------------------------------------------- @@ -424,15 +354,15 @@ void PairPACE::coeff(int narg, char **arg) { ------------------------------------------------------------------------- */ void PairPACE::init_style() { - if (atom->tag_enable == 0) - error->all(FLERR, "Pair style pACE requires atom IDs"); - if (force->newton_pair == 0) - error->all(FLERR, "Pair style pACE requires newton pair on"); + if (atom->tag_enable == 0) + error->all(FLERR, "Pair style pACE requires atom IDs"); + if (force->newton_pair == 0) + error->all(FLERR, "Pair style pACE requires newton pair on"); - // request a full neighbor list - int irequest = neighbor->request(this, instance_me); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->full = 1; + // request a full neighbor list + int irequest = neighbor->request(this, instance_me); + neighbor->requests[irequest]->half = 0; + neighbor->requests[irequest]->full = 1; } /* ---------------------------------------------------------------------- @@ -440,10 +370,10 @@ void PairPACE::init_style() { ------------------------------------------------------------------------- */ double PairPACE::init_one(int i, int j) { - if (setflag[i][j] == 0) error->all(FLERR, "All pair coeffs are not set"); - //cutoff from the basis set's radial functions settings - scale[j][i] = scale[i][j]; - return basis_set->radial_functions->cut(map[i], map[j]); + if (setflag[i][j] == 0) error->all(FLERR, "All pair coeffs are not set"); + //cutoff from the basis set's radial functions settings + scale[j][i] = scale[i][j]; + return aceimpl->basis_set->radial_functions->cut(map[i], map[j]); } /* ---------------------------------------------------------------------- @@ -451,8 +381,8 @@ double PairPACE::init_one(int i, int j) { ---------------------------------------------------------------------- */ void *PairPACE::extract(const char *str, int &dim) { - dim = 2; - if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + dim = 2; + if (strcmp(str,"scale") == 0) return (void *) scale; + return nullptr; } diff --git a/src/USER-PACE/pair_pace.h b/src/USER-PACE/pair_pace.h index 76b08a65c0..b29ee3a7a9 100644 --- a/src/USER-PACE/pair_pace.h +++ b/src/USER-PACE/pair_pace.h @@ -39,58 +39,30 @@ PairStyle(pace,PairPACE) #define LMP_PAIR_PACE_H #include "pair.h" -#include "ace_evaluator.h" -#include "ace_recursive.h" -#include "ace_c_basis.h" namespace LAMMPS_NS { - class PairPACE : public Pair { - public: - PairPACE(class LAMMPS *); +class PairPACE : public Pair { + public: + PairPACE(class LAMMPS *); + virtual ~PairPACE(); - virtual ~PairPACE(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + virtual void init_style(); + double init_one(int, int); - virtual void compute(int, int); + void *extract(const char *, int &); - void settings(int, char **); + protected: + struct ACEImpl *aceimpl; - void coeff(int, char **); - - virtual void init_style(); - - double init_one(int, int); - - void *extract(const char *, int &); - - // virtual double memory_usage(); - - protected: - ACECTildeBasisSet *basis_set = nullptr; - - ACERecursiveEvaluator *ace = nullptr; - - char *potential_file_name; - - virtual void allocate(); - - void read_files(char *, char *); - - inline int equal(double *x, double *y); - - - double rcutmax; // max cutoff for all elements - int nelements; // # of unique elements - char **elements; // names of unique elements - - int *map; // mapping from atom types to elements - int *jlist_local; - int *type_local; - double **scale; - - bool recursive = false; // "recursive" option for ACERecursiveEvaluator - }; + virtual void allocate(); + double **scale; + bool recursive; // "recursive" option for ACERecursiveEvaluator +}; } #endif From b57025523f58da4ceab22319986e06db4e29ac6a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Apr 2021 19:28:02 -0400 Subject: [PATCH 11/23] honor LAMMPS_POTENTIALS environment variable when loading potential file --- src/USER-PACE/pair_pace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index 527f2a6f06..41551e454c 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -293,7 +293,7 @@ void PairPACE::coeff(int narg, char **arg) { map_element2type(narg-3,arg+3); - char *potential_file_name = arg[2]; + auto potential_file_name = utils::get_potential_file_path(arg[2]); char **elemtypes = &arg[3]; //load potential file From f6f383bf99b33e745be64d6734dd204d87a009f5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Apr 2021 19:29:22 -0400 Subject: [PATCH 12/23] add .gitignore file to lib/pace folder --- lib/pace/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 lib/pace/.gitignore diff --git a/lib/pace/.gitignore b/lib/pace/.gitignore new file mode 100644 index 0000000000..0598083baa --- /dev/null +++ b/lib/pace/.gitignore @@ -0,0 +1,2 @@ +/src +/libpace.a From 8a233a5ec77292123670e5e0856bd032530e0fad Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 7 Apr 2021 19:30:38 -0400 Subject: [PATCH 13/23] add unit test reference data for USER-PACE --- .../tests/manybody-pair-pace_product.yaml | 156 ++++++++++++++++++ .../tests/manybody-pair-pace_recursive.yaml | 156 ++++++++++++++++++ 2 files changed, 312 insertions(+) create mode 100644 unittest/force-styles/tests/manybody-pair-pace_product.yaml create mode 100644 unittest/force-styles/tests/manybody-pair-pace_recursive.yaml diff --git a/unittest/force-styles/tests/manybody-pair-pace_product.yaml b/unittest/force-styles/tests/manybody-pair-pace_product.yaml new file mode 100644 index 0000000000..21c37c49be --- /dev/null +++ b/unittest/force-styles/tests/manybody-pair-pace_product.yaml @@ -0,0 +1,156 @@ +--- +lammps_version: 10 Mar 2021 +date_generated: Wed Apr 7 19:29:52 2021 +epsilon: 5e-13 +skip_tests: +prerequisites: ! | + pair pace +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! "" +input_file: in.manybody +pair_style: pace product +pair_coeff: ! | + * * Cu-PBE-core-rep.ace Cu Cu Cu Cu Cu Cu Cu Cu +extract: ! "" +natoms: 64 +init_vdwl: -161.633164433256 +init_coul: 0 +init_stress: ! |2- + 4.9972088100615499e+00 6.2044830913935627e+00 9.1051638867046787e+00 -3.5472278350778463e+00 1.6694265484458743e+01 1.2476127820340779e+00 +init_forces: ! |2 + 1 -6.2219087614981250e-01 1.4663175178944543e+00 1.0137638901413766e+00 + 2 -1.1376106569501299e+00 -4.6174763313965872e-01 -9.1065044746775559e-01 + 3 2.1030321840370370e-01 -1.8491702608421043e-01 2.5692785978237719e-02 + 4 -8.7721996834879601e-01 1.5265564953914739e+00 6.4946175447488763e-01 + 5 -4.2522149043165169e-01 -3.7218018176382173e-01 -9.1663252333251566e-02 + 6 3.7791326544489656e-01 1.2266089287989812e+00 2.9557107319921827e-01 + 7 -5.3020873901893739e-01 -5.3124732660122731e-01 7.0401499321631211e-01 + 8 -4.7453371627778157e-02 2.6914766341308627e-01 -3.4048361271920741e-01 + 9 -1.5727338601129420e-01 -8.3756943998984656e-01 -1.0686980500960253e+00 + 10 4.1485698120166843e-03 -4.7811767918434078e-01 -1.0586891580297206e+00 + 11 1.5438259205363782e+00 -1.5050047785033229e+00 9.6197857985461699e-01 + 12 -2.5123830465559287e+00 -1.7362105833106261e+00 -1.6289247068121975e+00 + 13 -5.9061498165333037e-01 2.3625898287840648e+00 -3.1399719632578482e-01 + 14 -5.5397546653775487e-01 1.8689085709447488e+00 -2.3086691928371150e-02 + 15 -1.6265821570337315e+00 1.7928198829778783e+00 -1.7156140339072117e+00 + 16 8.1679939937581825e-01 3.9772968007052850e-01 3.1004730854830331e+00 + 17 1.0595934046175022e+00 1.1460004586855164e+00 -1.8847997843937443e+00 + 18 2.0249462959828027e-01 2.6186197454749149e-01 1.4401663320550588e+00 + 19 -5.4631311118700510e-01 -7.9893542481115554e-01 -3.9498484189193867e-01 + 20 -2.7894722368446363e+00 3.3102350276296261e-01 1.9153108358696447e-01 + 21 7.2621138168723165e-01 -6.2245359068793776e-02 -1.1867468416622704e+00 + 22 -2.8699857742027954e+00 2.0263873921216695e+00 -2.5768047926156896e+00 + 23 6.7173035813894433e-01 1.1304059874438197e+00 9.5707129936936708e-01 + 24 8.1087520346689013e-01 9.3244931025572342e-01 1.2800553902585901e+00 + 25 2.8247847798959724e-01 -1.2561285000275449e-01 5.0249723343582131e-01 + 26 -1.2883224887965014e-01 -1.4823080811794720e-01 2.1451743731744269e-01 + 27 8.7218773747963574e-01 -4.8694991909043589e-01 8.0838245267066877e-01 + 28 -8.4108903261132240e-03 4.7660038551589268e-01 2.2692513770082767e+00 + 29 -1.2657298236003225e+00 5.0651440211205545e-01 -4.8138238615461226e-01 + 30 -4.9017825771987117e-01 4.3447662476279558e-01 -3.4664013847475933e-01 + 31 -5.2051576149994172e-01 3.8596959394993430e-01 -3.4070818553119930e-01 + 32 -1.3692783712259324e+00 1.9224558097577280e-01 -2.3226212734495302e-01 + 33 2.0607521792189685e+00 -1.2673195197857356e+00 1.6670068237762361e+00 + 34 -4.3444509217934746e-02 -3.3223620460414396e-02 1.7607017023404770e-01 + 35 5.0753059936755485e-01 -3.2385224472005308e-01 1.0142288303361275e+00 + 36 1.3677004996446801e-01 -9.3517724534410873e-01 2.4335569461986416e-02 + 37 -7.4579131173355373e-01 8.8843839477814257e-01 -9.4789414920423842e-01 + 38 3.9719539842505980e-02 -1.5258728344629927e-01 8.3622980382132700e-03 + 39 8.1730755341737116e-01 -9.8384548843887609e-01 -1.6996132976225720e+00 + 40 1.7801146130924872e+00 -1.1427274274008914e+00 -6.5983603408485103e-01 + 41 5.2820539468557050e-03 -2.3421071155474642e-02 -2.2563348155755425e-01 + 42 -1.5456364604619246e+00 -8.8225129116518508e-01 -5.8763735424108920e-01 + 43 1.1131408674714505e-01 -2.2247577888201988e+00 9.9728168268816919e-02 + 44 1.3854946872101335e+00 -1.5126948458101386e+00 9.7414222691400487e-01 + 45 -4.5981549862059468e-01 8.1397756884858363e-01 -1.3541793681441523e+00 + 46 -6.2619038173039365e-01 -8.2735236769680287e-01 2.2798662790638051e+00 + 47 1.0779718530622200e+00 5.2605298038101200e-01 6.1701114081825081e-01 + 48 3.8637284054399190e-01 3.0866805709781331e-01 -1.6028037248104018e-01 + 49 -8.8513638517173976e-01 -2.2564795567224198e+00 -1.4543286189784184e+00 + 50 4.0710335798111497e-01 1.0605235322146205e+00 -3.9752095773786261e-01 + 51 -9.1955086227825678e-01 1.6763661105933092e+00 1.6016036592489016e+00 + 52 2.4999859814585754e+00 -2.4516798161916005e+00 2.9455125031924960e+00 + 53 1.3494715555333863e+00 1.5041935505267137e+00 1.1203406583029385e+00 + 54 1.0781523968729976e+00 -1.1923649286227966e+00 -9.5279276661349610e-01 + 55 8.9808463906224834e-01 -1.4591385038403597e+00 -1.5496340042814589e+00 + 56 -1.6781965313765140e-01 2.7770530096449575e-01 -9.0012005317367583e-01 + 57 8.4669616061380487e-02 -3.6858526486025139e-01 -5.9756791316798570e-02 + 58 8.5722805697043558e-01 -4.6399147930805790e-01 3.6325830284450400e-01 + 59 1.6110642872174779e+00 9.9355375331449325e-01 -9.4982017793350748e-01 + 60 -1.3129344859566598e+00 -2.5250923468261077e+00 -1.6935614677383237e+00 + 61 -4.4869257920465672e-02 6.9444242511398624e-01 -2.4196506339842316e-01 + 62 -1.1637776716822190e+00 1.1834011745844724e+00 -9.3135952930487587e-01 + 63 9.6457625131492997e-01 -1.4202510282595555e+00 -6.5977083749846954e-01 + 64 1.3468893282796701e+00 1.5138254987169797e+00 2.7159451744492960e+00 +run_vdwl: -161.618480729195 +run_coul: 0 +run_stress: ! |2- + 4.9994648190802469e+00 6.2341889704204814e+00 9.1844870434928065e+00 -3.5139192287217877e+00 1.6660134035412678e+01 1.4298492052949148e+00 +run_forces: ! |2 + 1 -6.2816679628833150e-01 1.4637637672487021e+00 1.0165317420170146e+00 + 2 -1.1422624515775013e+00 -4.7321268150877716e-01 -9.1937052724928292e-01 + 3 1.9863435270459309e-01 -1.8101272698051718e-01 3.8842917970335344e-02 + 4 -8.6907185029044620e-01 1.5294385374560244e+00 6.4103701764704912e-01 + 5 -4.3303851444525354e-01 -3.7930261859668579e-01 -8.2809410717883475e-02 + 6 3.9940995017594572e-01 1.2286053601549636e+00 3.1250581709996106e-01 + 7 -5.1887189298179548e-01 -5.1653500358989046e-01 6.9318256549563484e-01 + 8 -5.4007672382228117e-02 2.6859183359408156e-01 -3.4042178338983115e-01 + 9 -1.7074436045121943e-01 -8.5109770186947620e-01 -1.0773588492848072e+00 + 10 3.0793973322678671e-04 -4.8186595253268472e-01 -1.0405155138263378e+00 + 11 1.5283231048348811e+00 -1.4922676136398514e+00 9.5299400757773478e-01 + 12 -2.5067070901167137e+00 -1.7260607993708745e+00 -1.6244790393474420e+00 + 13 -5.6235790886570680e-01 2.3585631413137618e+00 -2.9127876443329359e-01 + 14 -5.6548461211840872e-01 1.8653022429237700e+00 -3.3242294041994691e-02 + 15 -1.6247793293987234e+00 1.7878424820880410e+00 -1.7100129080118776e+00 + 16 8.1592475815211640e-01 3.9978815670043610e-01 3.0954281982865943e+00 + 17 1.0568502301698139e+00 1.1454676964498280e+00 -1.8730495547882335e+00 + 18 1.8424845063192019e-01 2.7392740222782286e-01 1.4489558473703783e+00 + 19 -5.5999914801363948e-01 -8.1164618021764123e-01 -4.0693565170944346e-01 + 20 -2.7796384097824927e+00 3.1873084687724579e-01 1.7813456086024190e-01 + 21 7.3330693120564727e-01 -8.0395528722245327e-02 -1.2031927072203379e+00 + 22 -2.8714070500131230e+00 2.0341709966821746e+00 -2.5868755001462174e+00 + 23 6.7965142776034648e-01 1.1390245455901293e+00 9.6635789845676201e-01 + 24 8.2281062435904495e-01 9.2819309753370116e-01 1.2754920796056943e+00 + 25 2.8226519759590424e-01 -1.2226596891011678e-01 4.9537642544898125e-01 + 26 -1.3183205688042435e-01 -1.4257647612047622e-01 2.1434508820007092e-01 + 27 8.7792855239715339e-01 -4.9723350353286189e-01 8.1153570058578628e-01 + 28 -2.0947861194287209e-02 4.8894215287088771e-01 2.2752551215641708e+00 + 29 -1.2702068511884055e+00 5.1109069534141316e-01 -4.8571925387760806e-01 + 30 -4.8291102543559505e-01 4.2805907218805661e-01 -3.4628363342745988e-01 + 31 -5.1815876825981022e-01 3.8579011364491556e-01 -3.3978922486345037e-01 + 32 -1.3608082901833720e+00 1.8827011193929857e-01 -2.3469836599399560e-01 + 33 2.0529282523834711e+00 -1.2685983762091522e+00 1.6663497592278897e+00 + 34 -4.5189243354727182e-02 -3.2736561856626163e-02 1.8030687445807031e-01 + 35 5.0972119775588631e-01 -3.2015892710668520e-01 1.0138858093121164e+00 + 36 1.2271707477597629e-01 -9.3118808111966556e-01 6.0812551409211574e-03 + 37 -7.4244159178072111e-01 8.8563960698770794e-01 -9.5166206712247381e-01 + 38 4.5283609418616089e-02 -1.5033288786816132e-01 1.0628470501896768e-02 + 39 8.1272114808168361e-01 -9.7791747752504798e-01 -1.7007525281592790e+00 + 40 1.8000478262438198e+00 -1.1538213789257317e+00 -6.7136411510679861e-01 + 41 1.5499683265522783e-02 -1.3955600748288348e-02 -2.1744779416050455e-01 + 42 -1.5503540998240530e+00 -8.9262908626198989e-01 -5.9864359763177577e-01 + 43 1.0386261899746982e-01 -2.2234594365313654e+00 9.2443698220991327e-02 + 44 1.3872759356889137e+00 -1.5127698142330404e+00 9.7258424666774057e-01 + 45 -4.6739915218621014e-01 8.0388098835321042e-01 -1.3465943067485506e+00 + 46 -6.2872500689429289e-01 -8.2458713276079976e-01 2.2958918389492728e+00 + 47 1.0814994400034377e+00 5.2553860312232092e-01 6.1776419974193064e-01 + 48 3.8751598752151462e-01 3.1426891660378731e-01 -1.6298137257439968e-01 + 49 -9.0904275530250200e-01 -2.2873822047160863e+00 -1.4864379781792141e+00 + 50 4.1358159051664400e-01 1.0570092137239000e+00 -4.0323250644756137e-01 + 51 -9.4172195349527010e-01 1.6996496654949222e+00 1.6115119215552665e+00 + 52 2.5097037619453455e+00 -2.4525324196081129e+00 2.9540058179786848e+00 + 53 1.3720332798470005e+00 1.5342144442319867e+00 1.1653691882985184e+00 + 54 1.0768101277470987e+00 -1.1921583386413552e+00 -9.4962490497040664e-01 + 55 8.8736792497602746e-01 -1.4571034818051574e+00 -1.5335539060163184e+00 + 56 -1.6630858341375376e-01 2.6605463886145830e-01 -8.9638200504290855e-01 + 57 8.2311794363042881e-02 -3.7571896462749871e-01 -5.9456549563766878e-02 + 58 8.5610205446436338e-01 -4.5532402871724648e-01 3.5240564373735805e-01 + 59 1.6277722160751178e+00 1.0048795089638383e+00 -9.5389574412271805e-01 + 60 -1.3396097925873200e+00 -2.5484866844918983e+00 -1.7252656664423354e+00 + 61 -4.1356937053694531e-02 6.9831995565982619e-01 -2.3722369658580467e-01 + 62 -1.1615014571620641e+00 1.1805918165226632e+00 -9.2596032516965732e-01 + 63 9.6753599487408937e-01 -1.4353996747437299e+00 -6.7618187950266095e-01 + 64 1.3730994742564451e+00 1.5481237027388630e+00 2.7374902138995694e+00 +... diff --git a/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml b/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml new file mode 100644 index 0000000000..43b52a5391 --- /dev/null +++ b/unittest/force-styles/tests/manybody-pair-pace_recursive.yaml @@ -0,0 +1,156 @@ +--- +lammps_version: 10 Mar 2021 +date_generated: Wed Apr 7 19:30:07 2021 +epsilon: 5e-13 +skip_tests: +prerequisites: ! | + pair pace +pre_commands: ! | + variable newton_pair delete + variable newton_pair index on +post_commands: ! "" +input_file: in.manybody +pair_style: pace recursive +pair_coeff: ! | + * * Cu-PBE-core-rep.ace Cu Cu Cu Cu Cu Cu Cu Cu +extract: ! "" +natoms: 64 +init_vdwl: -161.633164433261 +init_coul: 0 +init_stress: ! |2- + 4.9972088100713812e+00 6.2044830914039082e+00 9.1051638867151059e+00 -3.5472278350779094e+00 1.6694265484458967e+01 1.2476127820342575e+00 +init_forces: ! |2 + 1 -6.2219087614976065e-01 1.4663175178944572e+00 1.0137638901413537e+00 + 2 -1.1376106569501236e+00 -4.6174763313970757e-01 -9.1065044746784896e-01 + 3 2.1030321840359212e-01 -1.8491702608427843e-01 2.5692785978129237e-02 + 4 -8.7721996834878824e-01 1.5265564953915360e+00 6.4946175447490173e-01 + 5 -4.2522149043160318e-01 -3.7218018176385625e-01 -9.1663252333276296e-02 + 6 3.7791326544486292e-01 1.2266089287991140e+00 2.9557107319932868e-01 + 7 -5.3020873901893451e-01 -5.3124732660126450e-01 7.0401499321635996e-01 + 8 -4.7453371627832100e-02 2.6914766341310509e-01 -3.4048361271929112e-01 + 9 -1.5727338601131144e-01 -8.3756943998987954e-01 -1.0686980500959902e+00 + 10 4.1485698119566282e-03 -4.7811767918420989e-01 -1.0586891580297877e+00 + 11 1.5438259205364635e+00 -1.5050047785034886e+00 9.6197857985467283e-01 + 12 -2.5123830465558123e+00 -1.7362105833106412e+00 -1.6289247068123103e+00 + 13 -5.9061498165326987e-01 2.3625898287840066e+00 -3.1399719632578593e-01 + 14 -5.5397546653770346e-01 1.8689085709447653e+00 -2.3086691928354244e-02 + 15 -1.6265821570337562e+00 1.7928198829776705e+00 -1.7156140339071948e+00 + 16 8.1679939937577550e-01 3.9772968007061277e-01 3.1004730854830349e+00 + 17 1.0595934046175248e+00 1.1460004586857007e+00 -1.8847997843938362e+00 + 18 2.0249462959833447e-01 2.6186197454741122e-01 1.4401663320550206e+00 + 19 -5.4631311118702253e-01 -7.9893542481102942e-01 -3.9498484189200239e-01 + 20 -2.7894722368447864e+00 3.3102350276278353e-01 1.9153108358694923e-01 + 21 7.2621138168723631e-01 -6.2245359068663686e-02 -1.1867468416622644e+00 + 22 -2.8699857742029091e+00 2.0263873921216184e+00 -2.5768047926156705e+00 + 23 6.7173035813885495e-01 1.1304059874438499e+00 9.5707129936933311e-01 + 24 8.1087520346680431e-01 9.3244931025571798e-01 1.2800553902586222e+00 + 25 2.8247847798945536e-01 -1.2561285000276420e-01 5.0249723343583008e-01 + 26 -1.2883224887964320e-01 -1.4823080811799477e-01 2.1451743731744408e-01 + 27 8.7218773747968470e-01 -4.8694991909036628e-01 8.0838245267060171e-01 + 28 -8.4108903260151635e-03 4.7660038551579958e-01 2.2692513770083211e+00 + 29 -1.2657298236002679e+00 5.0651440211208831e-01 -4.8138238615456286e-01 + 30 -4.9017825771975698e-01 4.3447662476281140e-01 -3.4664013847486475e-01 + 31 -5.2051576149983925e-01 3.8596959395000907e-01 -3.4070818553126514e-01 + 32 -1.3692783712259216e+00 1.9224558097570044e-01 -2.3226212734480328e-01 + 33 2.0607521792189862e+00 -1.2673195197858425e+00 1.6670068237762066e+00 + 34 -4.3444509217972604e-02 -3.3223620460338277e-02 1.7607017023409030e-01 + 35 5.0753059936748002e-01 -3.2385224472009999e-01 1.0142288303361040e+00 + 36 1.3677004996441039e-01 -9.3517724534399915e-01 2.4335569462137843e-02 + 37 -7.4579131173356694e-01 8.8843839477811493e-01 -9.4789414920418880e-01 + 38 3.9719539842571261e-02 -1.5258728344628525e-01 8.3622980381342846e-03 + 39 8.1730755341728512e-01 -9.8384548843884079e-01 -1.6996132976225846e+00 + 40 1.7801146130923835e+00 -1.1427274274009283e+00 -6.5983603408481306e-01 + 41 5.2820539467414857e-03 -2.3421071155573910e-02 -2.2563348155758098e-01 + 42 -1.5456364604620965e+00 -8.8225129116507839e-01 -5.8763735424098651e-01 + 43 1.1131408674736287e-01 -2.2247577888201659e+00 9.9728168268968409e-02 + 44 1.3854946872102469e+00 -1.5126948458100051e+00 9.7414222691401664e-01 + 45 -4.5981549862049609e-01 8.1397756884859851e-01 -1.3541793681441470e+00 + 46 -6.2619038173035535e-01 -8.2735236769680376e-01 2.2798662790638025e+00 + 47 1.0779718530621707e+00 5.2605298038103576e-01 6.1701114081812414e-01 + 48 3.8637284054407789e-01 3.0866805709788758e-01 -1.6028037248101001e-01 + 49 -8.8513638517169380e-01 -2.2564795567223652e+00 -1.4543286189782592e+00 + 50 4.0710335798118663e-01 1.0605235322144930e+00 -3.9752095773780305e-01 + 51 -9.1955086227837013e-01 1.6763661105933743e+00 1.6016036592489449e+00 + 52 2.4999859814584600e+00 -2.4516798161916613e+00 2.9455125031925271e+00 + 53 1.3494715555332963e+00 1.5041935505267034e+00 1.1203406583029645e+00 + 54 1.0781523968730000e+00 -1.1923649286229243e+00 -9.5279276661359580e-01 + 55 8.9808463906211189e-01 -1.4591385038403633e+00 -1.5496340042814931e+00 + 56 -1.6781965313775016e-01 2.7770530096449070e-01 -9.0012005317363286e-01 + 57 8.4669616061344807e-02 -3.6858526486015031e-01 -5.9756791316800374e-02 + 58 8.5722805697030136e-01 -4.6399147930816353e-01 3.6325830284449651e-01 + 59 1.6110642872176364e+00 9.9355375331453510e-01 -9.4982017793350770e-01 + 60 -1.3129344859565715e+00 -2.5250923468261557e+00 -1.6935614677383823e+00 + 61 -4.4869257920441788e-02 6.9444242511398635e-01 -2.4196506339840404e-01 + 62 -1.1637776716821653e+00 1.1834011745845063e+00 -9.3135952930485300e-01 + 63 9.6457625131507396e-01 -1.4202510282595464e+00 -6.5977083749854104e-01 + 64 1.3468893282798624e+00 1.5138254987169519e+00 2.7159451744492755e+00 +run_vdwl: -161.618480729193 +run_coul: 0 +run_stress: ! |2- + 4.9994648190880460e+00 6.2341889704281970e+00 9.1844870435007469e+00 -3.5139192287216519e+00 1.6660134035412629e+01 1.4298492052947611e+00 +run_forces: ! |2 + 1 -6.2816679628832128e-01 1.4637637672488530e+00 1.0165317420171567e+00 + 2 -1.1422624515773547e+00 -4.7321268150894835e-01 -9.1937052724939328e-01 + 3 1.9863435270447563e-01 -1.8101272698046844e-01 3.8842917970311100e-02 + 4 -8.6907185029051970e-01 1.5294385374559754e+00 6.4103701764724941e-01 + 5 -4.3303851444527064e-01 -3.7930261859680259e-01 -8.2809410717699622e-02 + 6 3.9940995017606218e-01 1.2286053601548976e+00 3.1250581709979730e-01 + 7 -5.1887189298196845e-01 -5.1653500358999127e-01 6.9318256549549417e-01 + 8 -5.4007672382224883e-02 2.6859183359401456e-01 -3.4042178338972828e-01 + 9 -1.7074436045121416e-01 -8.5109770186939693e-01 -1.0773588492847035e+00 + 10 3.0793973323051810e-04 -4.8186595253265396e-01 -1.0405155138263271e+00 + 11 1.5283231048349268e+00 -1.4922676136399666e+00 9.5299400757780717e-01 + 12 -2.5067070901166972e+00 -1.7260607993709931e+00 -1.6244790393474351e+00 + 13 -5.6235790886583970e-01 2.3585631413136179e+00 -2.9127876443333595e-01 + 14 -5.6548461211843171e-01 1.8653022429237356e+00 -3.3242294041971987e-02 + 15 -1.6247793293987416e+00 1.7878424820878918e+00 -1.7100129080120188e+00 + 16 8.1592475815216303e-01 3.9978815670041690e-01 3.0954281982866050e+00 + 17 1.0568502301698155e+00 1.1454676964498558e+00 -1.8730495547881063e+00 + 18 1.8424845063197498e-01 2.7392740222789114e-01 1.4489558473704491e+00 + 19 -5.5999914801367834e-01 -8.1164618021765156e-01 -4.0693565170939688e-01 + 20 -2.7796384097825526e+00 3.1873084687730341e-01 1.7813456086038751e-01 + 21 7.3330693120563484e-01 -8.0395528722151582e-02 -1.2031927072201976e+00 + 22 -2.8714070500131141e+00 2.0341709966822590e+00 -2.5868755001463439e+00 + 23 6.7965142776034937e-01 1.1390245455901691e+00 9.6635789845673215e-01 + 24 8.2281062435890928e-01 9.2819309753390167e-01 1.2754920796057649e+00 + 25 2.8226519759595764e-01 -1.2226596891014743e-01 4.9537642544899713e-01 + 26 -1.3183205688038924e-01 -1.4257647612039717e-01 2.1434508820029102e-01 + 27 8.7792855239706757e-01 -4.9723350353285928e-01 8.1153570058585001e-01 + 28 -2.0947861194201500e-02 4.8894215287086157e-01 2.2752551215641588e+00 + 29 -1.2702068511883076e+00 5.1109069534141138e-01 -4.8571925387763182e-01 + 30 -4.8291102543552133e-01 4.2805907218813599e-01 -3.4628363342741275e-01 + 31 -5.1815876825973306e-01 3.8579011364505383e-01 -3.3978922486349478e-01 + 32 -1.3608082901834111e+00 1.8827011193937446e-01 -2.3469836599383653e-01 + 33 2.0529282523835013e+00 -1.2685983762092712e+00 1.6663497592278267e+00 + 34 -4.5189243354751718e-02 -3.2736561856755692e-02 1.8030687445809970e-01 + 35 5.0972119775587099e-01 -3.2015892710665028e-01 1.0138858093119485e+00 + 36 1.2271707477597758e-01 -9.3118808111974460e-01 6.0812551408806932e-03 + 37 -7.4244159178063873e-01 8.8563960698757693e-01 -9.5166206712249257e-01 + 38 4.5283609418585336e-02 -1.5033288786827403e-01 1.0628470501999519e-02 + 39 8.1272114808181617e-01 -9.7791747752517932e-01 -1.7007525281592044e+00 + 40 1.8000478262439097e+00 -1.1538213789257521e+00 -6.7136411510685423e-01 + 41 1.5499683265592791e-02 -1.3955600748503419e-02 -2.1744779416054441e-01 + 42 -1.5503540998240890e+00 -8.9262908626199444e-01 -5.9864359763176522e-01 + 43 1.0386261899753707e-01 -2.2234594365314631e+00 9.2443698220934262e-02 + 44 1.3872759356888453e+00 -1.5127698142329729e+00 9.7258424666771137e-01 + 45 -4.6739915218619787e-01 8.0388098835315858e-01 -1.3465943067486295e+00 + 46 -6.2872500689439892e-01 -8.2458713276081630e-01 2.2958918389493181e+00 + 47 1.0814994400035058e+00 5.2553860312226619e-01 6.1776419974197272e-01 + 48 3.8751598752146438e-01 3.1426891660371681e-01 -1.6298137257451450e-01 + 49 -9.0904275530255685e-01 -2.2873822047160055e+00 -1.4864379781792907e+00 + 50 4.1358159051644028e-01 1.0570092137240017e+00 -4.0323250644759429e-01 + 51 -9.4172195349516652e-01 1.6996496654948405e+00 1.6115119215552218e+00 + 52 2.5097037619454046e+00 -2.4525324196079747e+00 2.9540058179785182e+00 + 53 1.3720332798469679e+00 1.5342144442320667e+00 1.1653691882983437e+00 + 54 1.0768101277471369e+00 -1.1921583386412453e+00 -9.4962490497026519e-01 + 55 8.8736792497605987e-01 -1.4571034818051218e+00 -1.5335539060162722e+00 + 56 -1.6630858341372168e-01 2.6605463886156522e-01 -8.9638200504305587e-01 + 57 8.2311794363030891e-02 -3.7571896462756421e-01 -5.9456549563895990e-02 + 58 8.5610205446440457e-01 -4.5532402871718020e-01 3.5240564373727451e-01 + 59 1.6277722160751129e+00 1.0048795089638642e+00 -9.5389574412266476e-01 + 60 -1.3396097925873169e+00 -2.5484866844917313e+00 -1.7252656664424246e+00 + 61 -4.1356937053699777e-02 6.9831995565994065e-01 -2.3722369658585374e-01 + 62 -1.1615014571620197e+00 1.1805918165227427e+00 -9.2596032516965954e-01 + 63 9.6753599487398723e-01 -1.4353996747436160e+00 -6.7618187950256603e-01 + 64 1.3730994742563347e+00 1.5481237027388883e+00 2.7374902138994806e+00 +... From d22d6ad45d97028977f916b92276d1cad819874a Mon Sep 17 00:00:00 2001 From: Yury Lysogorskiy Date: Thu, 8 Apr 2021 11:52:49 +0200 Subject: [PATCH 14/23] cmake/USER-PACE.cmake: update PACELIB_URL and PACELIB_MD5 (new source files with whitespaces) lib/pace: add Makefile, Install.py use make remove the LICENSE from src/USER-PACE --- cmake/Modules/Packages/USER-PACE.cmake | 8 +- lib/pace/Install.py | 16 +- lib/pace/Makefile | 38 ++ src/USER-PACE/LICENSE | 674 ------------------------- 4 files changed, 46 insertions(+), 690 deletions(-) create mode 100644 lib/pace/Makefile delete mode 100644 src/USER-PACE/LICENSE diff --git a/cmake/Modules/Packages/USER-PACE.cmake b/cmake/Modules/Packages/USER-PACE.cmake index 008d32444c..b953278e75 100644 --- a/cmake/Modules/Packages/USER-PACE.cmake +++ b/cmake/Modules/Packages/USER-PACE.cmake @@ -1,11 +1,11 @@ -set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.2.3.tar.gz" CACHE STRING "URL for PACE evaluator library sources") -set(PACELIB_MD5 "9ebb087cba7e4ca041fde52f7e9e640c" CACHE STRING "MD5 checksum of PACE evaluator library tarball") +set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.2.3.upd.tar.gz" CACHE STRING "URL for PACE evaluator library sources") +set(PACELIB_MD5 "8041e3de7254815eb3ff0a11e2cc84ea" CACHE STRING "MD5 checksum of PACE evaluator library tarball") mark_as_advanced(PACELIB_URL) mark_as_advanced(PACELIB_MD5) # download library sources to build folder -file(DOWNLOAD ${PACELIB_URL} libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5}) +file(DOWNLOAD ${PACELIB_URL} ./libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5}) # uncompress downloaded sources execute_process( @@ -20,7 +20,7 @@ file(GLOB PACE_EVALUATOR_SOURCES ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PAC list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp) add_library(pace STATIC ${PACE_EVALUATOR_SOURCES}) -set_target_properties(pace PROPERTIES OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) +set_target_properties(pace PROPERTIES OUTPUT_NAME pace${LAMMPS_MACHINE}) target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR}) target_link_libraries(lammps PRIVATE pace) diff --git a/lib/pace/Install.py b/lib/pace/Install.py index 640971e011..5f72157611 100644 --- a/lib/pace/Install.py +++ b/lib/pace/Install.py @@ -18,11 +18,11 @@ parser = ArgumentParser(prog='Install.py', # settings thisdir = fullpath('.') -version = "v.2021.2.3" +version = "v.2021.2.3.upd" # known checksums for different PACE versions. used to validate the download. checksums = { \ - 'v.2021.2.3' : '9ebb087cba7e4ca041fde52f7e9e640c', \ + 'v.2021.2.3.upd' : '8041e3de7254815eb3ff0a11e2cc84ea', \ } @@ -89,17 +89,9 @@ if buildflag: cmd = 'cd "%s"; rm -rf "%s"; tar -xvf %s; mv %s %s' % (thisdir, src_folder, archive_filename, unarchived_folder_name, src_folder) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) - # configure - - build_folder = "%s/build"%(thisdir) - print("Configuring libpace ...") - cmd = 'cd %s && mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release' % (thisdir) - txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - if verboseflag: print(txt.decode("UTF-8")) - # build print("Building libpace ...") - cmd = 'cd "%s" && make -j2 && cp libpace.a %s/' % (build_folder, thisdir) + cmd = 'make lib -j2' txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) if verboseflag: print(txt.decode("UTF-8")) @@ -107,5 +99,5 @@ if buildflag: # remove source files print("Removing pace build files and archive ...") - cmd = 'rm %s; rm -rf %s' % (download_filename, build_folder) + cmd = 'rm %s; make clean-build' % (download_filename) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) \ No newline at end of file diff --git a/lib/pace/Makefile b/lib/pace/Makefile new file mode 100644 index 0000000000..baaef0b837 --- /dev/null +++ b/lib/pace/Makefile @@ -0,0 +1,38 @@ +SHELL = /bin/sh + +# ------ FILES ------ + +SRC_FILES = $(wildcard src/USER-PACE/*.cpp) +SRC = $(filter-out src/USER-PACE/pair_pace.cpp, $(SRC_FILES)) + +# ------ DEFINITIONS ------ + +LIB = libpace.a +OBJ = $(SRC:.cpp=.o) + + +# ------ SETTINGS ------ +CXXFLAGS = -O2 -fPIC -Isrc/USER-PACE + +ARCHIVE = ar +ARCHFLAG = -rc +DEPFLAGS = -M +USRLIB = +SYSLIB = + +# ------ MAKE PROCEDURE ------ + +lib: $(OBJ) + $(ARCHIVE) $(ARFLAGS) $(LIB) $(OBJ) + +# ------ COMPILE RULES ------ + +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c $< -o $@ + +# ------ CLEAN ------ +clean-all: + -rm -f *~ $(OBJ) $(LIB) + +clean-build: + -rm -f *~ $(OBJ) \ No newline at end of file diff --git a/src/USER-PACE/LICENSE b/src/USER-PACE/LICENSE deleted file mode 100644 index f288702d2f..0000000000 --- a/src/USER-PACE/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. From 73ee7805dc9dae77d2adf005925cf63ca4a69a7e Mon Sep 17 00:00:00 2001 From: Yury Lysogorskiy Date: Thu, 8 Apr 2021 12:13:33 +0200 Subject: [PATCH 15/23] remove GPL3 license terms from src/USER-PACE/pair_pace.* delete lib/pace/CMakeLists.txt --- lib/pace/CMakeLists.txt | 19 ------------------- lib/pace/TODO | 30 ------------------------------ src/USER-PACE/pair_pace.cpp | 16 +--------------- src/USER-PACE/pair_pace.h | 16 +--------------- 4 files changed, 2 insertions(+), 79 deletions(-) delete mode 100644 lib/pace/CMakeLists.txt delete mode 100644 lib/pace/TODO diff --git a/lib/pace/CMakeLists.txt b/lib/pace/CMakeLists.txt deleted file mode 100644 index 2884c83cb9..0000000000 --- a/lib/pace/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 3.7) # CMake version check -project(aceevaluator) -set(CMAKE_CXX_STANDARD 11) # Enable c++11 standard - - -set(PACE_EVALUATOR_PATH ${CMAKE_CURRENT_LIST_DIR}/src/USER-PACE) -# message("CMakeLists.txt DEBUG: PACE_EVALUATOR_PATH=${PACE_EVALUATOR_PATH}") -set(PACE_EVALUATOR_SRC_PATH ${PACE_EVALUATOR_PATH}) - -FILE(GLOB PACE_EVALUATOR_SOURCE_FILES ${PACE_EVALUATOR_SRC_PATH}/*.cpp) -list(FILTER PACE_EVALUATOR_SOURCE_FILES EXCLUDE REGEX ".*pair_pace.*") -set(PACE_EVALUATOR_INCLUDE_DIR ${PACE_EVALUATOR_SRC_PATH}) - - -##### aceevaluator ##### -add_library(aceevaluator ${PACE_EVALUATOR_SOURCE_FILES}) -target_include_directories(aceevaluator PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR}) -target_compile_options(aceevaluator PRIVATE -O3) -set_target_properties(aceevaluator PROPERTIES OUTPUT_NAME pace${LAMMPS_MACHINE}) diff --git a/lib/pace/TODO b/lib/pace/TODO deleted file mode 100644 index 8021916923..0000000000 --- a/lib/pace/TODO +++ /dev/null @@ -1,30 +0,0 @@ -[TODO/DONE] pair_pace.cpp and pair_pace.h will have to go into src/USER-PACE and thus also need to conform to our requirements. - -[TODO] also src/USER-PACE would need to have an Install.sh file that integrates the settings from the lib folder into the conventional build process. -[TODO] there would have to be a lib/pace folder for building/interfacing to the library. - -[TODO] how you organize your repo is up to you. a better way to describe what you would have to do is to point you to examples. -which of the examples is relevant depends on what build system you are using for your "PACE" external package. - -If you are using CMake to build it, you can look at the KIM package -If you are using autoconf/automake, you can look at the USER-PLUMED package -If you are using neither (just a plain Makefile), you can look at the VORONOI or QUIP package -The following additional modifications are needed: - -[TODO] lib/pace: needs one or more Makefile.lammps, a README and an Install.py file -[TODO] src/Makefile: needs support for the USER-PACE package and compiling via lib-pace. Also the package needs to be added to the PACKEXT and PACKLIB variables - -[DONE] cmake/Modules/Packages/USER-PACE.cmake needs to be added -[DONE] cmake/CMakeLists.txt needs to include it in case the package is enabled. - -[TODO] doc/src/Build_extra.rst needs to include the build instructions for CMake and traditional make -[TODO] doc/src/Package_user.rst and doc/src/Package_details.rst needs to contain relevant information and links - - -Because of the different build systems, there are different steps required, but each of the examples I've pointed out are tested and used regularly and thus should be working sufficiently well. -Mind you the QUIP package is set up in such a way, that no automatic download is possible and a manual download and compilation is required. So that is the least preferred and least convenient option. - -We are happy to provide more details, but that requires that you first have something that already is following either of the suggested variants, so that we don't have to discuss in all generality. - -I would also suggest to close this pull request here, leave all files in place, but then start a new branch from the current master and then move the few things over you need to retain, -add the build environment files and then start working on getting it to do what it should. \ No newline at end of file diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index 41551e454c..c12753603a 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -7,21 +7,7 @@ Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, ^2: University of Cambridge, Cambridge, United Kingdom ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA ^4: University of British Columbia, Vancouver, BC, Canada - - - This FILENAME is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ +*/ // diff --git a/src/USER-PACE/pair_pace.h b/src/USER-PACE/pair_pace.h index b29ee3a7a9..37509cff5e 100644 --- a/src/USER-PACE/pair_pace.h +++ b/src/USER-PACE/pair_pace.h @@ -7,21 +7,7 @@ Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, ^2: University of Cambridge, Cambridge, United Kingdom ^3: Sandia National Laboratories, Albuquerque, New Mexico, USA ^4: University of British Columbia, Vancouver, BC, Canada - - - This FILENAME is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ +*/ // From d1fd2f74d1046e4177b8714f4cf72ed47f7c87c8 Mon Sep 17 00:00:00 2001 From: Yury Lysogorskiy Date: Thu, 8 Apr 2021 16:06:05 +0200 Subject: [PATCH 16/23] update PACELIB_URL (tackling some PGI warnings): v.2021.2.3.upd2 update lib/pace/Makefile: -O3 optimization --- cmake/Modules/Packages/USER-PACE.cmake | 4 ++-- lib/pace/Install.py | 4 ++-- lib/pace/Makefile | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cmake/Modules/Packages/USER-PACE.cmake b/cmake/Modules/Packages/USER-PACE.cmake index b953278e75..e8262f7d40 100644 --- a/cmake/Modules/Packages/USER-PACE.cmake +++ b/cmake/Modules/Packages/USER-PACE.cmake @@ -1,6 +1,6 @@ -set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.2.3.upd.tar.gz" CACHE STRING "URL for PACE evaluator library sources") -set(PACELIB_MD5 "8041e3de7254815eb3ff0a11e2cc84ea" CACHE STRING "MD5 checksum of PACE evaluator library tarball") +set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.2.3.upd2.tar.gz" CACHE STRING "URL for PACE evaluator library sources") +set(PACELIB_MD5 "8fd1162724d349b930e474927197f20d" CACHE STRING "MD5 checksum of PACE evaluator library tarball") mark_as_advanced(PACELIB_URL) mark_as_advanced(PACELIB_MD5) diff --git a/lib/pace/Install.py b/lib/pace/Install.py index 5f72157611..91aa8b3a46 100644 --- a/lib/pace/Install.py +++ b/lib/pace/Install.py @@ -18,11 +18,11 @@ parser = ArgumentParser(prog='Install.py', # settings thisdir = fullpath('.') -version = "v.2021.2.3.upd" +version = "v.2021.2.3.upd2" # known checksums for different PACE versions. used to validate the download. checksums = { \ - 'v.2021.2.3.upd' : '8041e3de7254815eb3ff0a11e2cc84ea', \ + 'v.2021.2.3.upd2' : '8fd1162724d349b930e474927197f20d', \ } diff --git a/lib/pace/Makefile b/lib/pace/Makefile index baaef0b837..c2e1892ddd 100644 --- a/lib/pace/Makefile +++ b/lib/pace/Makefile @@ -12,11 +12,10 @@ OBJ = $(SRC:.cpp=.o) # ------ SETTINGS ------ -CXXFLAGS = -O2 -fPIC -Isrc/USER-PACE +CXXFLAGS = -O3 -fPIC -Isrc/USER-PACE ARCHIVE = ar ARCHFLAG = -rc -DEPFLAGS = -M USRLIB = SYSLIB = @@ -35,4 +34,4 @@ clean-all: -rm -f *~ $(OBJ) $(LIB) clean-build: - -rm -f *~ $(OBJ) \ No newline at end of file + -rm -f *~ $(OBJ) From 22a337b3935de957c94184d0859dfc3c0778903b Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 8 Apr 2021 13:00:20 -0600 Subject: [PATCH 17/23] Updated READMEs in lib/pace and src/USER-PACE --- lib/pace/README | 13 +++++++++++-- src/USER-PACE/README | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/USER-PACE/README diff --git a/lib/pace/README b/lib/pace/README index e9a1ab820a..ddc6f7f7a7 100644 --- a/lib/pace/README +++ b/lib/pace/README @@ -1,9 +1,18 @@ -This directory contains files required to use the USER-PACE package. +This directory contains files required to use the USER-PACE package, +which provides the pace pair style, an efficient implementation of +the Atomic Cluster Expansion potential (ACE). +ACE is a methodology for deriving a highly accurate classical potential +fit to a large archive of quantum mechanical (DFT) data. +This package was written by Yury Lysogorskiy and others +at ICAMS, the Interdisciplinary Centre for Advanced Materials Simulation, +Ruhr University Bochum, Germany, http://www.icams.de You can type "make lib-pace" from the src directory to see help on how to download and build this library via make commands, or you can do the same thing by typing "python Install.py" from within this directory. +More information about the USER-PACE implementation of ACE +is available here: - +https://github.com/ICAMS/lammps-user-pace diff --git a/src/USER-PACE/README b/src/USER-PACE/README new file mode 100644 index 0000000000..476edaef76 --- /dev/null +++ b/src/USER-PACE/README @@ -0,0 +1,23 @@ +The USER-PACE package, +provides the pace pair style, an efficient implementation of +the Atomic Cluster Expansion potential (ACE). +ACE is a methodology for deriving a highly accurate classical potential +fit to a large archive of quantum mechanical (DFT) data. +This package was written by Yury Lysogorskiy and others +at ICAMS, the Interdisciplinary Centre for Advanced Materials Simulation, +Ruhr University Bochum, Germany, http://www.icams.de + +This package requires a library that can be downloaded and built +in lib/pace or somewhere else, +which must be done before building LAMMPS with this +package. Details of the download, build, and install process for +this package usng traditional make (not CMake) are given in the +lib/pace/README file, and scripts are +provided to help automate the process. Also see the LAMMPS manual for +general information on building LAMMPS with external libraries +using either traditional make or CMake. + +More information about the USER-PACE implementation of ACE +is available here: + +https://github.com/ICAMS/lammps-user-pace From a39dc9f9b224118e54330e67d6a240dfab91d352 Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 8 Apr 2021 13:36:04 -0600 Subject: [PATCH 18/23] Added minimal info on downloading and building PACE library --- doc/src/Build_extras.rst | 32 ++++++++++++++++++++++++++++++++ doc/src/Packages_details.rst | 4 ++++ src/USER-PACE/README | 22 +++++++++++----------- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 3af018c656..726374a012 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -52,6 +52,7 @@ This is the list of packages that may require additional steps. * :ref:`USER-MESONT ` * :ref:`USER-MOLFILE ` * :ref:`USER-NETCDF ` + * :ref:`USER-PACE ` * :ref:`USER-PLUMED ` * :ref:`USER-OMP ` * :ref:`USER-QMMM ` @@ -1247,6 +1248,37 @@ be built for the most part with all major versions of the C++ language. ---------- +.. _user-pace: + +USER-PACE package +----------------------------- + +This package requires a library that can be downloaded and built +in lib/pace or somewhere else, which must be done before building +LAMMPS with this package. + +.. tabs:: + + .. tab:: CMake build + + The library download and build will happen automatically when USER-PACE + is requested. + + .. tab:: Traditional make + + You can download and build the USER-PACE library + in one step from the ``lammps/src`` dir, using these commands, + which invoke the ``lib/pace/Install.py`` script. + + .. code-block:: bash + + $ make lib-pace # print help message + $ make lib-pace args="-b" # download and build the default version in lib/pace + + You should not need to edit the ``lib/pace/Makefile.lammps`` file. + +---------- + .. _user-plumed: USER-PLUMED package diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 1964a83717..b10983a35b 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -1378,6 +1378,10 @@ Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1. ^4: University of British Columbia, Vancouver, BC, Canada +**Install:** + +This package has :ref:`specific installation instructions ` on the :doc:`Build extras ` page. + **Supporting info:** * src/USER-PACE: filenames -> commands diff --git a/src/USER-PACE/README b/src/USER-PACE/README index 476edaef76..3d85c806e9 100644 --- a/src/USER-PACE/README +++ b/src/USER-PACE/README @@ -1,18 +1,18 @@ -The USER-PACE package, -provides the pace pair style, an efficient implementation of -the Atomic Cluster Expansion potential (ACE). -ACE is a methodology for deriving a highly accurate classical potential -fit to a large archive of quantum mechanical (DFT) data. +The USER-PACE package provides the pace pair style, +an efficient implementation of the Atomic Cluster Expansion +potential (ACE). + +ACE is a methodology for deriving a highly accurate classical +potential fit to a large archive of quantum mechanical (DFT) data. This package was written by Yury Lysogorskiy and others at ICAMS, the Interdisciplinary Centre for Advanced Materials Simulation, -Ruhr University Bochum, Germany, http://www.icams.de +Ruhr University Bochum, Germany (http://www.icams.de). This package requires a library that can be downloaded and built -in lib/pace or somewhere else, -which must be done before building LAMMPS with this -package. Details of the download, build, and install process for -this package usng traditional make (not CMake) are given in the -lib/pace/README file, and scripts are +in lib/pace or somewhere else, which must be done before building +LAMMPS with this package. Details of the download, build, and +install process for this package using traditional make (not CMake) +are given in the lib/pace/README file, and scripts are provided to help automate the process. Also see the LAMMPS manual for general information on building LAMMPS with external libraries using either traditional make or CMake. From 0aee75857a6e7fa320862255b81eff32f30c336f Mon Sep 17 00:00:00 2001 From: Aidan Thompson Date: Thu, 8 Apr 2021 14:09:19 -0600 Subject: [PATCH 19/23] Eliminated doc build warnings --- doc/src/Build_package.rst | 22 +++++++++++----------- doc/src/Packages_user.rst | 2 ++ doc/src/pair_style.rst | 5 +++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index f9fc52f8db..91531f51ec 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -30,17 +30,17 @@ steps, as explained on the :doc:`Build extras ` page. These links take you to the extra instructions for those select packages: -+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ -| :ref:`COMPRESS ` | :ref:`GPU ` | :ref:`KIM ` | :ref:`KOKKOS ` | :ref:`LATTE ` | :ref:`MESSAGE ` | -+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ -| :ref:`MSCG ` | :ref:`OPT ` | :ref:`POEMS ` | :ref:`PYTHON ` | :ref:`VORONOI ` | :ref:`USER-ADIOS ` | -+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ -| :ref:`USER-ATC ` | :ref:`USER-AWPMD ` | :ref:`USER-COLVARS ` | :ref:`USER-H5MD ` | :ref:`USER-INTEL ` | :ref:`USER-MOLFILE ` | -+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ -| :ref:`USER-NETCDF ` | :ref:`USER-PLUMED ` | :ref:`USER-OMP ` | :ref:`USER-QMMM ` | :ref:`USER-QUIP ` | :ref:`USER-SCAFACOS ` | -+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ -| :ref:`USER-SMD ` | :ref:`USER-VTK ` | | | | | -+----------------------------------+----------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ ++--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ +| :ref:`COMPRESS ` | :ref:`GPU ` | :ref:`KIM ` | :ref:`KOKKOS ` | :ref:`LATTE ` | :ref:`MESSAGE ` | ++--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ +| :ref:`MSCG ` | :ref:`OPT ` | :ref:`POEMS ` | :ref:`PYTHON ` | :ref:`VORONOI ` | :ref:`USER-ADIOS ` | ++--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ +| :ref:`USER-ATC ` | :ref:`USER-AWPMD ` | :ref:`USER-COLVARS ` | :ref:`USER-H5MD ` | :ref:`USER-INTEL ` | :ref:`USER-MOLFILE ` | ++--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ +| :ref:`USER-NETCDF ` | :ref:`USER-PACE ` | :ref:`USER-PLUMED ` | :ref:`USER-OMP ` | :ref:`USER-QMMM ` | :ref:`USER-QUIP ` | ++--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ +| :ref:`USER-SCAFACOS ` | :ref:`USER-SMD ` | :ref:`USER-VTK ` | | | | ++--------------------------------------+--------------------------------+------------------------------------+------------------------------+--------------------------------+--------------------------------------+ The mechanism for including packages is simple but different for CMake versus make. diff --git a/doc/src/Packages_user.rst b/doc/src/Packages_user.rst index a3efaf15c8..00d1dfb67b 100644 --- a/doc/src/Packages_user.rst +++ b/doc/src/Packages_user.rst @@ -81,6 +81,8 @@ package: +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-OMP ` | OpenMP-enabled styles | :doc:`Speed omp ` | `Benchmarks `_ | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ +| :ref:`USER-PACE ` | Fast implementation of Atomic Cluster Expansion (ACE) potential | :doc:`pair pace ` | USER/pace | ext | ++------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-PHONON ` | phonon dynamical matrix | :doc:`fix phonon ` | USER/phonon | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-PLUMED ` | :ref:`PLUMED ` free energy library | :doc:`fix plumed ` | USER/plumed | ext | diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index 89530895c4..a64fc67194 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -98,7 +98,7 @@ accelerated styles exist. * :doc:`zero ` - neighbor list but no interactions * :doc:`adp ` - angular dependent potential (ADP) of Mishin -* :doc:`agni ` - machine learned potential mapping atomic environment to forces +* :doc:`agni ` - AGNI machine-learning potential * :doc:`airebo ` - AIREBO potential of Stuart * :doc:`airebo/morse ` - AIREBO with Morse instead of LJ * :doc:`atm ` - Axilrod-Teller-Muto potential @@ -278,6 +278,7 @@ accelerated styles exist. * :doc:`oxrna2/hbond ` - * :doc:`oxrna2/stk ` - * :doc:`oxrna2/xstk ` - +* :doc:`pace ` - Atomic Cluster Expansion (ACE) machine-learning potential * :doc:`peri/eps ` - peridynamic EPS potential * :doc:`peri/lps ` - peridynamic LPS potential * :doc:`peri/pmb ` - peridynamic PMB potential @@ -295,7 +296,7 @@ accelerated styles exist. * :doc:`smd/ulsph ` - * :doc:`smtbq ` - * :doc:`mliap ` - Multiple styles of machine-learning potential -* :doc:`snap ` - SNAP quantum-accurate potential +* :doc:`snap ` - SNAP machine-learning potential * :doc:`soft ` - Soft (cosine) potential * :doc:`sph/heatconduction ` - * :doc:`sph/idealgas ` - From 7b45b691f4a926328f53fdcc95c9d78261656269 Mon Sep 17 00:00:00 2001 From: Yury Lysogorskiy Date: Fri, 9 Apr 2021 13:31:40 +0200 Subject: [PATCH 20/23] pair_pace.cpp: check that units are "metal" update ace-evaluator (download link + md5sum in cmake and make build systems): accept multilines comment at the beginning of potential.ace file add first comment line for potentials/Cu-PBE-core-rep.ace --- cmake/Modules/Packages/USER-PACE.cmake | 4 ++-- lib/pace/Install.py | 12 +++++++----- potentials/Cu-PBE-core-rep.ace | 2 ++ src/USER-PACE/pair_pace.cpp | 5 +++++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/cmake/Modules/Packages/USER-PACE.cmake b/cmake/Modules/Packages/USER-PACE.cmake index e8262f7d40..df1fb023a5 100644 --- a/cmake/Modules/Packages/USER-PACE.cmake +++ b/cmake/Modules/Packages/USER-PACE.cmake @@ -1,6 +1,6 @@ -set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.2.3.upd2.tar.gz" CACHE STRING "URL for PACE evaluator library sources") -set(PACELIB_MD5 "8fd1162724d349b930e474927197f20d" CACHE STRING "MD5 checksum of PACE evaluator library tarball") +set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.4.9.tar.gz" CACHE STRING "URL for PACE evaluator library sources") +set(PACELIB_MD5 "4db54962fbd6adcf8c18d46e1798ceb5" CACHE STRING "MD5 checksum of PACE evaluator library tarball") mark_as_advanced(PACELIB_URL) mark_as_advanced(PACELIB_MD5) diff --git a/lib/pace/Install.py b/lib/pace/Install.py index 91aa8b3a46..08bbb331bb 100644 --- a/lib/pace/Install.py +++ b/lib/pace/Install.py @@ -12,20 +12,22 @@ from argparse import ArgumentParser sys.path.append('..') from install_helpers import fullpath, geturl, checkmd5sum -parser = ArgumentParser(prog='Install.py', - description="LAMMPS library build wrapper script") - # settings thisdir = fullpath('.') -version = "v.2021.2.3.upd2" +version = 'v.2021.4.9' # known checksums for different PACE versions. used to validate the download. checksums = { \ - 'v.2021.2.3.upd2' : '8fd1162724d349b930e474927197f20d', \ + 'v.2021.2.3.upd2' : '8fd1162724d349b930e474927197f20d', + 'v.2021.4.9' : '4db54962fbd6adcf8c18d46e1798ceb5', } +parser = ArgumentParser(prog='Install.py', + description="LAMMPS library build wrapper script") + + # help message HELP = """ diff --git a/potentials/Cu-PBE-core-rep.ace b/potentials/Cu-PBE-core-rep.ace index 338675f718..511bb9af7f 100644 --- a/potentials/Cu-PBE-core-rep.ace +++ b/potentials/Cu-PBE-core-rep.ace @@ -1,3 +1,5 @@ +# DATE: 2021-04-08 UNITS: metal CONTRIBUTOR: Yury Lysogorskiy CITATION: npj Comp. Mat., submitted (2021) + nelements=1 elements: Cu diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index c12753603a..f59291b33e 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -25,6 +25,7 @@ Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, #include "neigh_list.h" #include "neigh_request.h" #include "neighbor.h" +#include "update.h" #include #include @@ -252,6 +253,10 @@ void PairPACE::settings(int narg, char **arg) { if (narg > 1) error->all(FLERR,"Illegal pair_style command."); + // ACE potentials are parameterized in metal units + if (strcmp("metal",update->unit_style) != 0) + error->all(FLERR,"ACE potentials require 'metal' units"); + recursive = true; // default evaluator style: RECURSIVE if (narg > 0) { if (strcmp(arg[0], RECURSIVE_KEYWORD) == 0) From ee38452f14d3cd1d8549cae15223443606c7dd46 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 12 Apr 2021 14:52:17 -0400 Subject: [PATCH 21/23] fix bug causing a failed download when using cmake -B --- cmake/Modules/Packages/USER-PACE.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/Packages/USER-PACE.cmake b/cmake/Modules/Packages/USER-PACE.cmake index df1fb023a5..66f228017c 100644 --- a/cmake/Modules/Packages/USER-PACE.cmake +++ b/cmake/Modules/Packages/USER-PACE.cmake @@ -5,7 +5,7 @@ mark_as_advanced(PACELIB_URL) mark_as_advanced(PACELIB_MD5) # download library sources to build folder -file(DOWNLOAD ${PACELIB_URL} ./libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5}) +file(DOWNLOAD ${PACELIB_URL} ${CMAKE_BINARY_DIR}/libpace.tar.gz SHOW_PROGRESS EXPECTED_HASH MD5=${PACELIB_MD5}) # uncompress downloaded sources execute_process( From 04248c2ccdf41f8e2977e72ce99f1a45715e3463 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 12 Apr 2021 14:52:35 -0400 Subject: [PATCH 22/23] finalize CMake build docs --- doc/src/Build_extras.rst | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 726374a012..12bb33f264 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -1255,14 +1255,23 @@ USER-PACE package This package requires a library that can be downloaded and built in lib/pace or somewhere else, which must be done before building -LAMMPS with this package. +LAMMPS with this package. The code for the library can be found +at: `https://github.com/ICAMS/lammps-user-pace/ `_ .. tabs:: .. tab:: CMake build - The library download and build will happen automatically when USER-PACE - is requested. + By default the library will be downloaded from the git repository + and built automatically when the USER-PACE package is enabled with + ``-D PKG_USER-PACE=yes``. The location for the sources may be + customized by setting the variable ``PACELIB_URL`` when + configuring with CMake (e.g. to use a local archive on machines + without internet access). Since CMake checks the validity of the + archive with ``md5sum`` you may also need to set ``PACELIB_MD5`` + if you provide a different library version than what is downloaded + automatically. + .. tab:: Traditional make From f1e5d1115169ecbdb8977ed3bfd57d24667b2d51 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 12 Apr 2021 14:52:53 -0400 Subject: [PATCH 23/23] add LAMMPS distribution header --- src/USER-PACE/pair_pace.cpp | 13 +++++++++++++ src/USER-PACE/pair_pace.h | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index f59291b33e..d6eda0f511 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -1,3 +1,16 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://lammps.sandia.gov/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + /* Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1, diff --git a/src/USER-PACE/pair_pace.h b/src/USER-PACE/pair_pace.h index 37509cff5e..4d5ddcb9e8 100644 --- a/src/USER-PACE/pair_pace.h +++ b/src/USER-PACE/pair_pace.h @@ -1,3 +1,13 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + This software is distributed under the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + /* Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, Sarath Menon^1, Matteo Rinaldi^1, Thomas Hammerschmidt^1, Matous Mrovec^1,