diff --git a/LICENSE b/LICENSE index 22fbe5db..1bf1923e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,281 +1,622 @@ -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + 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 licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to + 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 -this service 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. +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 make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. + 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 give the recipients all the rights that -you have. 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. +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. - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. + 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. - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. + 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. - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. + 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. - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + TERMS AND CONDITIONS - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". + 0. Definitions. -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. + "This License" refers to version 3 of the GNU General Public License. - 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. + "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. - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: + 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) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. + A "covered work" means either the unmodified Program or a work based +on the Program. - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. + 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. - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) + 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. -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. + 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. -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. + 1. Source Code. -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. + 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. - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: + 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. - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, + 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. - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, + 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. - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. + The Corresponding Source for a work in source code form is that +same work. -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. + 2. Basic Permissions. - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. + 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. - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. + 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. - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to + 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. - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + 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 -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. +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. -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. + 13. Use with the GNU Affero General Public License. -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. + 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. -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. + 14. Revised Versions of this License. - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will + 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 a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. + 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. - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. + 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. - NO WARRANTY + 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. - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + 15. Disclaimer of Warranty. - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE 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. + 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 @@ -287,15 +628,15 @@ 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 -convey the exclusion of warranty; and each file should have at least +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. - {description} - Copyright (C) {year} {fullname} + Quantum Package + Copyright (C) 2018 Anthony Scemama, Emmanuel Giner - This program is free software; you can redistribute it and/or modify + 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 2 of the License, or + 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, @@ -303,37 +644,31 @@ the "copyright" line and a pointer to where the full notice is found. 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, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + 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 is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + Quantum Package Copyright (C) 2018 Anthony Scemam, Emmanuel Giner + 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, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. +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 your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: + 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 +. - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This 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. \ No newline at end of file + 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/bin/qp_gaspi_run b/bin/qp_gaspi_run deleted file mode 100755 index ec54afdc..00000000 --- a/bin/qp_gaspi_run +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -QP_ROOT=$( cd $(dirname "${BASH_SOURCE}")/.. ; pwd -P ) -source $HOME/.bashrc -source $QP_ROOT/quantum_package.rc -exec $QP_ROOT/ocaml/qp_run $@ diff --git a/config/ifort_debug.cfg b/config/ifort_debug.cfg new file mode 100644 index 00000000..f5b25e81 --- /dev/null +++ b/config/ifort_debug.cfg @@ -0,0 +1,63 @@ +# Common flags +############## +# +# -mkl=[parallel|sequential] : Use the MKL library +# --ninja : Allow the utilisation of ninja. It is mandatory ! +# --align=32 : Align all provided arrays on a 32-byte boundary +# +[COMMON] +FC : ifort +LAPACK_LIB : -mkl=parallel +IRPF90 : irpf90 +IRPF90_FLAGS : --ninja --align=32 --assert + +# Global options +################ +# +# 1 : Activate +# 0 : Deactivate +# +[OPTION] +MODE : DEBUG ; [ OPT | PROFILE | DEBUG ] : Chooses the section below +CACHE : 1 ; Enable cache_compile.py +OPENMP : 1 ; Append OpenMP flags + +# Optimization flags +#################### +# +# -xHost : Compile a binary optimized for the current architecture +# -O2 : O3 not better than O2. +# -ip : Inter-procedural optimizations +# -ftz : Flushes denormal results to zero +# +[OPT] +FC : -traceback +FCFLAGS : -xAVX -O2 -ip -ftz -g + +# Profiling flags +################# +# +[PROFILE] +FC : -p -g +FCFLAGS : -xSSE4.2 -O2 -ip -ftz + +# Debugging flags +################# +# +# -traceback : Activate backtrace on runtime +# -fpe0 : All floating point exaceptions +# -C : Checks uninitialized variables, array subscripts, etc... +# -g : Extra debugging information +# -xSSE2 : Valgrind needs a very simple x86 executable +# +[DEBUG] +FC : -g -traceback +FCFLAGS : -xSSE4.2 -C -fpe0 + +# OpenMP flags +################# +# +[OPENMP] +FC : -qopenmp +IRPF90_FLAGS : --openmp + diff --git a/configure b/configure index 99a98261..d69f63fa 100755 --- a/configure +++ b/configure @@ -66,7 +66,6 @@ d_dependency = { "python": [], "ninja": ["g++", "python"], "make": [], - "p_graphviz": ["python"], "bats": [], "gmp" : ["make", "g++"] } @@ -152,11 +151,6 @@ f77zmq = Info( description=' F77-ZeroMQ', default_path=join(QP_ROOT_LIB, "libf77zmq.a") ) -p_graphviz = Info( - url='https://github.com/xflr6/graphviz/archive/master.tar.gz', - description=' Python library for graphviz', - default_path=join(QP_ROOT_INSTALL, "p_graphviz")) - bats = Info( url='https://github.com/sstephenson/bats/archive/master.tar.gz', description=' Bash Automated Testing System', @@ -165,7 +159,7 @@ bats = Info( d_info = dict() for m in ["ocaml", "m4", "curl", "zlib", "patch", "irpf90", "docopt", - "resultsFile", "ninja", "emsl", "ezfio", "p_graphviz", + "resultsFile", "ninja", "emsl", "ezfio", "zeromq", "f77zmq", "bats", "gmp"]: exec ("d_info['{0}']={0}".format(m)) diff --git a/docs/source/Makefile b/docs/source/Makefile new file mode 100644 index 00000000..24cb7918 --- /dev/null +++ b/docs/source/Makefile @@ -0,0 +1,2 @@ +default: + make -C ../ html diff --git a/docs/source/interfaces.rst b/docs/source/interfaces.rst index bafb7e3e..2cf4ccdb 100644 --- a/docs/source/interfaces.rst +++ b/docs/source/interfaces.rst @@ -18,7 +18,7 @@ FCIDUMP .. _Molden: http://cheminf.cmbi.ru.nl/molden/ .. _GAMESS: https://www.msg.chem.iastate.edu/gamess/ -.. _QMC=Chem: https://github.com/scemama/qmcchem +.. _QMC=Chem: https://gitlab.com/scemama/qmcchem .. _CHAMP: https://www.utwente.nl/en/tnw/ccp/research/CHAMP.html .. _NECI: https://github.com/ghb24/NECI_STABLE .. _Dice: https://sanshar.github.io/Dice/ diff --git a/docs/source/intro.rst b/docs/source/intro.rst index b292048f..9ee6481d 100644 --- a/docs/source/intro.rst +++ b/docs/source/intro.rst @@ -25,15 +25,16 @@ their own programs. The |qp| has been designed specifically for sCI, so all the algorithms which are programmed are not adapted to run SCF or DFT calculations -on thousands of atoms. +on thousands of atoms. Currently, the systems targeted have less than 500 +molecular orbitals. The |qp| is *not* a massive production code. For conventional -methods such as Hartree-Fock CISD or MP2, the users are recommended to use the +methods such as Hartree-Fock, CISD or MP2, the users are recommended to use the existing standard production codes which are designed to make these methods run fast. Again, the role of the |qp| is to make life simple for the developer. Once a new method is developed and tested, the developer is encouraged to consider re-expressing it with an integral-driven formulation, and to -implement the new method is open-source production codes, such as `NWChem`_ +implement the new method in open-source production codes, such as `NWChem`_ or `GAMESS`_. diff --git a/docs/source/programming.rst b/docs/source/programming.rst index ff73c434..96667949 100644 --- a/docs/source/programming.rst +++ b/docs/source/programming.rst @@ -1,2 +1,5 @@ -Programming the Quantum Package -=============================== +Programming in the Quantum Package +================================== + +.. include:: work.rst + diff --git a/ocaml/test_atom.ml b/ocaml/tests/test_atom.ml similarity index 100% rename from ocaml/test_atom.ml rename to ocaml/tests/test_atom.ml diff --git a/ocaml/test_basis.ml b/ocaml/tests/test_basis.ml similarity index 100% rename from ocaml/test_basis.ml rename to ocaml/tests/test_basis.ml diff --git a/ocaml/test_bitlist.ml b/ocaml/tests/test_bitlist.ml similarity index 100% rename from ocaml/test_bitlist.ml rename to ocaml/tests/test_bitlist.ml diff --git a/ocaml/test_determinants.ml b/ocaml/tests/test_determinants.ml similarity index 100% rename from ocaml/test_determinants.ml rename to ocaml/tests/test_determinants.ml diff --git a/ocaml/test_elements.ml b/ocaml/tests/test_elements.ml similarity index 100% rename from ocaml/test_elements.ml rename to ocaml/tests/test_elements.ml diff --git a/ocaml/test_excitation.ml b/ocaml/tests/test_excitation.ml similarity index 100% rename from ocaml/test_excitation.ml rename to ocaml/tests/test_excitation.ml diff --git a/ocaml/test_gto.ml b/ocaml/tests/test_gto.ml similarity index 100% rename from ocaml/test_gto.ml rename to ocaml/tests/test_gto.ml diff --git a/ocaml/test_message.ml b/ocaml/tests/test_message.ml similarity index 100% rename from ocaml/test_message.ml rename to ocaml/tests/test_message.ml diff --git a/ocaml/test_mo_label.ml b/ocaml/tests/test_mo_label.ml similarity index 100% rename from ocaml/test_mo_label.ml rename to ocaml/tests/test_mo_label.ml diff --git a/ocaml/test_molecule.ml b/ocaml/tests/test_molecule.ml similarity index 100% rename from ocaml/test_molecule.ml rename to ocaml/tests/test_molecule.ml diff --git a/ocaml/test_point3d.ml b/ocaml/tests/test_point3d.ml similarity index 100% rename from ocaml/test_point3d.ml rename to ocaml/tests/test_point3d.ml diff --git a/ocaml/tests/test_progress_bar.ml b/ocaml/tests/test_progress_bar.ml new file mode 100644 index 00000000..53f47daf --- /dev/null +++ b/ocaml/tests/test_progress_bar.ml @@ -0,0 +1,38 @@ +open Core + +let test1 () = + let bar = + Progress_bar.init ~title:"Title" ~start_value:2. ~end_value:23. ~bar_length:30 + in + let rec loop bar = function + | i when i = 24 -> () + | i -> + let x = + Float.of_int i + in + let bar = + Progress_bar.update ~cur_value:x bar + |> Progress_bar.display + in + Unix.sleep 1 ; + loop bar (i+1) + in + loop bar 2 + +let test2 () = + let bar = + Progress_bar.init ~title:"Title" ~start_value:2. ~end_value:23. ~bar_length:30 + in + let rec loop bar = function + | i when i = 24 -> () + | i -> + let bar = + Progress_bar.increment bar + |> Progress_bar.display + in + Unix.sleep 1 ; + loop bar (i+1) + in + loop bar 2 + +let () = test2 () diff --git a/ocaml/test_pseudo.ml b/ocaml/tests/test_pseudo.ml similarity index 100% rename from ocaml/test_pseudo.ml rename to ocaml/tests/test_pseudo.ml diff --git a/ocaml/tests/test_pub.py b/ocaml/tests/test_pub.py new file mode 100755 index 00000000..e4a883ee --- /dev/null +++ b/ocaml/tests/test_pub.py @@ -0,0 +1,15 @@ +#!/usr/bin/python + +import zmq +import sys, os + +def main(): + context = zmq.Context() + socket = context.socket(zmq.SUB) + socket.connect("tcp://127.0.0.1:41280") + socket.setsockopt(zmq.SUBSCRIBE, "") + while True: + print socket.recv() + +if __name__ == '__main__': + main() diff --git a/ocaml/test_queuing_system.ml b/ocaml/tests/test_queuing_system.ml similarity index 100% rename from ocaml/test_queuing_system.ml rename to ocaml/tests/test_queuing_system.ml diff --git a/ocaml/test_symmetry.ml b/ocaml/tests/test_symmetry.ml similarity index 100% rename from ocaml/test_symmetry.ml rename to ocaml/tests/test_symmetry.ml diff --git a/ocaml/test_task_server.ml b/ocaml/tests/test_task_server.ml similarity index 100% rename from ocaml/test_task_server.ml rename to ocaml/tests/test_task_server.ml diff --git a/ocaml/test_task_server.py b/ocaml/tests/test_task_server.py similarity index 100% rename from ocaml/test_task_server.py rename to ocaml/tests/test_task_server.py diff --git a/plugins/All_singles/tree_dependency.png b/plugins/All_singles/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/Bk/EZFIO.cfg b/plugins/Bk/EZFIO.cfg deleted file mode 100644 index c594bcf8..00000000 --- a/plugins/Bk/EZFIO.cfg +++ /dev/null @@ -1,23 +0,0 @@ -[energy] -type: double precision -doc: Calculated energy -interface: ezfio - -[thresh_dressed_ci] -type: Threshold -doc: Threshold on the convergence of the dressed CI energy -interface: ezfio,provider,ocaml -default: 1.e-5 - -[n_it_max_dressed_ci] -type: Strictly_positive_int -doc: Maximum number of dressed CI iterations -interface: ezfio,provider,ocaml -default: 10 - -[h0_type] -type: Perturbation -doc: Type of zeroth-order Hamiltonian [ EN | Barycentric ] -interface: ezfio,provider,ocaml -default: EN - diff --git a/plugins/Bk/NEEDED_CHILDREN_MODULES b/plugins/Bk/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 709c29ec..00000000 --- a/plugins/Bk/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1,2 +0,0 @@ -Bitmask dress_zmq DavidsonDressed Generators_full Selectors_full - diff --git a/plugins/Bk/README.rst b/plugins/Bk/README.rst deleted file mode 100644 index 7b379f8e..00000000 --- a/plugins/Bk/README.rst +++ /dev/null @@ -1,12 +0,0 @@ -== -Bk -== - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. diff --git a/plugins/Bk/bk.irp.f b/plugins/Bk/bk.irp.f deleted file mode 100644 index 254320f7..00000000 --- a/plugins/Bk/bk.irp.f +++ /dev/null @@ -1,26 +0,0 @@ -program bk - implicit none - BEGIN_DOC -! Shifted-Bk method - END_DOC - read_wf = .True. - state_following = .True. - TOUCH read_wf state_following - call run() -end - -subroutine run - implicit none - call diagonalize_ci_dressed - integer :: istate - print *, 'Bk Energy' - print *, '---------' - print *, '' - do istate = 1,N_states - print *, istate, CI_energy_dressed(istate) - enddo -! call save_wavefunction - call ezfio_set_bk_energy(ci_energy_dressed(1)) -end - - diff --git a/plugins/Bk/dressing.irp.f b/plugins/Bk/dressing.irp.f deleted file mode 100644 index 721a7554..00000000 --- a/plugins/Bk/dressing.irp.f +++ /dev/null @@ -1,66 +0,0 @@ - BEGIN_PROVIDER [ double precision, fock_diag_tmp_, (2,mo_tot_num+1,Nproc) ] -&BEGIN_PROVIDER [ integer, current_generator_, (Nproc) ] - implicit none - BEGIN_DOC -! Temporary arrays for speedup - END_DOC - current_generator_(:) = 0 - END_PROVIDER - - -subroutine dress_with_alpha_buffer(Nstates,Ndet,Nint,delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc) - use bitmasks - implicit none - BEGIN_DOC - !delta_ij_loc(:,:,1) : dressing column for H - !delta_ij_loc(:,:,2) : dressing column for S2 - !minilist : indices of determinants connected to alpha ( in psi_det_sorted ) - !n_minilist : size of minilist - !alpha : alpha determinant - END_DOC - integer, intent(in) :: Nint, Ndet, Nstates, n_minilist, iproc, i_gen - integer(bit_kind), intent(in) :: alpha(Nint,2), det_minilist(Nint, 2, n_minilist) - integer,intent(in) :: minilist(n_minilist) - double precision, intent(inout) :: delta_ij_loc(Nstates,Ndet,2) - - integer :: j, j_mini, i_state - double precision :: c_alpha(N_states), h_alpha_alpha, hdress, sdress - double precision :: i_h_alpha, i_s_alpha, alpha_h_psi(N_states) - - double precision, external :: diag_H_mat_elem_fock - - if(current_generator_(iproc) /= i_gen) then - current_generator_(iproc) = i_gen - call build_fock_tmp(fock_diag_tmp_(1,1,iproc),psi_det_generators(1,1,i_gen),N_int) - end if - - h_alpha_alpha = diag_H_mat_elem_fock(psi_det_generators(1,1,i_gen),alpha,fock_diag_tmp_(1,1,iproc),N_int) - call i_H_psi_minilist(alpha,det_minilist,minilist,n_minilist,psi_coef,N_int,n_minilist,size(psi_coef,1),N_states,alpha_h_psi) - - do i_state=1,N_states - if (h_alpha_alpha - dress_e0_denominator(i_state) > 0.1d0 ) then - c_alpha(i_state) = alpha_h_psi(i_state) / & - (dress_e0_denominator(i_state) - h_alpha_alpha) - else - c_alpha(i_state) = 0.d0 - endif - enddo - - do j_mini=1,n_minilist - j = minilist(j_mini) - call i_H_j (det_minilist(1,1,j_mini),alpha,N_int,i_h_alpha) - call get_s2(det_minilist(1,1,j_mini),alpha,N_int,i_s_alpha) - do i_state=1,N_states - hdress = c_alpha(i_state) * i_h_alpha - sdress = c_alpha(i_state) * i_s_alpha - !$OMP ATOMIC - delta_ij_loc(i_state,j,1) = delta_ij_loc(i_state,j,1) + hdress - !$OMP ATOMIC - delta_ij_loc(i_state,j,2) = delta_ij_loc(i_state,j,2) + sdress - enddo - enddo - - -end subroutine - - diff --git a/plugins/Bk/extra_functions.irp.f b/plugins/Bk/extra_functions.irp.f deleted file mode 100644 index f6d196be..00000000 --- a/plugins/Bk/extra_functions.irp.f +++ /dev/null @@ -1,58 +0,0 @@ - BEGIN_PROVIDER [ integer, N_dress_int_buffer ] -&BEGIN_PROVIDER [ integer, N_dress_double_buffer ] -&BEGIN_PROVIDER [ integer, N_dress_det_buffer ] - implicit none - N_dress_int_buffer = 1 - N_dress_double_buffer = 1 - N_dress_det_buffer = 1 -END_PROVIDER - - - -subroutine delta_ij_done() - BEGIN_DOC - ! This subroutine is executed on the master when the dressing has been computed, - ! before the diagonalization. - END_DOC -end - -subroutine dress_pulled(ind, int_buf, double_buf, det_buf, N_buf) - use bitmasks - implicit none - BEGIN_DOC - ! Dress the contributions pulled from the slave. - END_DOC - - integer, intent(in) :: ind, N_buf(3) - integer, intent(in) :: int_buf(*) - double precision, intent(in) :: double_buf(*) - integer(bit_kind), intent(in) :: det_buf(N_int,2,*) -end - -subroutine generator_start(i_gen, iproc) - implicit none - BEGIN_DOC - ! This subroutine is executed on the slave before computing the contribution of a generator. - END_DOC - - integer, intent(in) :: i_gen, iproc - integer :: i -end - -subroutine generator_done(i_gen, int_buf, double_buf, det_buf, N_buf, iproc) - implicit none - BEGIN_DOC - ! This subroutine is executed on the slave after computing the contribution of a generator. - END_DOC - integer, intent(in) :: i_gen, iproc - integer, intent(out) :: int_buf(N_dress_int_buffer), N_buf(3) - double precision, intent(out) :: double_buf(N_dress_double_buffer) - integer(bit_kind), intent(out) :: det_buf(N_int, 2, N_dress_det_buffer) - N_buf(:) = 1 - int_buf(:) = 0 - double_buf(:) = 0.d0 - det_buf(:,:,:) = 0 -end - - - diff --git a/plugins/CAS_SD_ZMQ/EZFIO.cfg b/plugins/CAS_SD_ZMQ/EZFIO.cfg deleted file mode 100644 index 43905f9e..00000000 --- a/plugins/CAS_SD_ZMQ/EZFIO.cfg +++ /dev/null @@ -1,15 +0,0 @@ -[energy] -type: double precision -doc: Calculated CAS-SD energy -interface: ezfio - -[energy_pt2] -type: double precision -doc: Calculated selected CAS-SD energy with PT2 correction -interface: ezfio - -[do_ddci] -type: logical -doc: If true, remove purely inactive double excitations -interface: ezfio,provider,ocaml -default: False diff --git a/plugins/CAS_SD_ZMQ/NEEDED_CHILDREN_MODULES b/plugins/CAS_SD_ZMQ/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 91dd3eff..00000000 --- a/plugins/CAS_SD_ZMQ/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1,2 +0,0 @@ -Generators_CAS Perturbation Selectors_CASSD ZMQ DavidsonUndressed - diff --git a/plugins/CAS_SD_ZMQ/README.rst b/plugins/CAS_SD_ZMQ/README.rst deleted file mode 100644 index 45ba97e4..00000000 --- a/plugins/CAS_SD_ZMQ/README.rst +++ /dev/null @@ -1,14 +0,0 @@ -========== -CAS_SD_ZMQ -========== - -Selected CAS+SD module with Zero-MQ parallelization. - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. diff --git a/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f b/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f deleted file mode 100644 index 0cef5d6f..00000000 --- a/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f +++ /dev/null @@ -1,230 +0,0 @@ -program cassd_zmq - implicit none - integer :: i,j,k - double precision, allocatable :: pt2(:) - integer :: degree - integer :: n_det_before, to_select - double precision :: threshold_davidson_in - double precision :: error(N_states) - - allocate (pt2(N_states)) - - double precision :: hf_energy_ref - logical :: has - integer :: N_states_p - character*(512) :: fmt - character*(8) :: pt2_string - - pt2 = -huge(1.d0) - error = 0.d0 - threshold_davidson_in = threshold_davidson - threshold_davidson = threshold_davidson_in * 100.d0 - SOFT_TOUCH threshold_davidson - - if (do_pt2) then - pt2_string = ' ' - else - pt2_string = '(approx)' - endif - - call diagonalize_CI - call save_wavefunction - - call ezfio_has_hartree_fock_energy(has) - if (has) then - call ezfio_get_hartree_fock_energy(hf_energy_ref) - else - hf_energy_ref = ref_bitmask_energy - endif - - if (N_det > N_det_max) then - psi_det = psi_det_sorted - psi_coef = psi_coef_sorted - N_det = N_det_max - soft_touch N_det psi_det psi_coef - call diagonalize_CI - call save_wavefunction - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - do k=1,N_states - print*,'State ',k - print *, 'PT2 = ', pt2(k) - print *, 'E = ', CI_energy(k) - print *, 'E+PT2 = ', CI_energy(k) + pt2(k) - print *, '-----' - enddo - endif - double precision :: E_CI_before(N_states) - - - if (.True.) then ! Avoid pre-calculation of CI_energy - E_CI_before(1:N_states) = CI_energy(1:N_states) - endif - n_det_before = 0 - - double precision :: correlation_energy_ratio - correlation_energy_ratio = 0.d0 - - if (.True.) then ! Avoid pre-calculation of CI_energy - do while ( & - (N_det < N_det_max) .and. & - (maxval(abs(pt2(1:N_states))) > pt2_max) .and. & - (correlation_energy_ratio <= correlation_energy_ratio_max) & - ) - write(*,'(A)') '--------------------------------------------------------------------------------' - - - correlation_energy_ratio = (CI_energy(1) - hf_energy_ref) / & - (E_CI_before(1) + pt2(1) - hf_energy_ref) - correlation_energy_ratio = min(1.d0,correlation_energy_ratio) - - - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - print*, 'correlation_ratio = ', correlation_energy_ratio - - do k=1, N_states - print*,'State ',k - print *, 'PT2 = ', pt2(k) - print *, 'E = ', CI_energy(k) - print *, 'E(before)+PT2 = ', E_CI_before(k)+pt2(k) - enddo - - print *, '-----' - if(N_states.gt.1)then - print*,'Variational Energy difference' - do i = 2, N_states - print*,'Delta E = ',CI_energy(i) - CI_energy(1) - enddo - endif - if(N_states.gt.1)then - print*,'Variational + perturbative Energy difference' - do i = 2, N_states - print*,'Delta E = ',E_CI_before(i)+ pt2(i) - (E_CI_before(1) + pt2(1)) - enddo - endif - E_CI_before(1:N_states) = CI_energy(1:N_states) - - n_det_before = N_det - to_select = N_det - to_select = max(N_det, to_select) - to_select = min(to_select, N_det_max-n_det_before) - call ZMQ_selection(to_select, pt2) - - N_states_p = min(N_det,N_states) - - print *, '' - print '(A,I12)', 'Summary at N_det = ', N_det - print '(A)', '-----------------------------------' - print *, '' - call write_double(6,correlation_energy_ratio, 'Correlation ratio') - print *, '' - - write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' - write(*,fmt) - write(fmt,*) '(12X,', N_states_p, '(6X,A7,1X,I6,10X))' - write(*,fmt) ('State',k, k=1,N_states_p) - write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' - write(*,fmt) - write(fmt,*) '(A12,', N_states_p, '(1X,F14.8,15X))' - write(*,fmt) '# E ', E_CI_before(1:N_states_p) - if (N_states_p > 1) then - write(*,fmt) '# Excit. (au)', E_CI_before(1:N_states_p)-E_CI_before(1) - write(*,fmt) '# Excit. (eV)', (E_CI_before(1:N_states_p)-E_CI_before(1))*27.211396641308d0 - endif - write(fmt,*) '(A12,', 2*N_states_p, '(1X,F14.8))' - write(*,fmt) '# PT2'//pt2_string, (pt2(k), error(k), k=1,N_states_p) - write(*,'(A)') '#' - write(*,fmt) '# E+PT2 ', (E_CI_before(k)+pt2(k),error(k), k=1,N_states_p) - if (N_states_p > 1) then - write(*,fmt) '# Excit. (au)', ( (E_CI_before(k)+pt2(k)-E_CI_before(1)-pt2(1)), & - dsqrt(error(k)*error(k)+error(1)*error(1)), k=1,N_states_p) - write(*,fmt) '# Excit. (eV)', ( (E_CI_before(k)+pt2(k)-E_CI_before(1)-pt2(1))*27.211396641308d0, & - dsqrt(error(k)*error(k)+error(1)*error(1))*27.211396641308d0, k=1,N_states_p) - endif - write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' - write(*,fmt) - print *, '' - - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - print*, 'correlation_ratio = ', correlation_energy_ratio - - do k=1, N_states_p - print*,'State ',k - print *, 'PT2 = ', pt2(k) - print *, 'E = ', E_CI_before(k) - print *, 'E+PT2'//pt2_string//' = ', E_CI_before(k)+pt2(k), ' +/- ', error(k) - enddo - - print *, '-----' - if(N_states.gt.1)then - print *, 'Variational Energy difference (au | eV)' - do i=2, N_states_p - print*,'Delta E = ', (E_CI_before(i) - E_CI_before(1)), & - (E_CI_before(i) - E_CI_before(1)) * 27.211396641308d0 - enddo - print *, '-----' - print*, 'Variational + perturbative Energy difference (au | eV)' - do i=2, N_states_p - print*,'Delta E = ', (E_CI_before(i)+ pt2(i) - (E_CI_before(1) + pt2(1))), & - (E_CI_before(i)+ pt2(i) - (E_CI_before(1) + pt2(1))) * 27.211396641308d0 - enddo - endif - - PROVIDE psi_coef - PROVIDE psi_det - PROVIDE psi_det_sorted - - if (N_det >= N_det_max) then - threshold_davidson = threshold_davidson_in - end if - call diagonalize_CI - call save_wavefunction - call ezfio_set_cas_sd_zmq_energy(CI_energy(1)) - enddo - endif - - if (N_det < N_det_max) then - threshold_davidson = threshold_davidson_in - call diagonalize_CI - call save_wavefunction - call ezfio_set_cas_sd_zmq_energy(CI_energy(1)) - endif - - integer :: exc_max, degree_min - exc_max = 0 - print *, 'CAS determinants : ', N_det_cas - do i=1,min(N_det_cas,20) - do k=i,N_det_cas - call get_excitation_degree(psi_cas(1,1,k),psi_cas(1,1,i),degree,N_int) - exc_max = max(exc_max,degree) - enddo - print *, psi_cas_coef(i,:) - call debug_det(psi_cas(1,1,i),N_int) - print *, '' - enddo - print *, 'Max excitation degree in the CAS :', exc_max - - if(do_pt2)then - print*,'Last iteration only to compute the PT2' - threshold_selectors = max(threshold_selectors,threshold_selectors_pt2) - threshold_generators = max(threshold_generators,threshold_generators_pt2) - TOUCH threshold_selectors threshold_generators - E_CI_before(1:N_states) = CI_energy(1:N_states) - call ZMQ_selection(0, pt2) - print *, 'Final step' - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - do k=1,N_states - print *, 'State', k - print *, 'PT2 = ', pt2(k) - print *, 'E = ', E_CI_before(k) - print *, 'E+PT2 = ', E_CI_before(k)+pt2(k) - print *, '-----' - enddo - call ezfio_set_cas_sd_zmq_energy(CI_energy(1)) - call ezfio_set_cas_sd_zmq_energy_pt2(E_CI_before(1)+pt2(1)) - endif - -end diff --git a/plugins/CAS_SD_ZMQ/energy.irp.f b/plugins/CAS_SD_ZMQ/energy.irp.f deleted file mode 100644 index db1e7d1a..00000000 --- a/plugins/CAS_SD_ZMQ/energy.irp.f +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN_PROVIDER [ double precision, pt2_E0_denominator, (N_states) ] - implicit none - BEGIN_DOC - ! E0 in the denominator of the PT2 - END_DOC - pt2_E0_denominator(1:N_states) = CI_electronic_energy(1:N_states) -! pt2_E0_denominator(1:N_states) = HF_energy - nuclear_repulsion -! pt2_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states) - call write_double(6,pt2_E0_denominator(1)+nuclear_repulsion, 'PT2 Energy denominator') -END_PROVIDER - diff --git a/plugins/CAS_SD_ZMQ/run_selection_slave.irp.f b/plugins/CAS_SD_ZMQ/run_selection_slave.irp.f deleted file mode 100644 index 2a59437e..00000000 --- a/plugins/CAS_SD_ZMQ/run_selection_slave.irp.f +++ /dev/null @@ -1,177 +0,0 @@ - -subroutine run_selection_slave(thread,iproc,energy) - use f77_zmq - use selection_types - implicit none - - double precision, intent(in) :: energy(N_states) - integer, intent(in) :: thread, iproc - integer :: rc, i - - integer :: worker_id, task_id(1), ctask, ltask - character*(512) :: task - - integer(ZMQ_PTR),external :: new_zmq_to_qp_run_socket - integer(ZMQ_PTR) :: zmq_to_qp_run_socket - - integer(ZMQ_PTR), external :: new_zmq_push_socket - integer(ZMQ_PTR) :: zmq_socket_push - - type(selection_buffer) :: buf, buf2 - logical :: done - double precision :: pt2(N_states) - - zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() - - integer, external :: connect_to_taskserver - - if (connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) == -1) then - call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) - return - endif - - zmq_socket_push = new_zmq_push_socket(thread) - - buf%N = 0 - ctask = 1 - pt2 = 0d0 - - do - integer, external :: get_task_from_taskserver - if (get_task_from_taskserver(zmq_to_qp_run_socket,worker_id, task_id(ctask), task) == -1) then - exit - endif - done = task_id(ctask) == 0 - if (done) then - ctask = ctask - 1 - else - integer :: i_generator, N - read (task,*) i_generator, N - if(buf%N == 0) then - ! Only first time - call create_selection_buffer(N, N*2, buf) - call create_selection_buffer(N, N*3, buf2) - else - if(N /= buf%N) stop "N changed... wtf man??" - end if - call select_connected(i_generator,energy,pt2,buf) - endif - - integer, external :: task_done_to_taskserver - if(done .or. ctask == size(task_id)) then - if(buf%N == 0 .and. ctask > 0) stop "uninitialized selection_buffer" - do i=1, ctask - if (task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id(i)) == -1) then - call sleep(1) - if (task_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id(i)) == -1) then - done = .True. - ctask = 0 - exit - endif - endif - end do - if(ctask > 0) then - call push_selection_results(zmq_socket_push, pt2, buf, task_id(1), ctask) - do i=1,buf%cur - call add_to_selection_buffer(buf2, buf%det(1,1,i), buf%val(i)) - enddo - call sort_selection_buffer(buf2) - buf%mini = buf2%mini - pt2 = 0d0 - buf%cur = 0 - end if - ctask = 0 - end if - - if(done) exit - ctask = ctask + 1 - end do - - integer, external :: disconnect_from_taskserver - if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) == -1) then - continue - endif - - call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) - call end_zmq_push_socket(zmq_socket_push,thread) -end subroutine - - -subroutine push_selection_results(zmq_socket_push, pt2, b, task_id, ntask) - use f77_zmq - use selection_types - implicit none - - integer(ZMQ_PTR), intent(in) :: zmq_socket_push - double precision, intent(in) :: pt2(N_states) - type(selection_buffer), intent(inout) :: b - integer, intent(in) :: ntask, task_id(*) - integer :: rc - - call sort_selection_buffer(b) - - rc = f77_zmq_send( zmq_socket_push, b%cur, 4, ZMQ_SNDMORE) - if(rc /= 4) stop "push" - rc = f77_zmq_send( zmq_socket_push, pt2, 8*N_states, ZMQ_SNDMORE) - if(rc /= 8*N_states) stop "push" - - rc = f77_zmq_send( zmq_socket_push, b%val(1), 8*b%cur, ZMQ_SNDMORE) - if(rc /= 8*b%cur) stop "push" - - rc = f77_zmq_send( zmq_socket_push, b%det(1,1,1), bit_kind*N_int*2*b%cur, ZMQ_SNDMORE) - if(rc /= bit_kind*N_int*2*b%cur) stop "push" - - rc = f77_zmq_send( zmq_socket_push, ntask, 4, ZMQ_SNDMORE) - if(rc /= 4) stop "push" - - rc = f77_zmq_send( zmq_socket_push, task_id(1), ntask*4, 0) - if(rc /= 4*ntask) stop "push" - -! Activate is zmq_socket_push is a REQ -IRP_IF ZMQ_PUSH -IRP_ELSE - rc = f77_zmq_recv( zmq_socket_push, task_id(1), ntask*4, 0) -IRP_ENDIF - -end subroutine - - -subroutine pull_selection_results(zmq_socket_pull, pt2, val, det, N, task_id, ntask) - use f77_zmq - use selection_types - implicit none - integer(ZMQ_PTR), intent(in) :: zmq_socket_pull - double precision, intent(inout) :: pt2(N_states) - double precision, intent(out) :: val(*) - integer(bit_kind), intent(out) :: det(N_int, 2, *) - integer, intent(out) :: N, ntask, task_id(*) - integer :: rc, rn, i - - rc = f77_zmq_recv( zmq_socket_pull, N, 4, 0) - if(rc /= 4) stop "pull" - - rc = f77_zmq_recv( zmq_socket_pull, pt2, N_states*8, 0) - if(rc /= 8*N_states) stop "pull" - - rc = f77_zmq_recv( zmq_socket_pull, val(1), 8*N, 0) - if(rc /= 8*N) stop "pull" - - rc = f77_zmq_recv( zmq_socket_pull, det(1,1,1), bit_kind*N_int*2*N, 0) - if(rc /= bit_kind*N_int*2*N) stop "pull" - - rc = f77_zmq_recv( zmq_socket_pull, ntask, 4, 0) - if(rc /= 4) stop "pull" - - rc = f77_zmq_recv( zmq_socket_pull, task_id(1), ntask*4, 0) - if(rc /= 4*ntask) stop "pull" - -! Activate is zmq_socket_pull is a REP -IRP_IF ZMQ_PUSH -IRP_ELSE - rc = f77_zmq_send( zmq_socket_pull, task_id(1), ntask*4, 0) -IRP_ENDIF - -end subroutine - - - diff --git a/plugins/CAS_SD_ZMQ/selection.irp.f b/plugins/CAS_SD_ZMQ/selection.irp.f deleted file mode 100644 index 19121c89..00000000 --- a/plugins/CAS_SD_ZMQ/selection.irp.f +++ /dev/null @@ -1,1344 +0,0 @@ -use bitmasks - - -BEGIN_PROVIDER [ integer(1), psi_phasemask, (N_int*bit_kind_size, 2, N_det)] - use bitmasks - implicit none - - integer :: i - do i=1, N_det - call get_mask_phase(psi_selectors(1,1,i), psi_phasemask(1,1,i)) - end do -END_PROVIDER - - -subroutine assert(cond, msg) - character(*), intent(in) :: msg - logical, intent(in) :: cond - - if(.not. cond) then - print *, "assert fail: "//msg - stop - end if -end subroutine - - -subroutine get_mask_phase(det, phasemask) - use bitmasks - implicit none - - integer(bit_kind), intent(in) :: det(N_int, 2) - integer(1), intent(out) :: phasemask(N_int*bit_kind_size, 2) - integer :: s, ni, i - logical :: change - - phasemask = 0_1 - do s=1,2 - change = .false. - do ni=1,N_int - do i=0,bit_kind_size-1 - if(BTEST(det(ni, s), i)) change = .not. change - if(change) phasemask((ni-1)*bit_kind_size + i + 1, s) = 1_1 - end do - end do - end do -end subroutine - - -subroutine select_connected(i_generator,E0,pt2,b) - use bitmasks - use selection_types - implicit none - integer, intent(in) :: i_generator - type(selection_buffer), intent(inout) :: b - double precision, intent(inout) :: pt2(N_states) - integer :: k,l - double precision, intent(in) :: E0(N_states) - - integer(bit_kind) :: hole_mask(N_int,2), particle_mask(N_int,2) - double precision :: fock_diag_tmp(2,mo_tot_num+1) - - call build_fock_tmp(fock_diag_tmp,psi_det_generators(1,1,i_generator),N_int) - - do l=1,N_generators_bitmask - do k=1,N_int - hole_mask(k,1) = iand(generators_bitmask(k,1,s_hole,l), psi_det_generators(k,1,i_generator)) - hole_mask(k,2) = iand(generators_bitmask(k,2,s_hole,l), psi_det_generators(k,2,i_generator)) - particle_mask(k,1) = iand(generators_bitmask(k,1,s_part,l), not(psi_det_generators(k,1,i_generator)) ) - particle_mask(k,2) = iand(generators_bitmask(k,2,s_part,l), not(psi_det_generators(k,2,i_generator)) ) - - enddo - call select_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,b) - call select_singles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,b) - enddo -end subroutine - - -double precision function get_phase_bi(phasemask, s1, s2, h1, p1, h2, p2) - use bitmasks - implicit none - - integer(1), intent(in) :: phasemask(N_int*bit_kind_size, 2) - integer, intent(in) :: s1, s2, h1, h2, p1, p2 - logical :: change - integer(1) :: np - double precision, parameter :: res(0:1) = (/1d0, -1d0/) - - np = phasemask(h1,s1) + phasemask(p1,s1) + phasemask(h2,s2) + phasemask(p2,s2) - if(p1 < h1) np = np + 1_1 - if(p2 < h2) np = np + 1_1 - - if(s1 == s2 .and. max(h1, p1) > min(h2, p2)) np = np + 1_1 - get_phase_bi = res(iand(np,1_1)) -end function - - - -! Selection single -! ---------------- - -subroutine select_singles(i_gen,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,buf) - use bitmasks - use selection_types - implicit none - BEGIN_DOC -! Select determinants connected to i_det by H - END_DOC - integer, intent(in) :: i_gen - integer(bit_kind), intent(in) :: hole_mask(N_int,2), particle_mask(N_int,2) - double precision, intent(in) :: fock_diag_tmp(mo_tot_num) - double precision, intent(in) :: E0(N_states) - double precision, intent(inout) :: pt2(N_states) - type(selection_buffer), intent(inout) :: buf - - double precision :: vect(N_states, mo_tot_num) - logical :: bannedOrb(mo_tot_num) - integer :: i, j, k - integer :: h1,h2,s1,s2,i1,i2,ib,sp - integer(bit_kind) :: hole(N_int,2), particle(N_int,2), mask(N_int, 2) - logical :: fullMatch, ok - - - do k=1,N_int - hole (k,1) = iand(psi_det_generators(k,1,i_gen), hole_mask(k,1)) - hole (k,2) = iand(psi_det_generators(k,2,i_gen), hole_mask(k,2)) - particle(k,1) = iand(not(psi_det_generators(k,1,i_gen)), particle_mask(k,1)) - particle(k,2) = iand(not(psi_det_generators(k,2,i_gen)), particle_mask(k,2)) - enddo - - ! Create lists of holes and particles - ! ----------------------------------- - - integer :: N_holes(2), N_particles(2) - integer :: hole_list(N_int*bit_kind_size,2) - integer :: particle_list(N_int*bit_kind_size,2) - - call bitstring_to_list_ab(hole , hole_list , N_holes , N_int) - call bitstring_to_list_ab(particle, particle_list, N_particles, N_int) - - do sp=1,2 - do i=1, N_holes(sp) - h1 = hole_list(i,sp) - call apply_hole(psi_det_generators(1,1,i_gen), sp, h1, mask, ok, N_int) - bannedOrb = .true. - do j=1,N_particles(sp) - bannedOrb(particle_list(j, sp)) = .false. - end do - call spot_hasBeen(mask, sp, psi_selectors, i_gen, N_det, bannedOrb, fullMatch) - if(fullMatch) cycle - vect = 0d0 - call splash_p(mask, sp, psi_selectors(1,1,i_gen), psi_phasemask(1,1,i_gen), psi_selectors_coef_transp(1,i_gen), N_det_selectors - i_gen + 1, bannedOrb, vect) - call fill_buffer_single(i_gen, sp, h1, bannedOrb, fock_diag_tmp, E0, pt2, vect, buf) - end do - enddo -end subroutine - - -subroutine fill_buffer_single(i_generator, sp, h1, bannedOrb, fock_diag_tmp, E0, pt2, vect, buf) - use bitmasks - use selection_types - implicit none - - integer, intent(in) :: i_generator, sp, h1 - double precision, intent(in) :: vect(N_states, mo_tot_num) - logical, intent(in) :: bannedOrb(mo_tot_num) - double precision, intent(in) :: fock_diag_tmp(mo_tot_num) - double precision, intent(in) :: E0(N_states) - double precision, intent(inout) :: pt2(N_states) - type(selection_buffer), intent(inout) :: buf - logical :: ok - integer :: s1, s2, p1, p2, ib, istate - integer(bit_kind) :: mask(N_int, 2), det(N_int, 2) - double precision :: e_pert, delta_E, val, Hii, max_e_pert, tmp - double precision, external :: diag_H_mat_elem_fock - - - call apply_hole(psi_det_generators(1,1,i_generator), sp, h1, mask, ok, N_int) - - do p1=1,mo_tot_num - if(bannedOrb(p1)) cycle - if(vect(1, p1) == 0d0) cycle - call apply_particle(mask, sp, p1, det, ok, N_int) - - Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),det,fock_diag_tmp,N_int) - max_e_pert = 0d0 - - do istate=1,N_states - val = vect(istate, p1) + vect(istate, p1) - delta_E = E0(istate) - Hii - tmp = dsqrt(delta_E * delta_E + val * val) - if (delta_E < 0.d0) then - tmp = -tmp - endif - e_pert = 0.5d0 * ( tmp - delta_E) - pt2(istate) += e_pert - if(dabs(e_pert) > dabs(max_e_pert)) max_e_pert = e_pert - end do - - if(dabs(max_e_pert) > buf%mini) then - call add_to_selection_buffer(buf, det, max_e_pert) - endif - end do -end subroutine - - -subroutine splash_p(mask, sp, det, phasemask, coefs, N_sel, bannedOrb, vect) - use bitmasks - implicit none - - integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int,2,N_sel) - integer(1), intent(in) :: phasemask(N_int*bit_kind_size, 2, N_sel) - double precision, intent(in) :: coefs(N_states, N_sel) - integer, intent(in) :: sp, N_sel - logical, intent(inout) :: bannedOrb(mo_tot_num) - double precision, intent(inout) :: vect(N_states, mo_tot_num) - - integer :: i, j, h(0:2,2), p(0:3,2), nt - integer(bit_kind) :: perMask(N_int, 2), mobMask(N_int, 2), negMask(N_int, 2) - - do i=1,N_int - negMask(i,1) = not(mask(i,1)) - negMask(i,2) = not(mask(i,2)) - end do - - do i=1, N_sel - nt = 0 - do j=1,N_int - mobMask(j,1) = iand(negMask(j,1), det(j,1,i)) - mobMask(j,2) = iand(negMask(j,2), det(j,2,i)) - nt += popcnt(mobMask(j, 1)) + popcnt(mobMask(j, 2)) - end do - - if(nt > 3) cycle - - do j=1,N_int - perMask(j,1) = iand(mask(j,1), not(det(j,1,i))) - perMask(j,2) = iand(mask(j,2), not(det(j,2,i))) - end do - - call bitstring_to_list(perMask(1,1), h(1,1), h(0,1), N_int) - call bitstring_to_list(perMask(1,2), h(1,2), h(0,2), N_int) - - call bitstring_to_list(mobMask(1,1), p(1,1), p(0,1), N_int) - call bitstring_to_list(mobMask(1,2), p(1,2), p(0,2), N_int) - - if(nt == 3) then - call get_m2(det(1,1,i), phasemask(1,1,i), bannedOrb, vect, mask, h, p, sp, coefs(1, i)) - else if(nt == 2) then - call get_m1(det(1,1,i), phasemask(1,1,i), bannedOrb, vect, mask, h, p, sp, coefs(1, i)) - else - call get_m0(det(1,1,i), phasemask(1,1,i), bannedOrb, vect, mask, h, p, sp, coefs(1, i)) - end if - end do -end subroutine - - -subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) - use bitmasks - implicit none - - integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2) - integer(1), intent(in) :: phasemask(N_int*bit_kind_size, 2) - logical, intent(in) :: bannedOrb(mo_tot_num) - double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: vect(N_states, mo_tot_num) - integer, intent(in) :: sp, h(0:2, 2), p(0:3, 2) - integer :: i, j, h1, h2, p1, p2, sfix, hfix, pfix, hmob, pmob, puti - double precision :: hij - double precision, external :: get_phase_bi, mo_bielec_integral - - integer, parameter :: turn3_2(2,3) = reshape((/2,3, 1,3, 1,2/), (/2,3/)) - integer, parameter :: turn2(2) = (/2,1/) - - if(h(0,sp) == 2) then - h1 = h(1, sp) - h2 = h(2, sp) - do i=1,3 - puti = p(i, sp) - if(bannedOrb(puti)) cycle - p1 = p(turn3_2(1,i), sp) - p2 = p(turn3_2(2,i), sp) - hij = mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2, p1, h1, h2) - hij *= get_phase_bi(phasemask, sp, sp, h1, p1, h2, p2) - vect(:, puti) += hij * coefs - end do - else if(h(0,sp) == 1) then - sfix = turn2(sp) - hfix = h(1,sfix) - pfix = p(1,sfix) - hmob = h(1,sp) - do j=1,2 - puti = p(j, sp) - if(bannedOrb(puti)) cycle - pmob = p(turn2(j), sp) - hij = mo_bielec_integral(pfix, pmob, hfix, hmob) - hij *= get_phase_bi(phasemask, sp, sfix, hmob, pmob, hfix, pfix) - vect(:, puti) += hij * coefs - end do - else - puti = p(1,sp) - if(.not. bannedOrb(puti)) then - sfix = turn2(sp) - p1 = p(1,sfix) - p2 = p(2,sfix) - h1 = h(1,sfix) - h2 = h(2,sfix) - hij = (mo_bielec_integral(p1,p2,h1,h2) - mo_bielec_integral(p2,p1,h1,h2)) - hij *= get_phase_bi(phasemask, sfix, sfix, h1, p1, h2, p2) - vect(:, puti) += hij * coefs - end if - end if -end subroutine - - - -subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) - use bitmasks - implicit none - - integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2) - integer(1), intent(in) :: phasemask(N_int*bit_kind_size, 2) - logical, intent(in) :: bannedOrb(mo_tot_num) - double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: vect(N_states, mo_tot_num) - integer, intent(in) :: sp, h(0:2, 2), p(0:3, 2) - integer :: i, hole, p1, p2, sh - logical :: ok, lbanned(mo_tot_num) - integer(bit_kind) :: det(N_int, 2) - double precision :: hij - double precision, external :: get_phase_bi, mo_bielec_integral - - lbanned = bannedOrb - sh = 1 - if(h(0,2) == 1) sh = 2 - hole = h(1, sh) - lbanned(p(1,sp)) = .true. - if(p(0,sp) == 2) lbanned(p(2,sp)) = .true. - !print *, "SPm1", sp, sh - - p1 = p(1, sp) - - if(sp == sh) then - p2 = p(2, sp) - lbanned(p2) = .true. - - do i=1,hole-1 - if(lbanned(i)) cycle - hij = (mo_bielec_integral(p1, p2, i, hole) - mo_bielec_integral(p2, p1, i, hole)) - hij *= get_phase_bi(phasemask, sp, sp, i, p1, hole, p2) - vect(:,i) += hij * coefs - end do - do i=hole+1,mo_tot_num - if(lbanned(i)) cycle - hij = (mo_bielec_integral(p1, p2, hole, i) - mo_bielec_integral(p2, p1, hole, i)) - hij *= get_phase_bi(phasemask, sp, sp, hole, p1, i, p2) - vect(:,i) += hij * coefs - end do - - call apply_particle(mask, sp, p2, det, ok, N_int) - call i_h_j(gen, det, N_int, hij) - vect(:, p2) += hij * coefs - else - p2 = p(1, sh) - do i=1,mo_tot_num - if(lbanned(i)) cycle - hij = mo_bielec_integral(p1, p2, i, hole) - hij *= get_phase_bi(phasemask, sp, sh, i, p1, hole, p2) - vect(:,i) += hij * coefs - end do - end if - - call apply_particle(mask, sp, p1, det, ok, N_int) - call i_h_j(gen, det, N_int, hij) - vect(:, p1) += hij * coefs -end subroutine - - -subroutine get_m0(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) - use bitmasks - implicit none - - integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2) - integer(1), intent(in) :: phasemask(N_int*bit_kind_size, 2) - logical, intent(in) :: bannedOrb(mo_tot_num) - double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: vect(N_states, mo_tot_num) - integer, intent(in) :: sp, h(0:2, 2), p(0:3, 2) - integer :: i - logical :: ok, lbanned(mo_tot_num) - integer(bit_kind) :: det(N_int, 2) - double precision :: hij - - lbanned = bannedOrb - lbanned(p(1,sp)) = .true. - do i=1,mo_tot_num - if(lbanned(i)) cycle - call apply_particle(mask, sp, i, det, ok, N_int) - call i_h_j(gen, det, N_int, hij) - vect(:, i) += hij * coefs - end do -end subroutine - - -subroutine spot_hasBeen(mask, sp, det, i_gen, N, banned, fullMatch) - use bitmasks - implicit none - - integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N) - integer, intent(in) :: i_gen, N, sp - logical, intent(inout) :: banned(mo_tot_num) - logical, intent(out) :: fullMatch - - - integer :: i, j, na, nb, list(3), nt - integer(bit_kind) :: myMask(N_int, 2), negMask(N_int, 2) - - fullMatch = .false. - - do i=1,N_int - negMask(i,1) = not(mask(i,1)) - negMask(i,2) = not(mask(i,2)) - end do - - do i=1, N - nt = 0 - - do j=1, N_int - myMask(j, 1) = iand(det(j, 1, i), negMask(j, 1)) - myMask(j, 2) = iand(det(j, 2, i), negMask(j, 2)) - nt += popcnt(myMask(j, 1)) + popcnt(myMask(j, 2)) - end do - - if(nt > 3) cycle - - if(nt <= 2 .and. i < i_gen) then - fullMatch = .true. - return - end if - - call bitstring_to_list(myMask(1,sp), list(1), na, N_int) - - if(nt == 3 .and. i < i_gen) then - do j=1,na - banned(list(j)) = .true. - end do - else if(nt == 1 .and. na == 1) then - banned(list(1)) = .true. - end if - end do -end subroutine - - - - -! Selection double -! ---------------- - -subroutine select_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,buf) - use bitmasks - use selection_types - implicit none - - integer, intent(in) :: i_generator - integer(bit_kind), intent(in) :: hole_mask(N_int,2), particle_mask(N_int,2) - double precision, intent(in) :: fock_diag_tmp(mo_tot_num) - double precision, intent(in) :: E0(N_states) - double precision, intent(inout) :: pt2(N_states) - type(selection_buffer), intent(inout) :: buf - - double precision :: mat(N_states, mo_tot_num, mo_tot_num) - integer :: h1,h2,s1,s2,s3,i1,i2,ib,sp,k,i,j,nt,ii - integer(bit_kind) :: hole(N_int,2), particle(N_int,2), mask(N_int, 2), pmask(N_int, 2) - logical :: fullMatch, ok - - integer(bit_kind) :: mobMask(N_int, 2), negMask(N_int, 2) - integer,allocatable :: preinteresting(:), prefullinteresting(:), interesting(:), fullinteresting(:) - integer(bit_kind), allocatable :: minilist(:, :, :), fullminilist(:, :, :) - - allocate(minilist(N_int, 2, N_det_selectors), fullminilist(N_int, 2, N_det)) - allocate(preinteresting(0:N_det_selectors), prefullinteresting(0:N_det), interesting(0:N_det_selectors), fullinteresting(0:N_det)) - - do k=1,N_int - hole (k,1) = iand(psi_det_generators(k,1,i_generator), hole_mask(k,1)) - hole (k,2) = iand(psi_det_generators(k,2,i_generator), hole_mask(k,2)) - particle(k,1) = iand(not(psi_det_generators(k,1,i_generator)), particle_mask(k,1)) - particle(k,2) = iand(not(psi_det_generators(k,2,i_generator)), particle_mask(k,2)) - enddo - - integer :: N_holes(2), N_particles(2) - integer :: hole_list(N_int*bit_kind_size,2) - integer :: particle_list(N_int*bit_kind_size,2) - - call bitstring_to_list_ab(hole , hole_list , N_holes , N_int) - call bitstring_to_list_ab(particle, particle_list, N_particles, N_int) - - - preinteresting(0) = 0 - prefullinteresting(0) = 0 - - do i=1,N_int - negMask(i,1) = not(psi_det_generators(i,1,i_generator)) - negMask(i,2) = not(psi_det_generators(i,2,i_generator)) - end do - - do i=1,N_det - nt = 0 - do j=1,N_int - mobMask(j,1) = iand(negMask(j,1), psi_selectors(j,1,i)) - mobMask(j,2) = iand(negMask(j,2), psi_selectors(j,2,i)) - nt += popcnt(mobMask(j, 1)) + popcnt(mobMask(j, 2)) - end do - - if(nt <= 4) then - if(i <= N_det_selectors) then - preinteresting(0) += 1 - preinteresting(preinteresting(0)) = i - else if(nt <= 2) then - prefullinteresting(0) += 1 - prefullinteresting(prefullinteresting(0)) = i - end if - end if - end do - - - do s1=1,2 - do i1=N_holes(s1),1,-1 ! Generate low excitations first - h1 = hole_list(i1,s1) - call apply_hole(psi_det_generators(1,1,i_generator), s1,h1, pmask, ok, N_int) - - do i=1,N_int - negMask(i,1) = not(pmask(i,1)) - negMask(i,2) = not(pmask(i,2)) - end do - - interesting(0) = 0 - fullinteresting(0) = 0 - - do ii=1,preinteresting(0) - i = preinteresting(ii) - nt = 0 - do j=1,N_int - mobMask(j,1) = iand(negMask(j,1), psi_selectors(j,1,i)) - mobMask(j,2) = iand(negMask(j,2), psi_selectors(j,2,i)) - nt += popcnt(mobMask(j, 1)) + popcnt(mobMask(j, 2)) - end do - - if(nt <= 4) then - interesting(0) += 1 - interesting(interesting(0)) = i - minilist(:,:,interesting(0)) = psi_selectors(:,:,i) - if(nt <= 2) then - fullinteresting(0) += 1 - fullinteresting(fullinteresting(0)) = i - fullminilist(:,:,fullinteresting(0)) = psi_selectors(:,:,i) - end if - end if - end do - - do ii=1,prefullinteresting(0) - i = prefullinteresting(ii) - nt = 0 - do j=1,N_int - mobMask(j,1) = iand(negMask(j,1), psi_selectors(j,1,i)) - mobMask(j,2) = iand(negMask(j,2), psi_selectors(j,2,i)) - nt += popcnt(mobMask(j, 1)) + popcnt(mobMask(j, 2)) - end do - - if(nt <= 2) then - fullinteresting(0) += 1 - fullinteresting(fullinteresting(0)) = i - fullminilist(:,:,fullinteresting(0)) = psi_selectors(:,:,i) - end if - end do - - do s2=s1,2 - sp = s1 - if(s1 /= s2) sp = 3 - - ib = 1 - if(s1 == s2) ib = i1+1 - do i2=N_holes(s2),ib,-1 ! Generate low excitations first - - h2 = hole_list(i2,s2) - call apply_hole(pmask, s2,h2, mask, ok, N_int) - - logical :: banned(mo_tot_num, mo_tot_num,2) - logical :: bannedOrb(mo_tot_num, 2) - - banned = .false. - - call spot_isinwf(mask, fullminilist, i_generator, fullinteresting(0), banned, fullMatch, fullinteresting) - - if(fullMatch) cycle - - bannedOrb(1:mo_tot_num, 1:2) = .true. - do s3=1,2 - do i=1,N_particles(s3) - bannedOrb(particle_list(i,s3), s3) = .false. - enddo - enddo - - mat = 0d0 - call splash_pq(mask, sp, minilist, i_generator, interesting(0), bannedOrb, banned, mat, interesting) - call fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_diag_tmp, E0, pt2, mat, buf) - enddo - enddo - enddo - enddo -end subroutine - - -subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_diag_tmp, E0, pt2, mat, buf) - use bitmasks - use selection_types - implicit none - - integer, intent(in) :: i_generator, sp, h1, h2 - double precision, intent(in) :: mat(N_states, mo_tot_num, mo_tot_num) - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num) - double precision, intent(in) :: fock_diag_tmp(mo_tot_num) - double precision, intent(in) :: E0(N_states) - double precision, intent(inout) :: pt2(N_states) - type(selection_buffer), intent(inout) :: buf - logical :: ok - integer :: s1, s2, p1, p2, ib, j, istate - integer(bit_kind) :: mask(N_int, 2), det(N_int, 2) - double precision :: e_pert, delta_E, val, Hii, max_e_pert,tmp - double precision, external :: diag_H_mat_elem_fock - - logical, external :: detEq - - - if(sp == 3) then - s1 = 1 - s2 = 2 - else - s1 = sp - s2 = sp - end if - - call apply_holes(psi_det_generators(1,1,i_generator), s1, h1, s2, h2, mask, ok, N_int) - - do p1=1,mo_tot_num - if(bannedOrb(p1, s1)) cycle - ib = 1 - if(sp /= 3) ib = p1+1 - do p2=ib,mo_tot_num - if(bannedOrb(p2, s2)) cycle - if(banned(p1,p2)) cycle - if(sum(dabs(mat(:, p1, p2))) == 0d0) cycle - call apply_particles(mask, s1, p1, s2, p2, det, ok, N_int) - logical, external :: is_in_wavefunction - - if (do_ddci) then - logical, external :: is_a_two_holes_two_particles - if (is_a_two_holes_two_particles(det)) then - cycle - endif - endif - - Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),det,fock_diag_tmp,N_int) - max_e_pert = 0d0 - - do istate=1,N_states - delta_E = E0(istate) - Hii - val = mat(istate, p1, p2) + mat(istate, p1, p2) - tmp = dsqrt(delta_E * delta_E + val * val) - if (delta_E < 0.d0) then - tmp = -tmp - endif - e_pert = 0.5d0 * ( tmp - delta_E) - pt2(istate) = pt2(istate) + e_pert - max_e_pert = min(e_pert,max_e_pert) - end do - - if(dabs(max_e_pert) > buf%mini) then - call add_to_selection_buffer(buf, det, max_e_pert) - end if - end do - end do -end subroutine - - -subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, interesting) - use bitmasks - implicit none - - integer, intent(in) :: interesting(0:N_sel) - - integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N_sel) - integer, intent(in) :: sp, i_gen, N_sel - logical, intent(inout) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num, 2) - double precision, intent(inout) :: mat(N_states, mo_tot_num, mo_tot_num) - - integer :: i, ii, j, k, l, h(0:2,2), p(0:4,2), nt - integer(bit_kind) :: perMask(N_int, 2), mobMask(N_int, 2), negMask(N_int, 2) -! logical :: bandon -! -! bandon = .false. - mat = 0d0 - - do i=1,N_int - negMask(i,1) = not(mask(i,1)) - negMask(i,2) = not(mask(i,2)) - end do - - do i=1, N_sel ! interesting(0) - !i = interesting(ii) - - nt = 0 - do j=1,N_int - mobMask(j,1) = iand(negMask(j,1), det(j,1,i)) - mobMask(j,2) = iand(negMask(j,2), det(j,2,i)) - nt += popcnt(mobMask(j, 1)) + popcnt(mobMask(j, 2)) - end do - - if(nt > 4) cycle - - do j=1,N_int - perMask(j,1) = iand(mask(j,1), not(det(j,1,i))) - perMask(j,2) = iand(mask(j,2), not(det(j,2,i))) - end do - - call bitstring_to_list(perMask(1,1), h(1,1), h(0,1), N_int) - call bitstring_to_list(perMask(1,2), h(1,2), h(0,2), N_int) - - call bitstring_to_list(mobMask(1,1), p(1,1), p(0,1), N_int) - call bitstring_to_list(mobMask(1,2), p(1,2), p(0,2), N_int) - - if(interesting(i) < i_gen) then - if(nt == 4) call past_d2(banned, p, sp) - if(nt == 3) call past_d1(bannedOrb, p) - else - if(interesting(i) == i_gen) then -! bandon = .true. - if(sp == 3) then - banned(:,:,2) = transpose(banned(:,:,1)) - else - do k=1,mo_tot_num - do l=k+1,mo_tot_num - banned(l,k,1) = banned(k,l,1) - end do - end do - end if - end if - if(nt == 4) then - call get_d2(det(1,1,i), psi_phasemask(1,1,interesting(i)), bannedOrb, banned, mat, mask, h, p, sp, psi_selectors_coef_transp(1, interesting(i))) - else if(nt == 3) then - call get_d1(det(1,1,i), psi_phasemask(1,1,interesting(i)), bannedOrb, banned, mat, mask, h, p, sp, psi_selectors_coef_transp(1, interesting(i))) - else - call get_d0(det(1,1,i), psi_phasemask(1,1,interesting(i)), bannedOrb, banned, mat, mask, h, p, sp, psi_selectors_coef_transp(1, interesting(i))) - end if - end if - end do -end subroutine - - -subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) - use bitmasks - implicit none - - integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2) - integer(1), intent(in) :: phasemask(N_int*bit_kind_size, 2) - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2) - double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: mat(N_states, mo_tot_num, mo_tot_num) - integer, intent(in) :: h(0:2,2), p(0:4,2), sp - - double precision, external :: get_phase_bi, mo_bielec_integral - - integer :: i, j, tip, ma, mi, puti, putj - integer :: h1, h2, p1, p2, i1, i2 - double precision :: hij, phase - - integer, parameter:: turn2d(2,3,4) = reshape((/0,0, 0,0, 0,0, 3,4, 0,0, 0,0, 2,4, 1,4, 0,0, 2,3, 1,3, 1,2 /), (/2,3,4/)) - integer, parameter :: turn2(2) = (/2, 1/) - integer, parameter :: turn3(2,3) = reshape((/2,3, 1,3, 1,2/), (/2,3/)) - - integer :: bant - bant = 1 - - tip = p(0,1) * p(0,2) - - ma = sp - if(p(0,1) > p(0,2)) ma = 1 - if(p(0,1) < p(0,2)) ma = 2 - mi = mod(ma, 2) + 1 - - if(sp == 3) then - if(ma == 2) bant = 2 - - if(tip == 3) then - puti = p(1, mi) - do i = 1, 3 - putj = p(i, ma) - if(banned(putj,puti,bant)) cycle - i1 = turn3(1,i) - i2 = turn3(2,i) - p1 = p(i1, ma) - p2 = p(i2, ma) - h1 = h(1, ma) - h2 = h(2, ma) - - hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2) - if(ma == 1) then - mat(:, putj, puti) += coefs * hij - else - mat(:, puti, putj) += coefs * hij - end if - end do - else - do i = 1,2 - do j = 1,2 - puti = p(i, 1) - putj = p(j, 2) - - if(banned(puti,putj,bant)) cycle - p1 = p(turn2(i), 1) - p2 = p(turn2(j), 2) - h1 = h(1,1) - h2 = h(1,2) - - hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2) - mat(:, puti, putj) += coefs * hij - end do - end do - end if - - else - if(tip == 0) then - h1 = h(1, ma) - h2 = h(2, ma) - do i=1,3 - puti = p(i, ma) - do j=i+1,4 - putj = p(j, ma) - if(banned(puti,putj,1)) cycle - - i1 = turn2d(1, i, j) - i2 = turn2d(2, i, j) - p1 = p(i1, ma) - p2 = p(i2, ma) - hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, ma, ma, h1, p1, h2, p2) - mat(:, puti, putj) += coefs * hij - end do - end do - else if(tip == 3) then - h1 = h(1, mi) - h2 = h(1, ma) - p1 = p(1, mi) - do i=1,3 - puti = p(turn3(1,i), ma) - putj = p(turn3(2,i), ma) - if(banned(puti,putj,1)) cycle - p2 = p(i, ma) - - hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, mi, ma, h1, p1, h2, p2) - mat(:, min(puti, putj), max(puti, putj)) += coefs * hij - end do - else ! tip == 4 - puti = p(1, sp) - putj = p(2, sp) - if(.not. banned(puti,putj,1)) then - p1 = p(1, mi) - p2 = p(2, mi) - h1 = h(1, mi) - h2 = h(2, mi) - hij = (mo_bielec_integral(p1, p2, h1, h2) - mo_bielec_integral(p2,p1, h1, h2)) * get_phase_bi(phasemask, mi, mi, h1, p1, h2, p2) - mat(:, puti, putj) += coefs * hij - end if - end if - end if -end subroutine - - -subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) - use bitmasks - implicit none - - integer(bit_kind), intent(in) :: mask(N_int, 2), gen(N_int, 2) - integer(1),intent(in) :: phasemask(N_int*bit_kind_size, 2) - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2) - integer(bit_kind) :: det(N_int, 2) - double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: mat(N_states, mo_tot_num, mo_tot_num) - double precision :: hij, tmp_row(N_states, mo_tot_num), tmp_row2(N_states, mo_tot_num) - double precision, external :: get_phase_bi, mo_bielec_integral - - logical :: lbanned(mo_tot_num, 2), ok - integer :: puti, putj, ma, mi, s1, s2, i, i1, i2, j, hfix, pfix, h1, h2, p1, p2, ib - - integer, intent(in) :: h(0:2,2), p(0:4,2), sp - - integer, parameter :: turn2(2) = (/2,1/) - integer, parameter :: turn3(2,3) = reshape((/2,3, 1,3, 1,2/), (/2,3/)) - - integer :: bant - - - lbanned = bannedOrb - - do i=1, p(0,1) - lbanned(p(i,1), 1) = .true. - end do - do i=1, p(0,2) - lbanned(p(i,2), 2) = .true. - end do - - ma = 1 - if(p(0,2) >= 2) ma = 2 - mi = turn2(ma) - - bant = 1 - - if(sp == 3) then - !move MA - if(ma == 2) bant = 2 - puti = p(1,mi) - hfix = h(1,ma) - p1 = p(1,ma) - p2 = p(2,ma) - if(.not. bannedOrb(puti, mi)) then - tmp_row = 0d0 - do putj=1, hfix-1 - if(lbanned(putj, ma) .or. banned(putj, puti,bant)) cycle - hij = (mo_bielec_integral(p1, p2, putj, hfix)-mo_bielec_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) - tmp_row(1:N_states,putj) += hij * coefs(1:N_states) - end do - do putj=hfix+1, mo_tot_num - if(lbanned(putj, ma) .or. banned(putj, puti,bant)) cycle - hij = (mo_bielec_integral(p1, p2, hfix, putj)-mo_bielec_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) - tmp_row(1:N_states,putj) += hij * coefs(1:N_states) - end do - - if(ma == 1) then - mat(1:N_states,1:mo_tot_num,puti) += tmp_row(1:N_states,1:mo_tot_num) - else - mat(1:N_states,puti,1:mo_tot_num) += tmp_row(1:N_states,1:mo_tot_num) - end if - end if - - !MOVE MI - pfix = p(1,mi) - tmp_row = 0d0 - tmp_row2 = 0d0 - do puti=1,mo_tot_num - if(lbanned(puti,mi)) cycle - !p1 fixed - putj = p1 - if(.not. banned(putj,puti,bant)) then - hij = mo_bielec_integral(p2,pfix,hfix,puti) * get_phase_bi(phasemask, ma, mi, hfix, p2, puti, pfix) - tmp_row(:,puti) += hij * coefs - end if - - putj = p2 - if(.not. banned(putj,puti,bant)) then - hij = mo_bielec_integral(p1,pfix,hfix,puti) * get_phase_bi(phasemask, ma, mi, hfix, p1, puti, pfix) - tmp_row2(:,puti) += hij * coefs - end if - end do - - if(mi == 1) then - mat(:,:,p1) += tmp_row(:,:) - mat(:,:,p2) += tmp_row2(:,:) - else - mat(:,p1,:) += tmp_row(:,:) - mat(:,p2,:) += tmp_row2(:,:) - end if - else - if(p(0,ma) == 3) then - do i=1,3 - hfix = h(1,ma) - puti = p(i, ma) - p1 = p(turn3(1,i), ma) - p2 = p(turn3(2,i), ma) - tmp_row = 0d0 - do putj=1,hfix-1 - if(lbanned(putj,ma) .or. banned(puti,putj,1)) cycle - hij = (mo_bielec_integral(p1, p2, putj, hfix)-mo_bielec_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) - tmp_row(:,putj) += hij * coefs - end do - do putj=hfix+1,mo_tot_num - if(lbanned(putj,ma) .or. banned(puti,putj,1)) cycle - hij = (mo_bielec_integral(p1, p2, hfix, putj)-mo_bielec_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) - tmp_row(:,putj) += hij * coefs - end do - - mat(:, :puti-1, puti) += tmp_row(:,:puti-1) - mat(:, puti, puti:) += tmp_row(:,puti:) - end do - else - hfix = h(1,mi) - pfix = p(1,mi) - p1 = p(1,ma) - p2 = p(2,ma) - tmp_row = 0d0 - tmp_row2 = 0d0 - do puti=1,mo_tot_num - if(lbanned(puti,ma)) cycle - putj = p2 - if(.not. banned(puti,putj,1)) then - hij = mo_bielec_integral(pfix, p1, hfix, puti) * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p1) - tmp_row(:,puti) += hij * coefs - end if - - putj = p1 - if(.not. banned(puti,putj,1)) then - hij = mo_bielec_integral(pfix, p2, hfix, puti) * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p2) - tmp_row2(:,puti) += hij * coefs - end if - end do - mat(:,:p2-1,p2) += tmp_row(:,:p2-1) - mat(:,p2,p2:) += tmp_row(:,p2:) - mat(:,:p1-1,p1) += tmp_row2(:,:p1-1) - mat(:,p1,p1:) += tmp_row2(:,p1:) - end if - end if - - !! MONO - if(sp == 3) then - s1 = 1 - s2 = 2 - else - s1 = sp - s2 = sp - end if - - do i1=1,p(0,s1) - ib = 1 - if(s1 == s2) ib = i1+1 - do i2=ib,p(0,s2) - p1 = p(i1,s1) - p2 = p(i2,s2) - if(bannedOrb(p1, s1) .or. bannedOrb(p2, s2) .or. banned(p1, p2, 1)) cycle - call apply_particles(mask, s1, p1, s2, p2, det, ok, N_int) - call i_h_j(gen, det, N_int, hij) - mat(:, p1, p2) += coefs * hij - end do - end do -end subroutine - - - - -subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) - use bitmasks - implicit none - - integer(bit_kind), intent(in) :: gen(N_int, 2), mask(N_int, 2) - integer(1), intent(in) :: phasemask(N_int*bit_kind_size, 2) - logical, intent(in) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num,2) - integer(bit_kind) :: det(N_int, 2) - double precision, intent(in) :: coefs(N_states) - double precision, intent(inout) :: mat(N_states, mo_tot_num, mo_tot_num) - integer, intent(in) :: h(0:2,2), p(0:4,2), sp - - integer :: i, j, s, h1, h2, p1, p2, puti, putj - double precision :: hij, phase - double precision, external :: get_phase_bi, mo_bielec_integral - logical :: ok - - integer :: bant - bant = 1 - - - if(sp == 3) then ! AB - h1 = p(1,1) - h2 = p(1,2) - do p1=1, mo_tot_num - if(bannedOrb(p1, 1)) cycle - do p2=1, mo_tot_num - if(bannedOrb(p2,2)) cycle - if(banned(p1, p2, bant)) cycle ! rentable? - if(p1 == h1 .or. p2 == h2) then - call apply_particles(mask, 1,p1,2,p2, det, ok, N_int) - call i_h_j(gen, det, N_int, hij) - else - hij = mo_bielec_integral(p1, p2, h1, h2) * get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2) - phase = get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2) - end if - mat(:, p1, p2) += coefs(:) * hij - end do - end do - else ! AA BB - p1 = p(1,sp) - p2 = p(2,sp) - do puti=1, mo_tot_num - if(bannedOrb(puti, sp)) cycle - do putj=puti+1, mo_tot_num - if(bannedOrb(putj, sp)) cycle - if(banned(puti, putj, bant)) cycle ! rentable? - if(puti == p1 .or. putj == p2 .or. puti == p2 .or. putj == p1) then - call apply_particles(mask, sp,puti,sp,putj, det, ok, N_int) - call i_h_j(gen, det, N_int, hij) - else - hij = (mo_bielec_integral(p1, p2, puti, putj) - mo_bielec_integral(p2, p1, puti, putj))* get_phase_bi(phasemask, sp, sp, puti, p1 , putj, p2) - end if - mat(:, puti, putj) += coefs(:) * hij - end do - end do - end if -end subroutine - - -subroutine past_d1(bannedOrb, p) - use bitmasks - implicit none - - logical, intent(inout) :: bannedOrb(mo_tot_num, 2) - integer, intent(in) :: p(0:4, 2) - integer :: i,s - - do s = 1, 2 - do i = 1, p(0, s) - bannedOrb(p(i, s), s) = .true. - end do - end do -end subroutine - - -subroutine past_d2(banned, p, sp) - use bitmasks - implicit none - - logical, intent(inout) :: banned(mo_tot_num, mo_tot_num) - integer, intent(in) :: p(0:4, 2), sp - integer :: i,j - - if(sp == 3) then - do i=1,p(0,1) - do j=1,p(0,2) - banned(p(i,1), p(j,2)) = .true. - end do - end do - else - do i=1,p(0, sp) - do j=1,i-1 - banned(p(j,sp), p(i,sp)) = .true. - banned(p(i,sp), p(j,sp)) = .true. - end do - end do - end if -end subroutine - - - -subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting) - use bitmasks - implicit none - - integer, intent(in) :: interesting(0:N) - integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N) - integer, intent(in) :: i_gen, N - logical, intent(inout) :: banned(mo_tot_num, mo_tot_num) - logical, intent(out) :: fullMatch - - - integer :: i, j, na, nb, list(3) - integer(bit_kind) :: myMask(N_int, 2), negMask(N_int, 2) - - fullMatch = .false. - - do i=1,N_int - negMask(i,1) = not(mask(i,1)) - negMask(i,2) = not(mask(i,2)) - end do - - genl : do i=1, N - do j=1, N_int - if(iand(det(j,1,i), mask(j,1)) /= mask(j, 1)) cycle genl - if(iand(det(j,2,i), mask(j,2)) /= mask(j, 2)) cycle genl - end do - - if(interesting(i) < i_gen) then - fullMatch = .true. - return - end if - - do j=1, N_int - myMask(j, 1) = iand(det(j, 1, i), negMask(j, 1)) - myMask(j, 2) = iand(det(j, 2, i), negMask(j, 2)) - end do - - call bitstring_to_list(myMask(1,1), list(1), na, N_int) - call bitstring_to_list(myMask(1,2), list(na+1), nb, N_int) - banned(list(1), list(2)) = .true. - end do genl -end subroutine - - -subroutine ZMQ_selection(N_in, pt2) - use f77_zmq - use selection_types - - implicit none - - integer(ZMQ_PTR) :: zmq_to_qp_run_socket, zmq_socket_pull - integer, intent(in) :: N_in - type(selection_buffer) :: b - integer :: i, N - integer, external :: omp_get_thread_num - double precision, intent(out) :: pt2(N_states) - integer, parameter :: maxtasks=10000 - integer, external :: zmq_put_psi - integer, external :: zmq_put_N_det_generators - integer, external :: zmq_put_N_det_selectors - integer, external :: zmq_put_dvector - - - N = max(N_in,1) - if (.True.) then - PROVIDE pt2_e0_denominator nproc - PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique - PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order - PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns - PROVIDE psi_bilinear_matrix_transp_order - - call new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,'selection') - if (zmq_put_psi(zmq_to_qp_run_socket,1) == -1) then - stop 'Unable to put psi' - endif - if (zmq_put_N_det_generators(zmq_to_qp_run_socket, 1) == -1) then - stop 'Unable to put N_det_generators' - endif - if (zmq_put_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) then - stop 'Unable to put N_det_selectors' - endif - if (zmq_put_dvector(zmq_to_qp_run_socket,1,'energy',pt2_e0_denominator,size(pt2_e0_denominator)) == -1) then - stop 'Unable to put energy' - endif - call create_selection_buffer(N, N*2, b) - endif - - character*(20*maxtasks) :: task - task = ' ' - - integer :: k - integer, external :: add_task_to_taskserver - k=0 - do i= 1, N_det_generators - k = k+1 - write(task(20*(k-1)+1:20*k),'(I9,1X,I9,''|'')') i, N - if (k>=maxtasks) then - k=0 - if (add_task_to_taskserver(zmq_to_qp_run_socket,task) == -1) then - stop 'Unable to add task to task server' - endif - endif - enddo - if (k > 0) then - if (add_task_to_taskserver(zmq_to_qp_run_socket,task) == -1) then - stop 'Unable to add task to task server' - endif - endif - integer, external :: zmq_set_running - if (zmq_set_running(zmq_to_qp_run_socket) == -1) then - print *, irp_here, ': Failed in zmq_set_running' - endif - - !$OMP PARALLEL DEFAULT(shared) SHARED(b, pt2) PRIVATE(i) NUM_THREADS(nproc+1) - i = omp_get_thread_num() - if (i==0) then - call selection_collector(zmq_socket_pull, b, pt2) - else - call selection_slave_inproc(i) - endif - !$OMP END PARALLEL - call end_parallel_job(zmq_to_qp_run_socket, zmq_socket_pull, 'selection') - do i=N_det+1,N_states - pt2(i) = 0.d0 - enddo - if (N_in > 0) then - call fill_H_apply_buffer_no_selection(b%cur,b%det,N_int,0) !!! PAS DE ROBIN - call copy_H_apply_buffer_to_wf() - if (s2_eig .or. (N_states > 1) ) then - call make_s2_eigenfunction - endif - call save_wavefunction - endif - call delete_selection_buffer(b) - -end subroutine - - -subroutine selection_slave_inproc(i) - implicit none - integer, intent(in) :: i - - call run_selection_slave(1,i,pt2_e0_denominator) -end - -subroutine selection_collector(zmq_socket_pull, b, pt2) - use f77_zmq - use selection_types - use bitmasks - implicit none - - - type(selection_buffer), intent(inout) :: b - double precision, intent(out) :: pt2(N_states) - double precision :: pt2_mwen(N_states) - integer(ZMQ_PTR),external :: new_zmq_to_qp_run_socket - integer(ZMQ_PTR) :: zmq_to_qp_run_socket - - integer(ZMQ_PTR), external :: new_zmq_pull_socket - integer(ZMQ_PTR), intent(in) :: zmq_socket_pull - - integer :: msg_size, rc, more - integer :: acc, i, j, robin, N, ntask - double precision, allocatable :: val(:) - integer(bit_kind), allocatable :: det(:,:,:) - integer, allocatable :: task_id(:) - integer :: done - real :: time, time0 - zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() - allocate(val(b%N), det(N_int, 2, b%N), task_id(N_det)) - done = 0 - more = 1 - pt2(:) = 0d0 - call CPU_TIME(time0) - do while (more == 1) - call pull_selection_results(zmq_socket_pull, pt2_mwen, val(1), det(1,1,1), N, task_id, ntask) - pt2 += pt2_mwen - do i=1, N - call add_to_selection_buffer(b, det(1,1,i), val(i)) - end do - - do i=1, ntask - if(task_id(i) == 0) then - print *, "Error in collector" - endif - integer, external :: zmq_delete_task - if (zmq_delete_task(zmq_to_qp_run_socket,zmq_socket_pull,task_id(i),more) == -1) then - stop 'Unable to delete task' - endif - end do - done += ntask - call CPU_TIME(time) -! print *, "DONE" , done, time - time0 - end do - - call sort_selection_buffer(b) - call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) -end subroutine - diff --git a/plugins/CAS_SD_ZMQ/selection_buffer.irp.f b/plugins/CAS_SD_ZMQ/selection_buffer.irp.f deleted file mode 100644 index 636cb71c..00000000 --- a/plugins/CAS_SD_ZMQ/selection_buffer.irp.f +++ /dev/null @@ -1,82 +0,0 @@ - -subroutine create_selection_buffer(N, siz, res) - use selection_types - implicit none - - integer, intent(in) :: N, siz - type(selection_buffer), intent(out) :: res - - allocate(res%det(N_int, 2, siz), res%val(siz)) - - res%val = 0d0 - res%det = 0_8 - res%N = N - res%mini = 0d0 - res%cur = 0 -end subroutine - -subroutine delete_selection_buffer(b) - use selection_types - implicit none - type(selection_buffer), intent(inout) :: b - if (allocated(b%det)) then - deallocate(b%det) - endif - if (allocated(b%val)) then - deallocate(b%val) - endif -end - - -subroutine add_to_selection_buffer(b, det, val) - use selection_types - implicit none - - type(selection_buffer), intent(inout) :: b - integer(bit_kind), intent(in) :: det(N_int, 2) - double precision, intent(in) :: val - integer :: i - - if(dabs(val) >= b%mini) then - b%cur += 1 - b%det(:,:,b%cur) = det(:,:) - b%val(b%cur) = val - if(b%cur == size(b%val)) then - call sort_selection_buffer(b) - end if - end if -end subroutine - - -subroutine sort_selection_buffer(b) - use selection_types - implicit none - - type(selection_buffer), intent(inout) :: b - double precision, allocatable :: vals(:), absval(:) - integer, allocatable :: iorder(:) - integer(bit_kind), allocatable :: detmp(:,:,:) - integer :: i, nmwen - logical, external :: detEq - nmwen = min(b%N, b%cur) - - - allocate(iorder(b%cur), detmp(N_int, 2, nmwen), absval(b%cur), vals(nmwen)) - absval = -dabs(b%val(:b%cur)) - do i=1,b%cur - iorder(i) = i - end do - call dsort(absval, iorder, b%cur) - - do i=1, nmwen - detmp(:,:,i) = b%det(:,:,iorder(i)) - vals(i) = b%val(iorder(i)) - end do - b%det(:,:,:nmwen) = detmp(:,:,:) - b%det(:,:,nmwen+1:) = 0_bit_kind - b%val(:nmwen) = vals(:) - b%val(nmwen+1:) = 0d0 - b%mini = max(b%mini,dabs(b%val(b%N))) - b%cur = nmwen -end subroutine - diff --git a/plugins/CAS_SD_ZMQ/selection_cassd_slave.irp.f b/plugins/CAS_SD_ZMQ/selection_cassd_slave.irp.f deleted file mode 100644 index 43281eba..00000000 --- a/plugins/CAS_SD_ZMQ/selection_cassd_slave.irp.f +++ /dev/null @@ -1,94 +0,0 @@ -program prog_selection_slave - implicit none - BEGIN_DOC -! Helper program to compute the PT2 in distributed mode. - END_DOC - - read_wf = .False. - distributed_davidson = .False. - SOFT_TOUCH read_wf distributed_davidson - call provide_everything - call switch_qp_run_to_master - call run_wf -end - -subroutine provide_everything - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context - PROVIDE pt2_e0_denominator mo_tot_num N_int -end - -subroutine run_wf - use f77_zmq - implicit none - - integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket - integer(ZMQ_PTR) :: zmq_to_qp_run_socket - double precision :: energy(N_states) - character*(64) :: states(4) - integer :: rc, i - - integer, external :: zmq_get_psi - call provide_everything - - zmq_context = f77_zmq_ctx_new () - states(1) = 'selection' - states(2) = 'davidson' - states(3) = 'pt2' - - zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() - - do - - call wait_for_states(states,zmq_state,4) - - if(trim(zmq_state) == 'Stopped') then - - exit - - else if (trim(zmq_state) == 'selection') then - - ! Selection - ! --------- - - print *, 'Selection' - if (zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) == -1) cycle - - !$OMP PARALLEL PRIVATE(i) - i = omp_get_thread_num() - call run_selection_slave(0, i, energy) - !$OMP END PARALLEL - print *, 'Selection done' - - else if (trim(zmq_state) == 'davidson') then - - ! Davidson - ! -------- - - print *, 'Davidson' - if (zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) == -1) cycle - call omp_set_nested(.True.) - call davidson_slave_tcp(0) - call omp_set_nested(.False.) - print *, 'Davidson done' - - else if (trim(zmq_state) == 'pt2') then - - ! PT2 - ! --- - - print *, 'PT2' - if (zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) == -1) cycle - - !$OMP PARALLEL PRIVATE(i) - i = omp_get_thread_num() - call run_selection_slave(0, i, energy) - !$OMP END PARALLEL - print *, 'PT2 done' - - endif - - end do -end - - - diff --git a/plugins/CAS_SD_ZMQ/selection_types.f90 b/plugins/CAS_SD_ZMQ/selection_types.f90 deleted file mode 100644 index 9506629c..00000000 --- a/plugins/CAS_SD_ZMQ/selection_types.f90 +++ /dev/null @@ -1,9 +0,0 @@ -module selection_types - type selection_buffer - integer :: N, cur - integer(8), allocatable :: det(:,:,:) - double precision, allocatable :: val(:) - double precision :: mini - endtype -end module - diff --git a/plugins/CAS_SD_ZMQ/target_pt2_ratio_cassd.irp.f b/plugins/CAS_SD_ZMQ/target_pt2_ratio_cassd.irp.f deleted file mode 100644 index cf934a46..00000000 --- a/plugins/CAS_SD_ZMQ/target_pt2_ratio_cassd.irp.f +++ /dev/null @@ -1,109 +0,0 @@ -program fci_zmq - implicit none - integer :: i,j,k - logical, external :: detEq - - double precision, allocatable :: pt2(:) - integer :: Nmin, Nmax - integer :: n_det_before, to_select - double precision :: threshold_davidson_in, ratio, E_ref - - double precision, allocatable :: psi_coef_ref(:,:) - integer(bit_kind), allocatable :: psi_det_ref(:,:,:) - - - allocate (pt2(N_states)) - - pt2 = 1.d0 - threshold_davidson_in = threshold_davidson - threshold_davidson = threshold_davidson_in * 100.d0 - SOFT_TOUCH threshold_davidson - - ! Stopping criterion is the PT2max - - double precision :: E_CI_before(N_states) - do while (dabs(pt2(1)) > pt2_max) - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - do k=1, N_states - print*,'State ',k - print *, 'PT2 = ', pt2(k) - print *, 'E = ', CI_energy(k) - print *, 'E(before)+PT2 = ', E_CI_before(k)+pt2(k) - enddo - print *, '-----' - E_CI_before(1:N_states) = CI_energy(1:N_states) - call ezfio_set_cas_sd_zmq_energy(CI_energy(1)) - - n_det_before = N_det - to_select = N_det - to_select = max(64-to_select, to_select) - call ZMQ_selection(to_select, pt2) - - PROVIDE psi_coef - PROVIDE psi_det - PROVIDE psi_det_sorted - - call diagonalize_CI - call save_wavefunction - call ezfio_set_cas_sd_zmq_energy(CI_energy(1)) - enddo - - threshold_selectors = max(threshold_selectors,threshold_selectors_pt2) - threshold_generators = max(threshold_generators,threshold_generators_pt2) - threshold_davidson = threshold_davidson_in - TOUCH threshold_selectors threshold_generators threshold_davidson - call diagonalize_CI - call ZMQ_selection(0, pt2) - - E_ref = CI_energy(1) + pt2(1) - print *, 'Est FCI = ', E_ref - - Nmax = N_det - Nmin = 2 - allocate (psi_coef_ref(size(psi_coef_sorted,1),size(psi_coef_sorted,2))) - allocate (psi_det_ref(N_int,2,size(psi_det_sorted,3))) - psi_coef_ref = psi_coef_sorted - psi_det_ref = psi_det_sorted - psi_det = psi_det_sorted - psi_coef = psi_coef_sorted - TOUCH psi_coef psi_det - do while (Nmax-Nmin > 1) - psi_coef = psi_coef_ref - psi_det = psi_det_ref - TOUCH psi_det psi_coef - call diagonalize_CI - ratio = (CI_energy(1) - HF_energy) / (E_ref - HF_energy) - if (ratio < var_pt2_ratio) then - Nmin = N_det - else - Nmax = N_det - psi_coef_ref = psi_coef - psi_det_ref = psi_det - TOUCH psi_det psi_coef - endif - N_det = Nmin + (Nmax-Nmin)/2 - print *, '-----' - print *, 'Det min, Det max: ', Nmin, Nmax - print *, 'Ratio : ', ratio, ' ~ ', var_pt2_ratio - print *, 'N_det = ', N_det - print *, 'E = ', CI_energy(1) - call save_wavefunction - enddo - call ZMQ_selection(0, pt2) - print *, '------' - print *, 'HF_energy = ', HF_energy - print *, 'Est FCI = ', E_ref - print *, 'E = ', CI_energy(1) - print *, 'PT2 = ', pt2(1) - print *, 'E+PT2 = ', CI_energy(1)+pt2(1) - - E_CI_before(1:N_states) = CI_energy(1:N_states) - call save_wavefunction - call ezfio_set_cas_sd_zmq_energy(CI_energy(1)) - call ezfio_set_cas_sd_zmq_energy_pt2(E_CI_before(1)+pt2(1)) -end - - - - diff --git a/plugins/CID/tree_dependency.png b/plugins/CID/tree_dependency.png deleted file mode 100644 index 64876dcb..00000000 Binary files a/plugins/CID/tree_dependency.png and /dev/null differ diff --git a/plugins/CID_SC2_selected/tree_dependency.png b/plugins/CID_SC2_selected/tree_dependency.png deleted file mode 100644 index b42aa4bf..00000000 Binary files a/plugins/CID_SC2_selected/tree_dependency.png and /dev/null differ diff --git a/plugins/CID_selected/tree_dependency.png b/plugins/CID_selected/tree_dependency.png deleted file mode 100644 index 753ae2eb..00000000 Binary files a/plugins/CID_selected/tree_dependency.png and /dev/null differ diff --git a/plugins/CIS/super_ci.irp.f b/plugins/CIS/super_ci.irp.f deleted file mode 100644 index 979a48a4..00000000 --- a/plugins/CIS/super_ci.irp.f +++ /dev/null @@ -1,62 +0,0 @@ -program cis - implicit none - integer :: i - - call super_CI - -end - -subroutine super_CI - implicit none - double precision :: E, delta_E, delta_D, E_min - integer :: k - character :: save_char - - call write_time(6) - write(6,'(A4,X,A16, X, A16, X, A16 )') & - '====','================','================','================' - write(6,'(A4,X,A16, X, A16, X, A16 )') & - ' N ', 'Energy ', 'Energy diff ', 'Save ' - write(6,'(A4,X,A16, X, A16, X, A16 )') & - '====','================','================','================' - - E = HF_energy + 1.d0 - delta_D = 0.d0 - E_min = HF_energy - FREE psi_det psi_coef - call clear_mo_map - N_det = 1 - SOFT_TOUCH N_det - mo_coef = eigenvectors_fock_matrix_mo - TOUCH mo_coef - do k=1,n_it_scf_max - delta_E = HF_energy - E - E = HF_energy - if (E < E_min) then - call save_mos - save_char = 'X' - else - save_char = ' ' - endif - E_min = min(E,E_min) - write(6,'(I4,X,F16.10, X, F16.10, X, A8 )') & - k, E, delta_E, save_char - if ( (delta_E < 0.d0).and.(dabs(delta_E) < thresh_scf) ) then - exit - endif - call H_apply_cis - call diagonalize_CI - call set_natural_mos - FREE psi_det psi_coef - call clear_mo_map - N_det = 1 - SOFT_TOUCH N_det - mo_coef = eigenvectors_fock_matrix_mo - TOUCH mo_coef - enddo - - write(6,'(A4,X,A16, X, A16, X, A16 )') & - '====','================','================','================' - call write_time(6) -end - diff --git a/plugins/CIS/tree_dependency.png b/plugins/CIS/tree_dependency.png deleted file mode 100644 index d9ee1876..00000000 Binary files a/plugins/CIS/tree_dependency.png and /dev/null differ diff --git a/plugins/CISD/tree_dependency.png b/plugins/CISD/tree_dependency.png deleted file mode 100644 index fcf48831..00000000 Binary files a/plugins/CISD/tree_dependency.png and /dev/null differ diff --git a/plugins/CISD_SC2_selected/tree_dependency.png b/plugins/CISD_SC2_selected/tree_dependency.png deleted file mode 100644 index 05b0b67b..00000000 Binary files a/plugins/CISD_SC2_selected/tree_dependency.png and /dev/null differ diff --git a/plugins/CISD_selected/tree_dependency.png b/plugins/CISD_selected/tree_dependency.png deleted file mode 100644 index 4d637043..00000000 Binary files a/plugins/CISD_selected/tree_dependency.png and /dev/null differ diff --git a/plugins/Casino/NEEDED_CHILDREN_MODULES b/plugins/Casino/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 2a87d1c1..00000000 --- a/plugins/Casino/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -Determinants DavidsonUndressed diff --git a/plugins/Casino/README.rst b/plugins/Casino/README.rst deleted file mode 100644 index 02d9dc66..00000000 --- a/plugins/Casino/README.rst +++ /dev/null @@ -1,27 +0,0 @@ -====== -Casino -====== - -Documentation -============= - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -`prog_save_casino `_ - Undocumented - - -`save_casino `_ - Undocumented - -Needed Modules -============== - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -.. image:: tree_dependency.png - -* `Determinants `_ - diff --git a/plugins/Casino/save_for_casino.irp.f b/plugins/Casino/save_for_casino.irp.f deleted file mode 100644 index 5522e578..00000000 --- a/plugins/Casino/save_for_casino.irp.f +++ /dev/null @@ -1,268 +0,0 @@ -subroutine save_casino - use bitmasks - implicit none - character*(128) :: message - integer :: getUnitAndOpen, iunit - integer, allocatable :: itmp(:) - integer :: n_ao_new - double precision, allocatable :: rtmp(:) - PROVIDE ezfio_filename - - iunit = getUnitAndOpen('gwfn.data','w') - print *, 'Title?' - read(*,*) message - write(iunit,'(A)') trim(message) - write(iunit,'(A)') '' - write(iunit,'(A)') 'BASIC_INFO' - write(iunit,'(A)') '----------' - write(iunit,'(A)') 'Generated by:' - write(iunit,'(A)') 'Quantum package' - write(iunit,'(A)') 'Method:' - print *, 'Method?' - read(*,*) message - write(iunit,'(A)') trim(message) - write(iunit,'(A)') 'DFT Functional:' - write(iunit,'(A)') 'none' - write(iunit,'(A)') 'Periodicity:' - write(iunit,'(A)') '0' - write(iunit,'(A)') 'Spin unrestricted:' - write(iunit,'(A)') '.false.' - write(iunit,'(A)') 'nuclear-nuclear repulsion energy (au/atom):' - write(iunit,*) nuclear_repulsion - write(iunit,'(A)') 'Number of electrons per primitive cell:' - write(iunit,*) elec_num - write(iunit,*) '' - - - write(iunit,*) 'GEOMETRY' - write(iunit,'(A)') '--------' - write(iunit,'(A)') 'Number of atoms:' - write(iunit,*) nucl_num - write(iunit,'(A)') 'Atomic positions (au):' - integer :: i - do i=1,nucl_num - write(iunit,'(3(1PE20.13))') nucl_coord(i,1:3) - enddo - write(iunit,'(A)') 'Atomic numbers for each atom:' - ! Add 200 if pseudopotential - allocate(itmp(nucl_num)) - do i=1,nucl_num - itmp(i) = int(nucl_charge(i)) - enddo - write(iunit,'(8(I10))') itmp(1:nucl_num) - deallocate(itmp) - write(iunit,'(A)') 'Valence charges for each atom:' - write(iunit,'(4(1PE20.13))') nucl_charge(1:nucl_num) - write(iunit,'(A)') '' - - - write(iunit,'(A)') 'BASIS SET' - write(iunit,'(A)') '---------' - write(iunit,'(A)') 'Number of Gaussian centres' - write(iunit,*) nucl_num - write(iunit,'(A)') 'Number of shells per primitive cell' - integer :: icount - icount = 0 - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - icount += 1 - endif - enddo - write(iunit,*) icount - write(iunit,'(A)') 'Number of basis functions (''AO'') per primitive cell' - icount = 0 - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - icount += 2*ao_l(i)+1 - endif - enddo - n_ao_new = icount - write(iunit,*) n_ao_new - write(iunit,'(A)') 'Number of Gaussian primitives per primitive cell' - allocate(itmp(ao_num)) - integer :: l - l=0 - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - l += 1 - itmp(l) = ao_prim_num(i) - endif - enddo - write(iunit,'(8(I10))') sum(itmp(1:l)) - write(iunit,'(A)') 'Highest shell angular momentum (s/p/d/f... 1/2/3/4...)' - write(iunit,*) maxval(ao_l(1:ao_num))+1 - write(iunit,'(A)') 'Code for shell types (s/sp/p/d/f... 1/2/3/4/5...)' - l=0 - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - l += 1 - if (ao_l(i) > 0) then - itmp(l) = ao_l(i)+2 - else - itmp(l) = ao_l(i)+1 - endif - endif - enddo - write(iunit,'(8(I10))') itmp(1:l) - write(iunit,'(A)') 'Number of primitive Gaussians in each shell' - l=0 - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - l += 1 - itmp(l) = ao_prim_num(i) - endif - enddo - write(iunit,'(8(I10))') itmp(1:l) - deallocate(itmp) - write(iunit,'(A)') 'Sequence number of first shell on each centre' - allocate(itmp(nucl_num)) - l=0 - icount = 1 - itmp(icount) = 1 - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - l = l+1 - if (ao_nucl(i) == icount) then - continue - else if (ao_nucl(i) == icount+1) then - icount += 1 - itmp(icount) = l - else - print *, 'Problem in order of centers of basis functions' - stop 1 - endif - endif - enddo - ! Check - if (icount /= nucl_num) then - print *, 'Error :' - print *, ' icount :', icount - print *, ' nucl_num:', nucl_num - stop 2 - endif - write(iunit,'(8(I10))') itmp(1:nucl_num) - deallocate(itmp) - write(iunit,'(A)') 'Exponents of Gaussian primitives' - allocate(rtmp(ao_num)) - l=0 - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - do j=1,ao_prim_num(i) - l+=1 - rtmp(l) = ao_expo(i,ao_prim_num(i)-j+1) - enddo - endif - enddo - write(iunit,'(4(1PE20.13))') rtmp(1:l) - write(iunit,'(A)') 'Normalized contraction coefficients' - l=0 - integer :: j - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - do j=1,ao_prim_num(i) - l+=1 - rtmp(l) = ao_coef_normalized(i,ao_prim_num(i)) - enddo - endif - enddo - write(iunit,'(4(1PE20.13))') rtmp(1:l) - deallocate(rtmp) - write(iunit,'(A)') 'Position of each shell (au)' - l=0 - do i=1,ao_num - if (ao_l(i) == ao_power(i,1)) then - write(iunit,'(3(1PE20.13))') nucl_coord( ao_nucl(i), 1:3 ) - endif - enddo - write(iunit,'(A)') - - - write(iunit,'(A)') 'MULTIDETERMINANT INFORMATION' - write(iunit,'(A)') '----------------------------' - write(iunit,'(A)') 'GS' - write(iunit,'(A)') 'ORBITAL COEFFICIENTS' - write(iunit,'(A)') '------------------------' - - ! Transformation cartesian -> spherical - double precision :: tf2(6,5), tf3(10,7), tf4(15,9) - integer :: check2(3,6), check3(3,10), check4(3,15) - check2(:,1) = (/ 2, 0, 0 /) - check2(:,2) = (/ 1, 1, 0 /) - check2(:,3) = (/ 1, 0, 1 /) - check2(:,4) = (/ 0, 2, 0 /) - check2(:,5) = (/ 0, 1, 1 /) - check2(:,6) = (/ 0, 0, 2 /) - - check3(:,1) = (/ 3, 0, 0 /) - check3(:,2) = (/ 2, 1, 0 /) - check3(:,3) = (/ 2, 0, 1 /) - check3(:,4) = (/ 1, 2, 0 /) - check3(:,5) = (/ 1, 1, 1 /) - check3(:,6) = (/ 1, 0, 2 /) - check3(:,7) = (/ 0, 3, 0 /) - check3(:,8) = (/ 0, 2, 1 /) - check3(:,9) = (/ 0, 1, 2 /) - check3(:,10) = (/ 0, 0, 3 /) - - check4(:,1) = (/ 4, 0, 0 /) - check4(:,2) = (/ 3, 1, 0 /) - check4(:,3) = (/ 3, 0, 1 /) - check4(:,4) = (/ 2, 2, 0 /) - check4(:,5) = (/ 2, 1, 1 /) - check4(:,6) = (/ 2, 0, 2 /) - check4(:,7) = (/ 1, 3, 0 /) - check4(:,8) = (/ 1, 2, 1 /) - check4(:,9) = (/ 1, 1, 2 /) - check4(:,10) = (/ 1, 0, 3 /) - check4(:,11) = (/ 0, 4, 0 /) - check4(:,12) = (/ 0, 3, 1 /) - check4(:,13) = (/ 0, 2, 2 /) - check4(:,14) = (/ 0, 1, 3 /) - check4(:,15) = (/ 0, 0, 4 /) - -! tf2 = (/ -! -0.5, 0, 0, -0.5, 0, 1.0, & -! 0, 0, 1.0, 0, 0, 0, & -! 0, 0, 0, 0, 1.0, 0, & -! 0.86602540378443864676, 0, 0, -0.86602540378443864676, 0, 0, & -! 0, 1.0, 0, 0, 0, 0, & -! /) -! tf3 = (/ -! 0, 0, -0.67082039324993690892, 0, 0, 0, 0, -0.67082039324993690892, 0, 1.0, & -! -0.61237243569579452455, 0, 0, -0.27386127875258305673, 0, 1.0954451150103322269, 0, 0, 0, 0, & -! 0, -0.27386127875258305673, 0, 0, 0, 0, -0.61237243569579452455, 0, 1.0954451150103322269, 0, & -! 0, 0, 0.86602540378443864676, 0, 0, 0, 0, -0.86602540378443864676, 0, 0, & -! 0, 0, 0, 0, 1.0, 0, 0, 0, 0, 0, & -! 0.790569415042094833, 0, 0, -1.0606601717798212866, 0, 0, 0, 0, 0, 0, & -! 0, 1.0606601717798212866, 0, 0, 0, 0, -0.790569415042094833, 0, 0, 0, & -! /) -! tf4 = (/ -! 0.375, 0, 0, 0.21957751641341996535, 0, -0.87831006565367986142, 0, 0, 0, 0, 0.375, 0, -0.87831006565367986142, 0, 1.0, & -! 0, 0, -0.89642145700079522998, 0, 0, 0, 0, -0.40089186286863657703, 0, 1.19522860933439364, 0, 0, 0, 0, 0, & -! 0, 0, 0, 0, -0.40089186286863657703, 0, 0, 0, 0, 0, 0, -0.89642145700079522998, 0, 1.19522860933439364, 0, & -! -0.5590169943749474241, 0, 0, 0, 0, 0.9819805060619657157, 0, 0, 0, 0, 0.5590169943749474241, 0, -0.9819805060619657157, 0, 0, & -! 0, -0.42257712736425828875, 0, 0, 0, 0, -0.42257712736425828875, 0, 1.1338934190276816816, 0, 0, 0, 0, 0, 0, & -! 0, 0, 0.790569415042094833, 0, 0, 0, 0, -1.0606601717798212866, 0, 0, 0, 0, 0, 0, 0, & -! 0, 0, 0, 0, 1.0606601717798212866, 0, 0, 0, 0, 0, 0, -0.790569415042094833, 0, 0, 0, & -! 0.73950997288745200532, 0, 0, -1.2990381056766579701, 0, 0, 0, 0, 0, 0, 0.73950997288745200532, 0, 0, 0, 0, & -! 0, 1.1180339887498948482, 0, 0, 0, 0, -1.1180339887498948482, 0, 0, 0, 0, 0, 0, 0, 0, & -! /) -! - - - allocate(rtmp(ao_num*mo_tot_num)) - l=0 - do i=1,mo_tot_num - do j=1,ao_num - l += 1 - rtmp(l) = mo_coef(j,i) - enddo - enddo - write(iunit,'(4(1PE20.13))') rtmp(1:l) - deallocate(rtmp) - close(iunit) -end - -program prog_save_casino - call save_casino -end diff --git a/plugins/Casino/tree_dependency.png b/plugins/Casino/tree_dependency.png deleted file mode 100644 index 98994c93..00000000 Binary files a/plugins/Casino/tree_dependency.png and /dev/null differ diff --git a/plugins/DensityMatrix/README.rst b/plugins/DensityMatrix/README.rst deleted file mode 100644 index a8c58436..00000000 --- a/plugins/DensityMatrix/README.rst +++ /dev/null @@ -1,58 +0,0 @@ -==================== -DensityMatrix Module -==================== - -Documentation -============= - -.. Do not edit this section. It was auto-generated from the -.. NEEDED_MODULES file. - -`iunit_two_body_dm_aa `_ - Temporary files for 2-body dm calculation - -`iunit_two_body_dm_ab `_ - Temporary files for 2-body dm calculation - -`iunit_two_body_dm_bb `_ - Temporary files for 2-body dm calculation - -`two_body_dm_diag_aa `_ - diagonal part of the two body density matrix - -`two_body_dm_diag_ab `_ - diagonal part of the two body density matrix - -`two_body_dm_diag_bb `_ - diagonal part of the two body density matrix - -`det_coef_provider `_ - Undocumented - -`det_num `_ - Undocumented - -`det_provider `_ - Undocumented - - - -Needed Modules -============== - -.. Do not edit this section. It was auto-generated from the -.. NEEDED_MODULES file. - -* `AOs `_ -* `BiInts `_ -* `Bitmask `_ -* `Dets `_ -* `Electrons `_ -* `Ezfio_files `_ -* `Hartree_Fock `_ -* `MonoInts `_ -* `MOs `_ -* `Nuclei `_ -* `Output `_ -* `Utils `_ - diff --git a/plugins/DensityMatrix/density_matrix_array.irp.f b/plugins/DensityMatrix/density_matrix_array.irp.f deleted file mode 100644 index 902eac7b..00000000 --- a/plugins/DensityMatrix/density_matrix_array.irp.f +++ /dev/null @@ -1,116 +0,0 @@ - use bitmasks - BEGIN_PROVIDER [ double precision, two_body_dm_aa, (mo_tot_num,mo_tot_num,mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, two_body_dm_bb, (mo_tot_num,mo_tot_num,mo_tot_num,mo_tot_num) ] -&BEGIN_PROVIDER [ double precision, two_body_dm_ab, (mo_tot_num,mo_tot_num,mo_tot_num,mo_tot_num) ] - implicit none - use bitmasks - BEGIN_DOC - ! Temporary files for 2-body dm calculation - END_DOC - integer :: getUnitAndOpen - - ! Compute two body DM in file - integer :: k,l,degree, idx,i,j - integer :: exc(0:2,2,2),n_occ_alpha - double precision :: phase, coef - integer :: h1,h2,p1,p2,s1,s2, e1, e2 - double precision :: ck, cl - character*(128), parameter :: f = '(i8,4(x,i5),x,d16.8)' - integer :: istate - - two_body_dm_aa = 0.d0 - two_body_dm_ab = 0.d0 - two_body_dm_bb = 0.d0 - - istate = 1 - ! OMP PARALLEL DEFAULT(SHARED) PRIVATE(k,ck,ckl,i,j,e1,e2,cl,phase,h1,p1,h2,p2,s1,s2,occ) - ! OMP DO SCHEDULE(dynamic,64) - do k=1,N_det - ck = psi_coef(k,istate) - call bitstring_to_list(psi_det(1,1,k), occ(1,1), n_occ_alpha, N_int) - call bitstring_to_list(psi_det(1,2,k), occ(1,2), n_occ_alpha, N_int) - ckl = psi_coef(k,istate) * psi_coef(k,istate) - do i = 1,elec_alpha_num - e1=occ(i,1) - do j = 1,elec_alpha_num - e2=occ(j,1) - ! alpha-alpha - two_body_dm_aa(e1,e2,e1,e2) += 0.5d0*ckl - two_body_dm_aa(e1,e2,e2,e1) -= 0.5d0*ckl - enddo - do j = 1,elec_beta_num - e2=occ(j,2) - ! alpha-beta - two_body_dm_ab(e1,e2,e1,e2) += ckl - enddo - enddo - do i = 1,elec_beta_num - e1=occ(i,2) - do j = 1,elec_beta_num - e2=occ(j,2) - ! beta-beta - two_body_dm_bb(e1,e2,e1,e2) += 0.5d0*ckl - two_body_dm_bb(e1,e2,e2,e1) -= 0.5d0*ckl - enddo - enddo - - do l=1,k-1 - cl = 2.d0*psi_coef(l,istate) - call get_excitation_degree(psi_det(1,1,k),psi_det(1,1,l),degree,N_int) - if (degree == 2) then - call get_double_excitation(psi_det(1,1,k),psi_det(1,1,l),exc,phase,N_int) - call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) - ckl = phase*ck*cl - select case (s1+s2) - case(2) ! alpha alpha - two_body_dm_aa(h1,h2,p1,p2) += ckl - two_body_dm_aa(h1,h2,p2,p1) -= ckl - case(3) ! alpha beta - two_body_dm_ab(h1,h2,p1,p2) += ckl - case(4) ! beta beta - two_body_dm_bb(h1,h2,p1,p2) += ckl - two_body_dm_bb(h1,h2,p2,p1) -= ckl - end select - else if (degree == 1) then - call get_mono_excitation(psi_det(1,1,k),psi_det(1,1,l),exc,phase,N_int) - call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) - double precision :: ckl - ckl = phase*ck*cl - call bitstring_to_list(psi_det(1,1,k), occ(1,1), n_occ_alpha, N_int) - call bitstring_to_list(psi_det(1,2,k), occ(1,2), n_occ_alpha, N_int) - select case (s1) - case (1) ! Alpha single excitation - integer :: occ(N_int*bit_kind_size,2) - do i = 1, elec_alpha_num - p2=occ(i,1) - h2=p2 - two_body_dm_aa(h1,h2,p1,p2) += ckl - two_body_dm_aa(h1,h2,p2,p1) -= ckl - enddo - do i = 1, elec_beta_num - p2=occ(i,2) - h2=p2 - two_body_dm_ab(h1,h2,p1,p2) += ckl - enddo - case (2) ! Beta single excitation - do i = 1, elec_alpha_num - p2=occ(i,1) - h2=p2 - two_body_dm_ab(h1,h2,p1,p2) += ckl - enddo - do i = 1, elec_beta_num - p2=occ(i,2) - h2=p2 - two_body_dm_bb(h1,h2,p1,p2) += ckl - two_body_dm_bb(h1,h2,p2,p1) -= ckl - enddo - end select - endif - enddo - enddo - ! OMP END DO - ! OMP END PARALLEL - -END_PROVIDER - - diff --git a/plugins/DensityMatrix/print_2rdm.irp.f b/plugins/DensityMatrix/print_2rdm.irp.f deleted file mode 100644 index b4277938..00000000 --- a/plugins/DensityMatrix/print_2rdm.irp.f +++ /dev/null @@ -1,67 +0,0 @@ -program pouet - implicit none - integer :: i,j,k,l - double precision, external :: get_mo_bielec_integral - read_wf = .True. - TOUCH read_wf - - double precision :: e(10) - e = 0.d0 - - print *, '1RDM ALPHA' - do i=1,mo_tot_num - do j=1,mo_tot_num - print *, i, j, one_body_dm_mo_alpha(i,j,1) - e(4) += one_body_dm_mo_alpha(i,j,1) * mo_mono_elec_integral(i,j) - enddo - enddo - - print *, '1RDM BETA' - do i=1,mo_tot_num - do j=1,mo_tot_num - print *, i, j, one_body_dm_mo_beta(i,j,1) - e(4) += one_body_dm_mo_beta(i,j,1) * mo_mono_elec_integral(i,j) - enddo - enddo - - print *, '2RDM ALPHA ALPHA' - do i=1,mo_tot_num - do j=1,mo_tot_num - do k=1,mo_tot_num - do l=1,mo_tot_num - print *, i, j, k, l, two_body_dm_aa(i,j,k,l) - e(1) += two_body_dm_aa(i,j,k,l) * get_mo_bielec_integral(i,j,k,l, mo_integrals_map) - enddo - enddo - enddo - enddo - - print *, '2RDM BETA BETA' - do i=1,mo_tot_num - do j=1,mo_tot_num - do k=1,mo_tot_num - do l=1,mo_tot_num - print *, i, j, k, l, two_body_dm_bb(i,j,k,l) - e(2) += two_body_dm_bb(i,j,k,l) * get_mo_bielec_integral(i,j,k,l, mo_integrals_map) - enddo - enddo - enddo - enddo - - print *, '2RDM ALPHA BETA' - do i=1,mo_tot_num - do j=1,mo_tot_num - do k=1,mo_tot_num - do l=1,mo_tot_num - print *, i, j, k, l, two_body_dm_ab(i,j,k,l) - e(3) += two_body_dm_ab(i,j,k,l) * get_mo_bielec_integral(i,j,k,l, mo_integrals_map) - enddo - enddo - enddo - enddo - - print *, '' - print *, 'Energy ', sum(e(1:4)) + nuclear_repulsion - - -end diff --git a/plugins/NOFT/.gitignore b/plugins/FCIdump/.gitignore similarity index 100% rename from plugins/NOFT/.gitignore rename to plugins/FCIdump/.gitignore diff --git a/plugins/FCIdump/NEEDED_CHILDREN_MODULES b/plugins/FCIdump/NEEDED_CHILDREN_MODULES index 491f2016..00cd3e16 100644 --- a/plugins/FCIdump/NEEDED_CHILDREN_MODULES +++ b/plugins/FCIdump/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Determinants DavidsonUndressed core_integrals +Determinants DavidsonUndressed diff --git a/plugins/FCIdump/tree_dependency.png b/plugins/FCIdump/tree_dependency.png deleted file mode 100644 index 04877dea..00000000 Binary files a/plugins/FCIdump/tree_dependency.png and /dev/null differ diff --git a/plugins/FourIdx/four_index.irp.f b/plugins/FourIdx/four_index.irp.f deleted file mode 100644 index 0c30f55e..00000000 --- a/plugins/FourIdx/four_index.irp.f +++ /dev/null @@ -1,180 +0,0 @@ -subroutine four_index_transform(map_a,map_c,matrix_B,LDB, & - i_start, j_start, k_start, l_start, & - i_end , j_end , k_end , l_end , & - a_start, b_start, c_start, d_start, & - a_end , b_end , c_end , d_end ) - implicit none - use map_module - use mmap_module - BEGIN_DOC -! Performs a four-index transformation of map_a(N^4) into map_c(M^4) using b(NxM) -! C_{abcd} = \sum_{ijkl} A_{ijkl}.B_{ia}.B_{jb}.B_{kc}.B_{ld} -! Loops run over *_start->*_end - END_DOC - type(map_type), intent(in) :: map_a - type(map_type), intent(inout) :: map_c - integer, intent(in) :: LDB - double precision, intent(in) :: matrix_B(LDB,*) - integer, intent(in) :: i_start, j_start, k_start, l_start - integer, intent(in) :: i_end , j_end , k_end , l_end - integer, intent(in) :: a_start, b_start, c_start, d_start - integer, intent(in) :: a_end , b_end , c_end , d_end - - double precision, allocatable :: T(:,:,:), U(:,:,:), V(:,:,:) - integer :: i_max, j_max, k_max, l_max - integer :: i_min, j_min, k_min, l_min - integer :: i, j, k, l - integer :: a, b, c, d - double precision, external :: get_ao_bielec_integral - integer(key_kind) :: idx - real(integral_kind) :: tmp - integer(key_kind), allocatable :: key(:) - real(integral_kind), allocatable :: value(:) - - ASSERT (k_start == i_start) - ASSERT (l_start == j_start) - ASSERT (a_start == c_start) - ASSERT (b_start == d_start) - - i_min = min(i_start,a_start) - i_max = max(i_end ,a_end ) - j_min = min(j_start,b_start) - j_max = max(j_end ,b_end ) - k_min = min(k_start,c_start) - k_max = max(k_end ,c_end ) - l_min = min(l_start,d_start) - l_max = max(l_end ,d_end ) - - ASSERT (0 < i_max) - ASSERT (0 < j_max) - ASSERT (0 < k_max) - ASSERT (0 < l_max) - ASSERT (LDB >= i_max) - ASSERT (LDB >= j_max) - ASSERT (LDB >= k_max) - ASSERT (LDB >= l_max) - - ! Create a temporary memory-mapped file - integer :: fd - type(c_ptr) :: c_pointer - integer*8, pointer :: a_array(:,:,:) - call mmap(trim(ezfio_filename)//'/work/four_idx', & - (/ 4_8,int(i_end-i_start+1,8),int(j_end-j_start+1,8),int(k_end-k_start+1,8), int(l_end-l_start+1,8) /), 8, fd, .False., c_pointer) - call c_f_pointer(c_pointer, a_array, (/ 4, (i_end-i_start+1)*(j_end-j_start+1)*(k_end-k_start+1), l_end-l_start+1 /)) - - - !$OMP PARALLEL DEFAULT(NONE) SHARED(a_array,c_pointer,fd, & - !$OMP a_start,a_end,b_start,b_end,c_start,c_end,d_start,d_end,& - !$OMP i_start,i_end,j_start,j_end,k_start,k_end,l_start,l_end,& - !$OMP i_min,i_max,j_min,j_max,k_min,k_max,l_min,l_max, & - !$OMP map_a,map_c,matrix_B) & - !$OMP PRIVATE(key,value,T,U,V,i,j,k,l,idx, & - !$OMP a,b,c,d,tmp) - allocate( key(i_max*j_max*k_max), value(i_max*j_max*k_max) ) - allocate( U(a_start:a_end, c_start:c_end, b_start:b_end) ) - - - !$OMP DO SCHEDULE(dynamic,4) - do l=l_start,l_end - a = 1 - do j=j_start,j_end - do k=k_start,k_end - do i=i_start,i_end - call bielec_integrals_index(i,j,k,l,idx) - call map_get(map_a,idx,tmp) - if (tmp /= 0.d0) then - a = a+1 - a_array(1,a,l-l_start+1) = i - a_array(2,a,l-l_start+1) = j - a_array(3,a,l-l_start+1) = k - a_array(4,a,l-l_start+1) = transfer(dble(tmp), 1_8) - endif - enddo - enddo - enddo - a_array(1,1,l-l_start+1) = a - print *, l - enddo - !$OMP END DO - - !$OMP DO SCHEDULE(dynamic) - do d=d_start,d_end - U = 0.d0 - do l=l_start,l_end - if (dabs(matrix_B(l,d)) < 1.d-10) then - cycle - endif - print *, d, l - - allocate( T(i_start:i_end, k_start:k_end, j_start:j_end), & - V(a_start:a_end, k_start:k_end, j_start:j_end) ) - - T = 0.d0 - do a=2,a_array(1,1,l-l_start+1) - i = a_array(1,a,l-l_start+1) - j = a_array(2,a,l-l_start+1) - k = a_array(3,a,l-l_start+1) - T(i, k,j) = transfer(a_array(4,a,l-l_start+1), 1.d0) - enddo - - call DGEMM('T','N', (a_end-a_start+1), & - (k_end-k_start+1)*(j_end-j_start+1), & - (i_end-i_start+1), 1.d0, & - matrix_B(i_start,a_start), size(matrix_B,1), & - T(i_start,k_start,j_start), size(T,1), 0.d0, & - V(a_start,k_start,j_start), size(V, 1) ) - - deallocate(T) - allocate( T(a_start:a_end, k_start:k_end, b_start:d) ) - - call DGEMM('N','N', (a_end-a_start+1)*(k_end-k_start+1), & - (b_end-b_start+1), & - (j_end-j_start+1), 1.d0, & - V(a_start,k_start,j_start), size(V,1)*size(V,2), & - matrix_B(j_start,b_start), size(matrix_B,1),0.d0, & - T(a_start,k_start,b_start), size(T,1)*size(T,2) ) - - deallocate(V) - - do b=b_start,b_end - call DGEMM('N','N', (a_end-a_start+1), (c_end-c_start+1), & - (k_end-k_start+1), matrix_B(l, d), & - T(a_start,k_start,b), size(T,1), & - matrix_B(k_start,c_start), size(matrix_B,1), 1.d0, & - U(a_start,c_start,b), size(U,1) ) - enddo - - deallocate(T) - - enddo - - idx = 0_8 - do b=b_start,b_end - do c=c_start,c_end - do a=a_start,a_end - if (dabs(U(a,c,b)) < 1.d-15) then - cycle - endif - idx = idx+1_8 - call bielec_integrals_index(a,b,c,d,key(idx)) - value(idx) = U(a,c,b) - enddo - enddo - enddo - - !$OMP CRITICAL - call map_append(map_c, key, value, idx) - call map_sort(map_c) - !$OMP END CRITICAL - - - enddo - !$OMP END DO - - deallocate(key,value) - !$OMP END PARALLEL - - call munmap( & - (/ 4_8,int(i_end-i_start+1,8),int(j_end-j_start+1,8),int(k_end-k_start+1,8), int(l_end-l_start+1,8) /), 8, fd, c_pointer) - -end diff --git a/plugins/FourIdx/four_index_sym.irp.f b/plugins/FourIdx/four_index_sym.irp.f deleted file mode 100644 index cd9cb150..00000000 --- a/plugins/FourIdx/four_index_sym.irp.f +++ /dev/null @@ -1,277 +0,0 @@ -subroutine four_index_transform_sym(map_a,map_c,matrix_B,LDB, & - i_start, j_start, k_start, l_start, & - i_end , j_end , k_end , l_end , & - a_start, b_start, c_start, d_start, & - a_end , b_end , c_end , d_end ) - implicit none - use map_module - use mmap_module - BEGIN_DOC -! Performs a four-index transformation of map_a(N^4) into map_c(M^4) using b(NxM) -! C_{abcd} = \sum_{ijkl} A_{ijkl}.B_{ia}.B_{jb}.B_{kc}.B_{ld} -! Loops run over *_start->*_end - END_DOC - type(map_type), intent(in) :: map_a - type(map_type), intent(inout) :: map_c - integer, intent(in) :: LDB - double precision, intent(in) :: matrix_B(LDB,*) - integer, intent(in) :: i_start, j_start, k_start, l_start - integer, intent(in) :: i_end , j_end , k_end , l_end - integer, intent(in) :: a_start, b_start, c_start, d_start - integer, intent(in) :: a_end , b_end , c_end , d_end - - double precision, allocatable :: T(:,:), U(:,:,:), V(:,:) - double precision, allocatable :: T2d(:,:), V2d(:,:) - integer :: i_max, j_max, k_max, l_max - integer :: i_min, j_min, k_min, l_min - integer :: i, j, k, l, ik, ll - integer :: a, b, c, d - double precision, external :: get_ao_bielec_integral - integer*8 :: ii - integer(key_kind) :: idx - real(integral_kind) :: tmp - integer(key_kind), allocatable :: key(:) - real(integral_kind), allocatable :: value(:) - integer*8, allocatable :: l_pointer(:) - - ASSERT (k_start == i_start) - ASSERT (l_start == j_start) - ASSERT (a_start == c_start) - ASSERT (b_start == d_start) - - i_min = min(i_start,a_start) - i_max = max(i_end ,a_end ) - j_min = min(j_start,b_start) - j_max = max(j_end ,b_end ) - k_min = min(k_start,c_start) - k_max = max(k_end ,c_end ) - l_min = min(l_start,d_start) - l_max = max(l_end ,d_end ) - - ASSERT (0 < i_max) - ASSERT (0 < j_max) - ASSERT (0 < k_max) - ASSERT (0 < l_max) - ASSERT (LDB >= i_max) - ASSERT (LDB >= j_max) - ASSERT (LDB >= k_max) - ASSERT (LDB >= l_max) - - ! Create a temporary memory-mapped file - integer :: fd - type(c_ptr) :: c_pointer - integer*8, pointer :: a_array(:) - call mmap(trim(ezfio_filename)//'/work/four_idx', & - (/ 12_8 * map_a % n_elements /), 8, fd, .False., c_pointer) - call c_f_pointer(c_pointer, a_array, (/ 12_8 * map_a % n_elements /)) - - allocate(l_pointer(l_start:l_end+1), value((i_max*k_max)) ) - ii = 1_8 - !$OMP PARALLEL DEFAULT(SHARED) PRIVATE(i,j,k,l,ik,idx) - do l=l_start,l_end - !$OMP SINGLE - l_pointer(l) = ii - !$OMP END SINGLE - do j=j_start,j_end - !$OMP DO SCHEDULE(static,1) - do k=k_start,k_end - do i=i_start,k - ik = (i-i_start+1) + ishft( (k-k_start)*(k-k_start+1), -1 ) - call bielec_integrals_index(i,j,k,l,idx) - call map_get(map_a,idx,value(ik)) - enddo - enddo - !$OMP END DO - - !$OMP SINGLE - ik=0 - do k=k_start,k_end - do i=i_start,k - ik = ik+1 - tmp=value(ik) - if (tmp /= 0.d0) then - a_array(ii) = ik - ii = ii+1_8 - a_array(ii) = j - ii = ii+1_8 - a_array(ii) = transfer(dble(tmp), 1_8) - ii = ii+1_8 - endif - enddo - enddo - !$OMP END SINGLE - enddo - enddo - !$OMP SINGLE - l_pointer(l_end+1) = ii - !$OMP END SINGLE - !$OMP END PARALLEL - deallocate(value) - -!INPUT DATA -!open(unit=10,file='INPUT',form='UNFORMATTED') -!write(10) i_start, j_start, i_end, j_end -!write(10) a_start, b_start, a_end, b_end -!write(10) LDB, mo_tot_num -!write(10) matrix_B(1:LDB,1:mo_tot_num) -!idx=size(a_array) -!write(10) idx -!write(10) a_array -!write(10) l_pointer -!close(10) -!open(unit=10,file='OUTPUT',form='FORMATTED') -! END INPUT DATA - - - !$OMP PARALLEL DEFAULT(NONE) SHARED(a_array,c_pointer,fd, & - !$OMP a_start,a_end,b_start,b_end,c_start,c_end,d_start,d_end,& - !$OMP i_start,i_end,j_start,j_end,k_start,k_end,l_start,l_end,& - !$OMP i_min,i_max,j_min,j_max,k_min,k_max,l_min,l_max, & - !$OMP map_c,matrix_B,l_pointer) & - !$OMP PRIVATE(key,value,T,U,V,i,j,k,l,idx,ik,ll, & - !$OMP a,b,c,d,tmp,T2d,V2d,ii) - allocate( key(i_max*j_max*k_max), value(i_max*j_max*k_max) ) - allocate( U(a_start:a_end, c_start:c_end, b_start:b_end) ) - - - - allocate( T2d((i_end-i_start+1)*(k_end-k_start+2)/2, j_start:j_end), & - V2d((i_end-i_start+1)*(k_end-k_start+2)/2, b_start:b_end), & - V(i_start:i_end, k_start:k_end), & - T(k_start:k_end, a_start:a_end)) - - - !$OMP DO SCHEDULE(dynamic) - do d=d_start,d_end - U = 0.d0 - do l=l_start,l_end - if (dabs(matrix_B(l,d)) < 1.d-10) then - cycle - endif - - ii=l_pointer(l) - do j=j_start,j_end - ik=0 - do k=k_start,k_end - do i=i_start,k - ik = ik+1 - if ( (ik /= a_array(ii)).or.(j /= a_array(ii+1_8)) & - .or.(ii >= l_pointer(l+1)) ) then - T2d(ik,j) = 0.d0 - else - T2d(ik,j) = transfer(a_array(ii+2_8), 1.d0) - ii=ii+3_8 - endif - enddo - enddo - enddo - call DGEMM('N','N', ishft( (i_end-i_start+1)*(i_end-i_start+2), -1),& - (d-b_start+1), & - (j_end-j_start+1), 1.d0, & - T2d(1,j_start), size(T2d,1), & - matrix_B(j_start,b_start), size(matrix_B,1),0.d0, & - V2d(1,b_start), size(V2d,1) ) - - do b=b_start,d - ik = 0 - do k=k_start,k_end - do i=i_start,k - ik = ik+1 - V(i,k) = V2d(ik,b) - enddo - enddo - -! T = 0.d0 -! do a=a_start,b -! do k=k_start,k_end -! do i=i_start,k -! T(k,a) = T(k,a) + V(i,k)*matrix_B(i,a) -! enddo -! do i=k+1,i_end -! T(k,a) = T(k,a) + V(k,i)*matrix_B(i,a) -! enddo -! enddo -! enddo - call DSYMM('L','U', (k_end-k_start+1), (b-a_start+1), & - 1.d0, & - V(i_start,k_start), size(V,1), & - matrix_B(i_start,a_start), size(matrix_B,1),0.d0, & - T(k_start,a_start), size(T,1) ) - -! do c=c_start,b -! do a=a_start,c -! do k=k_start,k_end -! U(a,c,b) = U(a,c,b) + T(k,a)*matrix_B(k,c)*matrix_B(l,d) -! enddo -! enddo -! enddo - call DGEMM('T','N', (b-a_start+1), (b-c_start+1), & - (k_end-k_start+1), matrix_B(l, d), & - T(k_start,a_start), size(T,1), & - matrix_B(k_start,c_start), size(matrix_B,1), 1.d0, & - U(a_start,c_start,b), size(U,1) ) -! do c=b+1,c_end -! do a=a_start,b -! do k=k_start,k_end -! U(a,c,b) = U(a,c,b) + T(k,a)*matrix_B(k,c)*matrix_B(l,d) -! enddo -! enddo -! enddo - if (b < b_end) then - call DGEMM('T','N', (b-a_start+1), (c_end-b), & - (k_end-k_start+1), matrix_B(l, d), & - T(k_start,a_start), size(T,1), & - matrix_B(k_start,b+1), size(matrix_B,1), 1.d0, & - U(a_start,b+1,b), size(U,1) ) - endif - enddo - - enddo - - idx = 0_8 - do b=b_start,d - do c=c_start,c_end - do a=a_start,min(b,c) - if (dabs(U(a,c,b)) < 1.d-15) then - cycle - endif - idx = idx+1_8 - call bielec_integrals_index(a,b,c,d,key(idx)) - value(idx) = U(a,c,b) - enddo - enddo - enddo - - !$OMP CRITICAL - call map_append(map_c, key, value, idx) - !$OMP END CRITICAL - -!WRITE OUTPUT -! OMP CRITICAL -!print *, d -!do b=b_start,d -! do c=c_start,c_end -! do a=a_start,min(b,c) -! if (dabs(U(a,c,b)) < 1.d-15) then -! cycle -! endif -! write(10,*) d,c,b,a,U(a,c,b) -! enddo -! enddo -!enddo -! OMP END CRITICAL -!END WRITE OUTPUT - - - enddo - !$OMP END DO - - deallocate(key,value,V,T) - !$OMP END PARALLEL - call map_sort(map_c) - - call munmap( & - (/ 12_8 * map_a % n_elements /), 8, fd, c_pointer) - deallocate(l_pointer) - -end diff --git a/plugins/Full_CI/tree_dependency.png b/plugins/Full_CI/tree_dependency.png deleted file mode 100644 index 158a3945..00000000 Binary files a/plugins/Full_CI/tree_dependency.png and /dev/null differ diff --git a/plugins/Full_CI_ZMQ/target_pt2_ratio_zmq.irp.f b/plugins/Full_CI_ZMQ/target_pt2_ratio_zmq.irp.f deleted file mode 100644 index dbe436ff..00000000 --- a/plugins/Full_CI_ZMQ/target_pt2_ratio_zmq.irp.f +++ /dev/null @@ -1,109 +0,0 @@ -program target_pt2_ratio - implicit none - integer :: i,j,k - logical, external :: detEq - - double precision, allocatable :: pt2(:) - integer :: Nmin, Nmax - integer :: n_det_before, to_select - double precision :: threshold_davidson_in, ratio, E_ref - - double precision, allocatable :: psi_coef_ref(:,:) - integer(bit_kind), allocatable :: psi_det_ref(:,:,:) - - - allocate (pt2(N_states)) - - pt2 = 1.d0 - threshold_davidson_in = threshold_davidson - threshold_davidson = threshold_davidson_in * 100.d0 - SOFT_TOUCH threshold_davidson - - ! Stopping criterion is the PT2max - - double precision :: E_CI_before(N_states) - do while (dabs(pt2(1)) > pt2_max) - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - do k=1, N_states - print*,'State ',k - print *, 'PT2 = ', pt2(k) - print *, 'E = ', CI_energy(k) - print *, 'E(before)+PT2 = ', E_CI_before(k)+pt2(k) - enddo - print *, '-----' - E_CI_before(1:N_states) = CI_energy(1:N_states) - call ezfio_set_full_ci_zmq_energy(CI_energy(1)) - - n_det_before = N_det - to_select = N_det - to_select = max(64-to_select, to_select) - call ZMQ_selection(to_select, pt2) - - PROVIDE psi_coef - PROVIDE psi_det - PROVIDE psi_det_sorted - - call diagonalize_CI - call save_wavefunction - call ezfio_set_full_ci_zmq_energy(CI_energy(1)) - enddo - - threshold_selectors = max(threshold_selectors,threshold_selectors_pt2) - threshold_generators = max(threshold_generators,threshold_generators_pt2) - threshold_davidson = threshold_davidson_in - TOUCH threshold_selectors threshold_generators threshold_davidson - call diagonalize_CI - call ZMQ_selection(0, pt2) - - E_ref = CI_energy(1) + pt2(1) - print *, 'Est FCI = ', E_ref - - Nmax = N_det - Nmin = 2 - allocate (psi_coef_ref(size(psi_coef_sorted,1),size(psi_coef_sorted,2))) - allocate (psi_det_ref(N_int,2,size(psi_det_sorted,3))) - psi_coef_ref = psi_coef_sorted - psi_det_ref = psi_det_sorted - psi_det = psi_det_sorted - psi_coef = psi_coef_sorted - TOUCH psi_coef psi_det - do while (Nmax-Nmin > 1) - psi_coef = psi_coef_ref - psi_det = psi_det_ref - TOUCH psi_det psi_coef - call diagonalize_CI - ratio = (CI_energy(1) - HF_energy) / (E_ref - HF_energy) - if (ratio < var_pt2_ratio) then - Nmin = N_det - else - Nmax = N_det - psi_coef_ref = psi_coef - psi_det_ref = psi_det - TOUCH psi_det psi_coef - endif - N_det = Nmin + (Nmax-Nmin)/2 - print *, '-----' - print *, 'Det min, Det max: ', Nmin, Nmax - print *, 'Ratio : ', ratio, ' ~ ', var_pt2_ratio - print *, 'N_det = ', N_det - print *, 'E = ', CI_energy(1) - call save_wavefunction - enddo - call ZMQ_selection(0, pt2) - print *, '------' - print *, 'HF_energy = ', HF_energy - print *, 'Est FCI = ', E_ref - print *, 'E = ', CI_energy(1) - print *, 'PT2 = ', pt2(1) - print *, 'E+PT2 = ', CI_energy(1)+pt2(1) - - E_CI_before(1:N_states) = CI_energy(1:N_states) - call save_wavefunction - call ezfio_set_full_ci_zmq_energy(CI_energy(1)) - call ezfio_set_full_ci_zmq_energy_pt2(E_CI_before(1)+pt2(1)) -end - - - - diff --git a/plugins/Full_CI_ZMQ/target_pt2_zmq.irp.f b/plugins/Full_CI_ZMQ/target_pt2_zmq.irp.f deleted file mode 100644 index 851190be..00000000 --- a/plugins/Full_CI_ZMQ/target_pt2_zmq.irp.f +++ /dev/null @@ -1,95 +0,0 @@ -program target_pt2 - implicit none - integer :: i,j,k - logical, external :: detEq - - double precision, allocatable :: pt2(:) - integer :: Nmin, Nmax - integer :: n_det_before, to_select - double precision :: threshold_davidson_in, ratio, E_ref, pt2_ratio - - allocate (pt2(N_states)) - - pt2 = 1.d0 - threshold_davidson_in = threshold_davidson - threshold_davidson = threshold_davidson_in * 100.d0 - SOFT_TOUCH threshold_davidson - - double precision :: E_CI_before(N_states) - do while (dabs(pt2(1)) > pt2_max) - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - do k=1, N_states - print*,'State ',k - print *, 'PT2 = ', pt2(k) - print *, 'E = ', CI_energy(k) - print *, 'E(before)+PT2 = ', E_CI_before(k)+pt2(k) - enddo - print *, '-----' - E_CI_before(1:N_states) = CI_energy(1:N_states) - call ezfio_set_full_ci_zmq_energy(CI_energy(1)) - - n_det_before = N_det - to_select = N_det - to_select = max(64-to_select, to_select) - call ZMQ_selection(to_select, pt2) - - PROVIDE psi_coef - PROVIDE psi_det - PROVIDE psi_det_sorted - - call diagonalize_CI - call save_wavefunction - call ezfio_set_full_ci_zmq_energy(CI_energy(1)) - enddo - - threshold_selectors = max(threshold_selectors,threshold_selectors_pt2) - threshold_generators = max(threshold_generators,threshold_generators_pt2) - threshold_davidson = threshold_davidson_in - TOUCH threshold_selectors threshold_generators threshold_davidson - call diagonalize_CI - call ZMQ_selection(0, pt2) - - E_ref = CI_energy(1) + pt2(1) - pt2_ratio = (E_ref + pt2_max - HF_energy) / (E_ref - HF_energy) - print *, 'Est FCI = ', E_ref - - Nmax = N_det - Nmin = N_det/8 - do while (Nmax-Nmin > 1) - call diagonalize_CI - ratio = (CI_energy(1) - HF_energy) / (E_ref - HF_energy) - psi_det = psi_det_sorted - psi_coef = psi_coef_sorted - TOUCH psi_coef psi_det - if (ratio < pt2_ratio) then - Nmin = N_det - to_select = (Nmax-Nmin)/2 - call ZMQ_selection(to_select, pt2) - else - Nmax = N_det - N_det = Nmin + (Nmax-Nmin)/2 - endif - print *, '-----' - print *, 'Det min, Det max: ', Nmin, Nmax - print *, 'Ratio : ', ratio, ' ~ ', pt2_ratio - print *, 'HF_energy = ', HF_energy - print *, 'Est FCI = ', E_ref - print *, 'N_det = ', N_det - print *, 'E = ', CI_energy(1) - print *, 'PT2 = ', pt2(1) - enddo - call ZMQ_selection(0, pt2) - print *, '------' - print *, 'E = ', CI_energy(1) - print *, 'PT2 = ', pt2(1) - - E_CI_before(1:N_states) = CI_energy(1:N_states) - call save_wavefunction - call ezfio_set_full_ci_zmq_energy(CI_energy(1)) - call ezfio_set_full_ci_zmq_energy_pt2(E_CI_before(1)+pt2(1)) -end - - - - diff --git a/plugins/Full_CI_ZMQ/tree_dependency.png b/plugins/Full_CI_ZMQ/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/Generators_CAS/tree_dependency.png b/plugins/Generators_CAS/tree_dependency.png deleted file mode 100644 index 749ec258..00000000 Binary files a/plugins/Generators_CAS/tree_dependency.png and /dev/null differ diff --git a/plugins/Generators_full/tree_dependency.png b/plugins/Generators_full/tree_dependency.png deleted file mode 100644 index eed76866..00000000 Binary files a/plugins/Generators_full/tree_dependency.png and /dev/null differ diff --git a/plugins/Generators_restart/tree_dependency.png b/plugins/Generators_restart/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/Hartree_Fock/Huckel_guess.irp.f b/plugins/Hartree_Fock/Huckel_guess.irp.f deleted file mode 100644 index ed264005..00000000 --- a/plugins/Hartree_Fock/Huckel_guess.irp.f +++ /dev/null @@ -1,6 +0,0 @@ -program guess - implicit none - character*(64) :: label - call huckel_guess - -end diff --git a/plugins/Hartree_Fock/SCF_old.irp.f b/plugins/Hartree_Fock/SCF_old.irp.f deleted file mode 100644 index 03d9a91d..00000000 --- a/plugins/Hartree_Fock/SCF_old.irp.f +++ /dev/null @@ -1,61 +0,0 @@ -program scf - BEGIN_DOC -! Produce `Hartree_Fock` MO orbital -! output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ -! output: hartree_fock.energy -! optional: mo_basis.mo_coef - END_DOC - call create_guess - call orthonormalize_mos - call run -end - -subroutine create_guess - implicit none - BEGIN_DOC -! Create a MO guess if no MOs are present in the EZFIO directory - END_DOC - logical :: exists - PROVIDE ezfio_filename - call ezfio_has_mo_basis_mo_coef(exists) - if (.not.exists) then - if (mo_guess_type == "HCore") then - mo_coef = ao_ortho_lowdin_coef - TOUCH mo_coef - mo_label = 'Guess' - call mo_as_eigvectors_of_mo_matrix(mo_mono_elec_integral,size(mo_mono_elec_integral,1),size(mo_mono_elec_integral,2),mo_label) - SOFT_TOUCH mo_coef mo_label - else if (mo_guess_type == "Huckel") then - call huckel_guess - else - print *, 'Unrecognized MO guess type : '//mo_guess_type - stop 1 - endif - endif -end - -subroutine run - - BEGIN_DOC -! Run SCF calculation - END_DOC - - use bitmasks - implicit none - - double precision :: SCF_energy_before,SCF_energy_after,diag_H_mat_elem - double precision :: EHF - integer :: i_it, i, j, k - - EHF = HF_energy - - mo_label = "Canonical" - -! Choose SCF algorithm - - call damping_SCF ! Deprecated routine -! call Roothaan_Hall_SCF - -end - - diff --git a/plugins/Hartree_Fock/localize_mos.irp.f b/plugins/Hartree_Fock/localize_mos.irp.f deleted file mode 100644 index 27c97ddb..00000000 --- a/plugins/Hartree_Fock/localize_mos.irp.f +++ /dev/null @@ -1,75 +0,0 @@ -program localize_mos - implicit none - integer :: rank, i,j,k - double precision, allocatable :: W(:,:) - double precision :: f, f_incr - - allocate (W(ao_num,ao_num)) - - W = 0.d0 - do k=1,elec_beta_num - do j=1,ao_num - do i=1,ao_num - W(i,j) = W(i,j) + mo_coef(i,k) * mo_coef(j,k) - enddo - enddo - enddo - -! call svd_mo(ao_num,elec_beta_num,W, size(W,1), & -! mo_coef(1,1),size(mo_coef,1)) - call cholesky_mo(ao_num,elec_beta_num,W, size(W,1), & - mo_coef(1,1),size(mo_coef,1),1.d-6,rank) - print *, rank - - if (elec_alpha_num>elec_beta_num) then - W = 0.d0 - do k=elec_beta_num+1,elec_alpha_num - do j=1,ao_num - do i=1,ao_num - W(i,j) = W(i,j) + mo_coef(i,k) * mo_coef(j,k) - enddo - enddo - enddo - -! call svd_mo(ao_num,elec_alpha_num-elec_beta_num,W, size(W,1), & -! mo_coef(1,1),size(mo_coef,1)) - call cholesky_mo(ao_num,elec_alpha_num-elec_beta_num,W, size(W,1), & - mo_coef(1,elec_beta_num+1),size(mo_coef,1),1.d-6,rank) - print *, rank - endif - - W = 0.d0 - do k=elec_alpha_num+1,mo_tot_num - do j=1,ao_num - do i=1,ao_num - W(i,j) = W(i,j) + mo_coef(i,k) * mo_coef(j,k) - enddo - enddo - enddo - -! call svd_mo(ao_num,mo_tot_num-elec_alpha_num,W, size(W,1), & -! mo_coef(1,1),size(mo_coef,1)) - call cholesky_mo(ao_num,mo_tot_num-elec_alpha_num,W, size(W,1), & - mo_coef(1,elec_alpha_num+1),size(mo_coef,1),1.d-6,rank) - print *, rank - mo_label = "Localized" - - TOUCH mo_coef - - W(1:ao_num,1:mo_tot_num) = mo_coef(1:ao_num,1:mo_tot_num) - integer :: iorder(mo_tot_num) - double precision :: s(mo_tot_num), swap(ao_num) - do k=1,mo_tot_num - iorder(k) = k - s(k) = Fock_matrix_diag_mo(k) - enddo - call dsort(s(1),iorder(1),elec_beta_num) - call dsort(s(elec_beta_num+1),iorder(elec_beta_num+1),elec_alpha_num-elec_beta_num) - call dsort(s(elec_alpha_num+1),iorder(elec_alpha_num+1),mo_tot_num-elec_alpha_num) - do k=1,mo_tot_num - mo_coef(1:ao_num,k) = W(1:ao_num,iorder(k)) - print *, k, s(k) - enddo - call save_mos - -end diff --git a/plugins/Hartree_Fock/tree_dependency.png b/plugins/Hartree_Fock/tree_dependency.png deleted file mode 100644 index 67de2eee..00000000 Binary files a/plugins/Hartree_Fock/tree_dependency.png and /dev/null differ diff --git a/plugins/Hartree_Fock_SlaterDressed/EZFIO.cfg b/plugins/Hartree_Fock_SlaterDressed/EZFIO.cfg deleted file mode 100644 index df55c554..00000000 --- a/plugins/Hartree_Fock_SlaterDressed/EZFIO.cfg +++ /dev/null @@ -1,26 +0,0 @@ -[slater_expo_ezfio] -type: double precision -doc: Exponents of the additional Slater functions -size: (nuclei.nucl_num) -interface: ezfio, provider - -[slater_coef_ezfio] -type: double precision -doc: Exponents of the additional Slater functions -size: (nuclei.nucl_num,mo_basis.mo_tot_num) -interface: ezfio, provider - -[projector] -type: double precision -doc: Orthogonal AO basis -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio - -[ao_orthoSlaOverlap] -type: double precision -doc: Orthogonal AO basis -size: (ao_basis.ao_num,nuclei.nucl_num) -interface: ezfio - - - diff --git a/plugins/Hartree_Fock_SlaterDressed/LinearSystem.irp.f b/plugins/Hartree_Fock_SlaterDressed/LinearSystem.irp.f deleted file mode 100644 index 61a5a49c..00000000 --- a/plugins/Hartree_Fock_SlaterDressed/LinearSystem.irp.f +++ /dev/null @@ -1,63 +0,0 @@ -BEGIN_PROVIDER [ double precision, cusp_A, (nucl_num, nucl_num) ] - implicit none - BEGIN_DOC - ! Equations to solve : A.X = B - END_DOC - - integer :: mu, A, B - - cusp_A = 0.d0 - do A=1,nucl_num - cusp_A(A,A) = slater_expo(A)/nucl_charge(A) * slater_value_at_nucl(A,A) - do B=1,nucl_num - cusp_A(A,B) -= slater_value_at_nucl(B,A) - ! Projector - do mu=1,mo_tot_num - cusp_A(A,B) += AO_orthoSlaOverlap_matrix(mu,B) * ao_ortho_value_at_nucl(mu,A) - enddo - enddo - enddo -END_PROVIDER - -BEGIN_PROVIDER [ double precision, cusp_B, (nucl_num, mo_tot_num) ] - implicit none - BEGIN_DOC - ! Equations to solve : A.C = B - END_DOC - - integer :: i, A, info - - do i=1,mo_tot_num - do A=1,nucl_num - cusp_B(A,i) = mo_value_at_nucl(i,A) - enddo - enddo -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, cusp_C, (nucl_num, mo_tot_num) ] - implicit none - BEGIN_DOC - ! Equations to solve : A.C = B - END_DOC - - integer :: info - integer :: ipiv(nucl_num) - double precision, allocatable :: AF(:,:) - allocate ( AF(nucl_num,nucl_num) ) - - cusp_C(1:nucl_num,1:mo_tot_num) = cusp_B(1:nucl_num,1:mo_tot_num) - AF(1:nucl_num,1:nucl_num) = cusp_A(1:nucl_num,1:nucl_num) - call dgetrf(nucl_num,nucl_num,AF,size(AF,1),ipiv,info) - if (info /= 0) then - print *, info - stop 'dgetrf failed' - endif - call dgetrs('N',nucl_num,mo_tot_num,AF,size(AF,1),ipiv,cusp_C,size(cusp_C,1),info) - if (info /= 0) then - print *, info - stop 'dgetrs failed' - endif - -END_PROVIDER - diff --git a/plugins/Hartree_Fock_SlaterDressed/SCF_dressed.irp.f b/plugins/Hartree_Fock_SlaterDressed/SCF_dressed.irp.f deleted file mode 100644 index 8befdb91..00000000 --- a/plugins/Hartree_Fock_SlaterDressed/SCF_dressed.irp.f +++ /dev/null @@ -1,105 +0,0 @@ -program scf - BEGIN_DOC -! Produce `Hartree_Fock` MO orbital with Slater cusp dressing -! output: mo_basis.mo_tot_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ -! output: hartree_fock.energy -! optional: mo_basis.mo_coef - END_DOC - call check_mos - call debug - call run -end - -subroutine check_mos - implicit none - BEGIN_DOC -! Create a MO guess if no MOs are present in the EZFIO directory - END_DOC - logical :: exists - PROVIDE ezfio_filename - call ezfio_has_mo_basis_mo_coef(exists) - if (.not.exists) then - print *, 'Please run SCF first' - stop - endif -end - -subroutine debug - implicit none - integer :: i,j,k - print *, 'A' - do i=1,nucl_num - print *, i, cusp_A(1:nucl_num, i) - enddo - print *, 'B' - do i=1,mo_tot_num - print *, i, cusp_B(1:nucl_num, i) - enddo - print *, 'X' - do i=1,mo_tot_num - print *, i, cusp_C(1:nucl_num, i) - enddo - print *, '-----' - return - do k=-100,100 - double precision :: x, y, z - x = 0.01d0 * k - y = 0.d0 - do i=1,ao_num - z = 0.d0 - do j=1,ao_prim_num(i) - z += ao_coef_normalized_ordered_transp(j,i) * dexp(-ao_expo_ordered_transp(j,i) * x**2) - enddo - y += mo_coef(i,1) * z - y += exp(-slater_expo(1)*dabs(x)) * slater_coef(1,1) - z = 0.d0 - do j=1,ao_prim_num(i) - z += ao_coef_normalized_ordered_transp(j,i) * dexp(-ao_expo_ordered_transp(j,i) * x**2) - enddo - y -= z * GauSlaOverlap_matrix(i,1)* slater_coef(1,1) - enddo - print *, x, y - enddo - print *, '-----' -end - -subroutine run - - BEGIN_DOC -! Run SCF calculation - END_DOC - - use bitmasks - implicit none - - double precision :: SCF_energy_before,SCF_energy_after,diag_H_mat_elem - double precision :: EHF - integer :: i_it, i, j, k - - mo_label = 'None' - - -! print *, HF_energy - - do i=1,ao_num - print *, mo_coef(i,1), cusp_corrected_mos(i,1) - enddo - mo_coef(1:ao_num,1:mo_tot_num) = cusp_corrected_mos(1:ao_num,1:mo_tot_num) - SOFT_TOUCH mo_coef slater_coef - call ezfio_set_Hartree_Fock_SlaterDressed_slater_coef_ezfio(slater_coef) - call ezfio_set_Hartree_Fock_SlaterDressed_projector(ao_ortho_canonical_coef(1:ao_num,1:ao_num)) - call ezfio_set_Hartree_Fock_SlaterDressed_ao_orthoSlaOverlap(AO_orthoSlaOverlap_matrix) - call save_mos - print *, 'ci' - print *, mo_coef(1:ao_num,1) - print *, 'cAi' - print *, slater_coef - - -! EHF = HF_energy -! print *, HF_energy -! call Roothaan_Hall_SCF - -end - - diff --git a/plugins/Hartree_Fock_SlaterDressed/at_nucl.irp.f b/plugins/Hartree_Fock_SlaterDressed/at_nucl.irp.f deleted file mode 100644 index 8dc8ede2..00000000 --- a/plugins/Hartree_Fock_SlaterDressed/at_nucl.irp.f +++ /dev/null @@ -1,74 +0,0 @@ -BEGIN_PROVIDER [ double precision , ao_value_at_nucl, (ao_num,nucl_num) ] - implicit none - BEGIN_DOC -! Values of the atomic orbitals at the nucleus - END_DOC - integer :: i,j,k - double precision :: x,y,z,expo,poly, r2 - - do k=1,nucl_num - do i=1,ao_num - ao_value_at_nucl(i,k) = 0.d0 - x = nucl_coord(ao_nucl(i),1) - nucl_coord(k,1) - y = nucl_coord(ao_nucl(i),2) - nucl_coord(k,2) - z = nucl_coord(ao_nucl(i),3) - nucl_coord(k,3) - poly = x**(ao_power(i,1)) * y**(ao_power(i,2)) * z**(ao_power(i,3)) - if (poly == 0.d0) cycle - - r2 = (x*x) + (y*y) + (z*z) - do j=1,ao_prim_num(i) - expo = ao_expo_ordered_transp(j,i)*r2 - if (expo > 40.d0) cycle - ao_value_at_nucl(i,k) = ao_value_at_nucl(i,k) + & - ao_coef_normalized_ordered_transp(j,i) * & - dexp(-expo) - enddo - ao_value_at_nucl(i,k) *= poly - enddo - enddo -END_PROVIDER - -BEGIN_PROVIDER [ double precision, ao_ortho_value_at_nucl, (ao_num,nucl_num) ] - implicit none - BEGIN_DOC -! Values of the molecular orbitals at the nucleus - END_DOC - - call dgemm('T','N',ao_num,nucl_num,ao_num,1.d0, & - ao_ortho_canonical_coef, size(ao_ortho_canonical_coef,1), & - ao_value_at_nucl, size(ao_value_at_nucl,1), & - 0.d0, ao_ortho_value_at_nucl,size(ao_ortho_value_at_nucl,1)) -END_PROVIDER - -BEGIN_PROVIDER [ double precision, mo_value_at_nucl, (mo_tot_num,nucl_num) ] - implicit none - BEGIN_DOC -! Values of the molecular orbitals at the nucleus - END_DOC - - call dgemm('T','N',mo_tot_num,nucl_num,ao_num,1.d0, & - mo_coef, size(mo_coef,1), & - ao_value_at_nucl, size(ao_value_at_nucl,1), & - 0.d0, mo_value_at_nucl, size(mo_value_at_nucl,1)) -END_PROVIDER - - -BEGIN_PROVIDER [ double precision , slater_value_at_nucl, (nucl_num,nucl_num) ] - implicit none - BEGIN_DOC -! Values of the Slater orbitals (1) at the nucleus (2) - END_DOC - integer :: i,j,k - double precision :: x,y,z,expo,poly, r - - do k=1,nucl_num - do i=1,nucl_num - x = nucl_coord(i,1) - nucl_coord(k,1) - y = nucl_coord(i,2) - nucl_coord(k,2) - z = nucl_coord(i,3) - nucl_coord(k,3) - expo = slater_expo(i) * dsqrt((x*x) + (y*y) + (z*z)) - slater_value_at_nucl(i,k) = dexp(-expo) * slater_normalization(i) - enddo - enddo -END_PROVIDER - diff --git a/plugins/Hartree_Fock_SlaterDressed/dressing.irp.f b/plugins/Hartree_Fock_SlaterDressed/dressing.irp.f deleted file mode 100644 index 5426badb..00000000 --- a/plugins/Hartree_Fock_SlaterDressed/dressing.irp.f +++ /dev/null @@ -1,172 +0,0 @@ -BEGIN_PROVIDER [ double precision, ao_ortho_mono_elec_integral_dressing, (ao_num,ao_num) ] - implicit none - BEGIN_DOC - ! Dressing of the core hamiltonian in the orthogonal AO basis set - END_DOC - - integer :: i,j,k - integer :: mu, nu, lambda, A - double precision :: tmp - - ao_ortho_mono_elec_integral_dressing = 0.d0 - i = idx_dressing - do mu=1,ao_num - if (dabs(mo_coef_in_ao_ortho_basis(mu,i)) > 1.d-5) then - do A=1,nucl_num - tmp = 0.d0 - do nu=1,ao_num - tmp += AO_orthoSlaOverlap_matrix(nu,A) * ao_ortho_mono_elec_integral(mu,nu) - enddo - ao_ortho_mono_elec_integral_dressing(mu,mu) += cusp_C(A,i) * (AO_orthoSlaH_matrix(mu,A) - tmp) - enddo - ao_ortho_mono_elec_integral_dressing(mu,mu) *= 1.d0/mo_coef_in_ao_ortho_basis(mu,i) - endif - enddo -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, ao_ortho_mono_elec_integral, (ao_num, ao_num) ] - implicit none - BEGIN_DOC - ! h core in orthogonal AO basis - END_DOC - double precision, allocatable :: T(:,:) - allocate(T(ao_num,ao_num)) - call dgemm('T','N',ao_num,ao_num,ao_num,1.d0, & - ao_ortho_canonical_coef, size(ao_ortho_canonical_coef,1), & - ao_mono_elec_integral, size(ao_mono_elec_integral,1), & - 0.d0, T, size(T,1)) - call dgemm('N','N',ao_num,ao_num,ao_num,1.d0, & - T, size(T,1), & - ao_ortho_canonical_coef, size(ao_ortho_canonical_coef,1), & - 0.d0, ao_ortho_mono_elec_integral, size(ao_ortho_mono_elec_integral,1)) - deallocate(T) -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, ao_mono_elec_integral_dressing, (ao_num,ao_num) ] - implicit none - BEGIN_DOC - ! Dressing of the core hamiltonian in the AO basis set - END_DOC - call ao_ortho_cano_to_ao(ao_ortho_mono_elec_integral_dressing,size(ao_ortho_mono_elec_integral_dressing,1),& - ao_mono_elec_integral_dressing,size(ao_mono_elec_integral_dressing,1)) -END_PROVIDER - -BEGIN_PROVIDER [ double precision, mo_mono_elec_integral_dressing, (mo_tot_num,mo_tot_num) ] - implicit none - BEGIN_DOC - ! Dressing of the core hamiltonian in the MO basis set - END_DOC - - call ao_to_mo(ao_mono_elec_integral_dressing,size(ao_mono_elec_integral_dressing,1),& - mo_mono_elec_integral_dressing,size(mo_mono_elec_integral_dressing,1)) -END_PROVIDER - - -BEGIN_PROVIDER [ integer, idx_dressing ] - implicit none - BEGIN_DOC - ! Index of the MO which is being dressed - END_DOC - idx_dressing = 1 -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, cusp_corrected_mos, (ao_num,mo_tot_num) ] - implicit none - BEGIN_DOC - ! Dressing core hamiltonian in the AO basis set - END_DOC - integer :: i,j - double precision, allocatable :: F(:,:), M(:,:) - allocate(F(mo_tot_num,mo_tot_num),M(ao_num,mo_tot_num)) - - logical :: oneshot - -! oneshot = .True. - oneshot = .False. - - if (oneshot) then - cusp_corrected_mos(1:ao_num,1:mo_tot_num) = mo_coef(1:ao_num,1:mo_tot_num) - slater_coef(1:nucl_num,1:mo_tot_num) = cusp_C(1:nucl_num,1:mo_tot_num) - return - - else - - - do idx_dressing=1,mo_tot_num - - if (idx_dressing>1) then - TOUCH idx_dressing - endif - - do j=1,mo_tot_num - do i=1,mo_tot_num - F(i,j) = Fock_matrix_mo(i,j) - enddo - enddo - - do j=1,mo_tot_num - do i=1,ao_num - M(i,j) = mo_coef(i,j) - enddo - enddo - - integer :: it - do it=1,128 - - ! print *, 'X', ao_ortho_canonical_coef(1:ao_num,1:ao_num) - ! print *, 'C', mo_coef(1:ao_num,1:mo_tot_num) - ! print *, 'Cp', mo_coef_in_ao_ortho_basis(1:ao_num,1:mo_tot_num) - ! print *, 'cAi', cusp_C(1:nucl_num,1:mo_tot_num) - ! print *, 'FmuA', AO_orthoSlaH_matrix(1:ao_num,1:nucl_num) - ! print *, 'Fock:', Fock_matrix_ao(1:ao_num,1:ao_num) - ! print *, 'Diag Dressing:', ao_ortho_mono_elec_integral_dressing(1:ao_num,1:ao_num) - ! print *, 'Dressing:', ao_mono_elec_integral_dressing(1:ao_num,1:ao_num) - ! print *, 'Dressed Fock:', Fock_matrix_ao(1:ao_num,1:ao_num) + ao_mono_elec_integral_dressing(1:ao_num,1:ao_num) - ! print *, 'AO_orthoSlaOverlap_matrix', AO_orthoSlaOverlap_matrix(1:ao_num,1:nucl_num) - ! print *, 'AO_orthoSlaH_matrix', AO_orthoSlaH_matrix(1:ao_num,1:nucl_num) - ! print *, 'ao_ortho_mono_elec_integral', ao_ortho_mono_elec_integral(1:ao_num,1:ao_num) - ! print *, 'Fock MO:', Fock_matrix_mo(1:mo_tot_num,1:mo_tot_num) - do j=1,mo_tot_num - do i=1,mo_tot_num - Fock_matrix_mo(i,j) += mo_mono_elec_integral_dressing(i,j) - enddo - enddo - do i=1,mo_tot_num - Fock_matrix_diag_mo(i) = Fock_matrix_mo(i,i) - enddo - ! print *, 'Dressed Fock MO:', Fock_matrix_mo(1:mo_tot_num,1:mo_tot_num) - double precision :: conv - conv = 0.d0 - do j=1,mo_tot_num - do i=1,mo_tot_num - if (i==j) cycle - conv = max(conv,Fock_matrix_mo(i,j)) - enddo - enddo - TOUCH Fock_matrix_mo Fock_matrix_diag_mo - - mo_coef(1:ao_num,1:mo_tot_num) = eigenvectors_fock_matrix_mo(1:ao_num,1:mo_tot_num) - TOUCH mo_coef - !print *, 'C', mo_coef(1:ao_num,1:mo_tot_num) - !print *, '-----' - print *, idx_dressing, it, real(mo_coef(1,idx_dressing)), real(conv) - if (conv < 1.d-5) exit - !stop - - enddo - cusp_corrected_mos(1:ao_num,idx_dressing) = mo_coef(1:ao_num,idx_dressing) - slater_coef(1:nucl_num,idx_dressing) = cusp_C(1:nucl_num,idx_dressing) - enddo - - idx_dressing = 1 - mo_coef(1:ao_num,1:mo_tot_num) = M(1:ao_num,1:mo_tot_num) - soft_TOUCH mo_coef idx_dressing slater_coef - - endif - -END_PROVIDER - - diff --git a/plugins/Hartree_Fock_SlaterDressed/integrals.irp.f b/plugins/Hartree_Fock_SlaterDressed/integrals.irp.f deleted file mode 100644 index 0deaa09b..00000000 --- a/plugins/Hartree_Fock_SlaterDressed/integrals.irp.f +++ /dev/null @@ -1,625 +0,0 @@ -!***************************************************************************** -subroutine GauSlaOverlap(expGau,cGau,aGau,expSla,cSla,result) - implicit none - - BEGIN_DOC - ! Compute the overlap integral between a Gaussian function - ! with arbitrary angular momemtum and a s-type Slater function - END_DOC - -! Input variables - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - double precision,intent(out) :: result - -! Final value of the integrals - double precision :: ss,ps,ds - double precision :: pxs,pys,pzs - double precision :: dxxs,dyys,dzzs,dxys,dxzs,dyzs - - double precision :: pi,E,AB,AxBx,AyBy,AzBz,t,u,k - - pi = 4d0*atan(1d0) - -! calculate the length AB between the two centers and other usful quantities - - AB = (cGau(1)-cSla(1))**2 + (cGau(2)-cSla(2))**2 + (cGau(3)-cSla(3))**2 - AB = dsqrt(AB) - - AxBx = (cGau(1)-cSla(1))/2d0 - AyBy = (cGau(2)-cSla(2))/2d0 - AzBz = (cGau(3)-cSla(3))/2d0 - ds = 0.d0 - -! intermediate variables - - t = expSla*dsqrt(0.25d0/expGau) - u = dsqrt(expGau)*AB - - double precision :: d, et2 - if(AB > 0d0) then - -! (s|s) - ss = 0.d0 - - d = derfc(t+u) - if (dabs(d) > 1.d-30) then - ss = (t+u)*d*dexp(2d0*t*(t+u)) - endif - - d = derfc(t-u) - if (dabs(d) > 1.d-30) then - ss -= (t-u)*d*dexp(2d0*t*(t-u)) - endif - -! (p|s) - ps = 0.d0 - if (t*t-u*u > 300.d0) then - et2 = huge(1.0) - else - et2 = dexp(t*t-u*u) - endif - if (et2 /= 0.d0) then - d = derfc(t-u) - if (d /= 0.d0) then - ps += dexp((t-u)**2)*(1d0+2d0*t*(t-u))*d - endif - d = derfc(t+u) - if (d /= 0.d0) then - ps += dexp((t+u)**2)*(1d0+2d0*t*(t+u))*d - endif - ps *= dsqrt(pi) - ps -= 4d0*t - ps *= et2/dsqrt(pi) - endif - -! (d|s) -! ds = 4d0*dexp(2d0*t*(t-u))*t*(-((1d0+t**2-t*u)*derfc(t-u))+dexp(4d0*t*u)*(1d0+t*(t+u))*derfc(t+u)) - ds = 0.d0 - d = derfc(t+u) - if (d /= 0.d0) then - ds = dexp(4d0*t*u)*(1d0+t*(t+u))*d - endif - d = derfc(t-u) - if (d /= 0.d0) then - ds -= (1d0+t*t-t*u)*d - endif - - if ( dabs(ds) > 1.d-100) then - ds *= 4d0*dexp(2d0*t*(t-u))*t - endif - -! backward scaling - ds = 3d0*ss/u**5d0 - 3d0*ps/u**4d0 + ds/u**3d0 - ps = ps/u**2-ss/u**3d0 - ss = ss/u - - else - -! concentric case - d = derfc(t) - if (d /= 0.d0) then - et2 = dexp(t*t) - ss = 2d0*et2*((-2d0*t)/dsqrt(pi)+et2*(1d0+2d0*t*t)*d) - ps = (8d0*et2*t*(-2d0*(1d0+t*t)+et2*dsqrt(pi)*t*(3d0+2d0*t*t)*d))/(3d0*dsqrt(pi)) - else - ss = 0.d0 - ps = 0.d0 - endif - - endif - - k = t**3d0*dexp(-t*t)*4d0*pi/expSla**(3d0/2d0) - -! (s|s) - ss = k*ss - -! (p|s) - ps = k*ps - - pxs = AxBx*ps - pys = AyBy*ps - pzs = AzBz*ps - -! (d|s) - ds = k*ds - - dxxs = (2d0*ss+ps)/(4d0*expGau) + AxBx**2*ds - dyys = (2d0*ss+ps)/(4d0*expGau) + AyBy**2*ds - dzzs = (2d0*ss+ps)/(4d0*expGau) + AzBz**2*ds - - dxys = AxBx*AyBy*ds - dxzs = AxBx*AzBz*ds - dyzs = AyBy*AzBz*ds - - select case (sum(aGau)) - case (0) - result = ss - - case (1) - if (aGau(1) == 1) then - result = pxs - else if (aGau(2) == 1) then - result = pys - else if (aGau(3) == 1) then - result = pzs - endif - - case (2) - if (aGau(1) == 2) then - result = dxxs - else if (aGau(2) == 2) then - result = dyys - else if (aGau(3) == 2) then - result = dzzs - else if (aGau(1)+aGau(2) == 2) then - result = dxys - else if (aGau(1)+aGau(3) == 2) then - result = dxzs - else if (aGau(2)+aGau(3) == 2) then - result = dyzs - endif - - case default - stop 'GauSlaOverlap not implemented' - - end select - -end -!***************************************************************************** - -!***************************************************************************** -subroutine GauSlaKinetic(expGau,cGau,aGau,expSla,cSla,result) - - implicit none - - BEGIN_DOC - ! Compute the kinetic energy integral between a Gaussian function - ! with arbitrary angular momemtum and a s-type Slater function - END_DOC - -! Input variables - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - double precision,intent(out) :: result - -! Final value of the integrals - double precision :: ss,ps,ds - double precision :: pxs,pys,pzs - double precision :: dxxs,dyys,dzzs,dxys,dxzs,dyzs - - double precision :: pi,E,AB,AxBx,AyBy,AzBz,t,u,k - - pi = 4d0*atan(1d0) - -! calculate the length AB between the two centers - - AB = (cGau(1)-cSla(1))**2 + (cGau(2)-cSla(2))**2 + (cGau(3)-cSla(3))**2 - AB = dsqrt(AB) - - AxBx = (cGau(1)-cSla(1))/2d0 - AyBy = (cGau(2)-cSla(2))/2d0 - AzBz = (cGau(3)-cSla(3))/2d0 - -! intermediate variables - - t = expSla*dsqrt(0.25d0/expGau) - u = dsqrt(expGau)*AB - - if(AB > 0d0) then - -! (s|s) - ss = (1d0+t*(t-u))*derfc(t-u)*dexp(2d0*t*(t-u)) - (1d0+t*(t+u))*derfc(t+u)*dexp(2d0*t*(t+u)) - -! (p|s) - ps = (dexp(t**2-2d0*t*u-u**2)*(4d0*dexp(2d0*t*u)*(1d0+t**2) & - + dsqrt(pi)*t*(-(dexp(t**2+u**2)*(3d0+2d0*t*(t-u))*derfc(t-u)) & - - dexp(2d0*t*u+(t+u)**2)*(3d0+2d0*t*(t+u))*derfc(t+u))))/dsqrt(pi) - -! (d|s) - ds = (-8d0*dexp(t**2-u**2)*u+4d0*dexp(2d0*t*(t-u))*dsqrt(pi)*t**2*((2d0+t**2-t*u)*derfc(t-u) & - - dexp(4d0*t*u)*(2d0+t*(t+u))*derfc(t+u)))/dsqrt(pi) - -! backward scaling - ds = 3d0*ss/u**5d0 - 3d0*ps/u**4d0 + ds/u**3d0 - ps = ps/u**2-ss/u**3d0 - ss = ss/u - - else - -! concentric case - ss = (4d0*dexp(t**2)*(1d0+t**2))/dsqrt(pi)-2d0*dexp(2d0*t**2)*t*(3d0+2d0*t**2)*derfc(t) - ps = (8d0*dexp(t**2)*(-1d0+4d0*t**2+2d0*t**4d0-dexp(t**2)*dsqrt(pi)*t**3d0*(5d0+2d0*t**2)*derfc(t)))/(3d0*dsqrt(pi)) - - endif - - k = expSla*dsqrt(expGau)*t**3d0*dexp(-t*t)*4d0*pi/expSla**(3d0/2d0) - -! (s|s) - ss = k*ss - -! (p|s) - ps = k*ps - - pxs = AxBx*ps - pys = AyBy*ps - pzs = AzBz*ps - -! (d|s) - ds = k*ds - - dxxs = (2d0*ss+ps)/(4d0*expGau) + AxBx**2*ds - dyys = (2d0*ss+ps)/(4d0*expGau) + AyBy**2*ds - dzzs = (2d0*ss+ps)/(4d0*expGau) + AzBz**2*ds - - dxys = AxBx*AyBy*ds - dxzs = AxBx*AzBz*ds - dyzs = AyBy*AzBz*ds - - select case (sum(aGau)) - case (0) - result = ss - - case (1) - if (aGau(1) == 1) then - result = pxs - else if (aGau(2) == 1) then - result = pys - else if (aGau(3) == 1) then - result = pzs - endif - - case (2) - if (aGau(1) == 2) then - result = dxxs - else if (aGau(2) == 2) then - result = dyys - else if (aGau(3) == 2) then - result = dzzs - else if (aGau(1)+aGau(2) == 2) then - result = dxys - else if (aGau(1)+aGau(3) == 2) then - result = dxzs - else if (aGau(2)+aGau(3) == 2) then - result = dyzs - endif - - case default - stop 'GauSlaOverlap not implemented' - - end select - -end -!***************************************************************************** - - - -!***************************************************************************** -subroutine GauSlaNuclear(expGau,cGau,aGau,expSla,cSla,ZNuc,cNuc,result) - - implicit none - - BEGIN_DOC - ! Compute the nuclear attraction integral between a Gaussian function - ! with arbitrary angular momemtum and a s-type Slater function - END_DOC - -! Input variables - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - double precision,intent(in) :: cNuc(3) - double precision,intent(in) :: ZNuc - double precision,intent(out) :: result - -! Final value of the overlap integral - double precision :: ss,ps,ds,fs - double precision :: pxs,pys,pzs - - double precision :: pi,E,AB,x,y,k - - pi = 4d0*atan(1d0) - E = exp(1d0) - -! calculate the length AB between the two centers - - AB = (cGau(1)-cSla(1))**2 + (cGau(2)-cSla(2))**2 + (cGau(3)-cSla(3))**2 - AB = dsqrt(AB) - -! intermediate variables - - x = dsqrt(expSla**2/(4d0*expGau)) - y = dsqrt(expGau)*AB - - if(AB > 0d0) then - ss = (1d0+x*(x+y))*derfc(x+y)*dexp(2d0*x*(x+y)) - (1d0+x*(x-y))*derfc(x-y)*dexp(2d0*x*(x-y)) - ss = ss/y - else - ss = (4d0*E**x**2*(1d0+x**2))/dsqrt(Pi)-2d0*E**(2d0*x**2)*x*(3d0+2d0*x**2)*dErfc(x) - endif - - k = expSla*dsqrt(expGau)*x**3d0*dexp(-x*x)*4d0*pi/expSla**(3d0/2d0) - ss = k*ss - -! Print result -! write(*,*) ss - result = 0.d0 - -end -!***************************************************************************** - -double precision function BoysF0(t) - implicit none - double precision, intent(in) :: t - double precision :: pi - - pi = 4d0*atan(1d0) - - if(t > 0d0) then - BoysF0 = 0.5d0*dsqrt(pi/t)*derf(dsqrt(t)) - else - BoysF0 = 1d0 - endif - -end -!***************************************************************************** - -!TODO -subroutine GauSlaOverlap_write(expGau,cGau,aGau,expSla,cSla,result,iunit) - implicit none - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - integer,intent(in) :: iunit - double precision,intent(out) :: result - write(iunit, *) & - 'SDrSla[ {',expGau,',{',cGau(1),',',cGau(2),',',cGau(3),'},{',aGau(1),',',aGau(2),',',aGau(3),'} },{', expSla,', {',cSla(1),',',cSla(2),',',cSla(3),'} } ],' - result = 0.d0 -end - -subroutine GauSlaOverlap_read(expGau,cGau,aGau,expSla,cSla,result,iunit) - implicit none - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - integer,intent(in) :: iunit - double precision,intent(out) :: result - read(iunit, *) result -end - -subroutine GauSlaKinetic_write(expGau,cGau,aGau,expSla,cSla,result,iunit) - implicit none - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - integer,intent(in) :: iunit - double precision,intent(out) :: result - write(iunit, *) & - 'TDrSla[ {',expGau,',{',cGau(1),',',cGau(2),',',cGau(3),'},{',aGau(1),',',aGau(2),',',aGau(3),'} },{', expSla,',{',cSla(1),',',cSla(2),',',cSla(3),'} } ],' - result = 0.d0 -end - -subroutine GauSlaKinetic_read(expGau,cGau,aGau,expSla,cSla,result,iunit) - implicit none - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - integer,intent(in) :: iunit - double precision,intent(out) :: result - read(iunit, *) result -end - -subroutine GauSlaNuclear_write(expGau,cGau,aGau,expSla,cSla,ZNuc,cNuc,result,iunit) - implicit none - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - double precision,intent(in) :: cNuc(3) - double precision,intent(in) :: ZNuc - integer,intent(in) :: iunit - double precision,intent(out) :: result - write(iunit, *) & - 'VDrSla[ {',expGau,',{',cGau(1),',',cGau(2),',',cGau(3),'},{',aGau(1),',',aGau(2),',',aGau(3),'} },{ ', expSla,',{',cSla(1),',',cSla(2),',',cSla(3),'} }, {', ZNuc, ',{', cNuc(1),',', cNuc(2),',', cNuc(3), '} } ],' - result = 0.d0 -end - -subroutine GauSlaNuclear_read(expGau,cGau,aGau,expSla,cSla,ZNuc,cNuc,result,iunit) - implicit none - double precision,intent(in) :: expGau,expSla - double precision,intent(in) :: cGau(3),cSla(3) - integer,intent(in) :: aGau(3) - double precision,intent(in) :: cNuc(3) - double precision,intent(in) :: ZNuc - integer,intent(in) :: iunit - double precision,intent(out) :: result - read(iunit, *) result -end -!TODO - -BEGIN_TEMPLATE - -BEGIN_PROVIDER [ double precision, GauSla$X_matrix, (ao_num, nucl_num) ] - implicit none - BEGIN_DOC - ! overlap matrix - END_DOC - integer :: i,j,k - double precision :: cGau(3) - double precision :: cSla(3) - double precision :: expSla, res, expGau - integer :: aGau(3) - -!TODO -! logical :: read -! integer :: iunit -! integer :: getunitandopen -! -! inquire(FILE=trim(ezfio_filename)//'/work/GauSla$X.dat',EXIST=read) -! if (read) then -! print *, 'READ $X' -! iunit = getunitandopen(trim(ezfio_filename)//'/work/GauSla$X.dat','r') -! else -! print *, 'WRITE $X' -! iunit = getunitandopen(trim(ezfio_filename)//'/work/GauSla$X.inp','w') -! write(iunit,*) '{' -! endif -!TODO - - do k=1,nucl_num - cSla(1:3) = nucl_coord_transp(1:3,k) - expSla = slater_expo(k) - - do i=1,ao_num - cGau(1:3) = nucl_coord_transp(1:3, ao_nucl(i)) - aGau(1:3) = ao_power(i,1:3) - GauSla$X_matrix(i,k) = 0.d0 - - do j=1,ao_prim_num(i) - expGau = ao_expo_ordered_transp(j,i) - call GauSla$X(expGau,cGau,aGau,expSla,cSla,res) -! if (read) then -! call GauSla$X_read(expGau,cGau,aGau,expSla,cSla,res,iunit) -! else -! call GauSla$X_write(expGau,cGau,aGau,expSla,cSla,res,iunit) -! endif - GauSla$X_matrix(i,k) += ao_coef_normalized_ordered_transp(j,i) * res - enddo - - enddo - - enddo -! if (.not.read) then -! write(iunit,*) '0.}' -! endif -! close(iunit) - -END_PROVIDER - -BEGIN_PROVIDER [ double precision, MOSla$X_matrix, (mo_tot_num, nucl_num) ] - implicit none - BEGIN_DOC -! - END_DOC - call dgemm('T','N',mo_tot_num,nucl_num,ao_num,1.d0, & - mo_coef, size(mo_coef,1), & - GauSla$X_matrix, size(GauSla$X_matrix,1), & - 0.d0, MOSla$X_matrix, size(MOSla$X_matrix,1)) -END_PROVIDER - -BEGIN_PROVIDER [ double precision, AO_orthoSla$X_matrix, (ao_num, nucl_num) ] - implicit none - BEGIN_DOC - ! - END_DOC - call dgemm('T','N',ao_num,nucl_num,ao_num,1.d0, & - ao_ortho_canonical_coef, size(ao_ortho_canonical_coef,1), & - GauSla$X_matrix, size(GauSla$X_matrix,1), & - 0.d0, AO_orthoSla$X_matrix, size(AO_orthoSla$X_matrix,1)) - -END_PROVIDER - - -SUBST [ X ] - -Overlap ;; -Kinetic ;; - -END_TEMPLATE - -BEGIN_PROVIDER [ double precision, GauSlaNuclear_matrix, (ao_num, nucl_num) ] - implicit none - BEGIN_DOC - ! overlap matrix - END_DOC - integer :: i,j,k,A - double precision :: cGau(3) - double precision :: cSla(3) - double precision :: expSla, res, expGau, Znuc, cNuc(3) - integer :: aGau(3) - -!TODO - logical :: read - integer :: iunit - integer :: getunitandopen - - inquire(FILE=trim(ezfio_filename)//'/work/GauSlaNuclear.dat',EXIST=read) - if (read) then - print *, 'READ Nuclear' - iunit = getunitandopen(trim(ezfio_filename)//'/work/GauSlaNuclear.dat','r') - else - print *, 'WRITE Nuclear' - iunit = getunitandopen(trim(ezfio_filename)//'/work/GauSlaNuclear.inp','w') - write(iunit,*)'{' - endif -!TODO - - do k=1,nucl_num - cSla(1:3) = nucl_coord_transp(1:3,k) - expSla = slater_expo(k) - - do i=1,ao_num - cGau(1:3) = nucl_coord_transp(1:3, ao_nucl(i)) - aGau(1:3) = ao_power(i,1:3) - GauSlaNuclear_matrix(i,k) = 0.d0 - - do j=1,ao_prim_num(i) - expGau = ao_expo_ordered_transp(j,i) - do A=1,nucl_num - cNuc(1:3) = nucl_coord_transp(1:3,A) - Znuc = nucl_charge(A) -! call GauSlaNuclear(expGau,cGau,aGau,expSla,cSla,Znuc,cNuc,res) - if (read) then - call GauSlaNuclear_read(expGau,cGau,aGau,expSla,cSla,Znuc,cNuc,res,iunit) - else - call GauSlaNuclear_write(expGau,cGau,aGau,expSla,cSla,Znuc,cNuc,res,iunit) - endif - GauSlaNuclear_matrix(i,k) += ao_coef_normalized_ordered_transp(j,i) * res - enddo - enddo - - enddo - - enddo - if (.not.read) then - write(iunit,*) '0.}' - endif - close(iunit) - -END_PROVIDER - -BEGIN_PROVIDER [ double precision, GauSlaH_matrix, (ao_num, nucl_num) ] - implicit none - BEGIN_DOC - ! Core hamiltonian in AO basis - END_DOC - GauSlaH_matrix(1:ao_num,1:nucl_num) = & - GauSlaKinetic_matrix(1:ao_num,1:nucl_num) + & - GauSlaNuclear_matrix(1:ao_num,1:nucl_num) - -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, MOSlaNuclear_matrix, (mo_tot_num, nucl_num) ] - implicit none - BEGIN_DOC -! - END_DOC - call dgemm('N','N',mo_tot_num,nucl_num,ao_num,1.d0, & - mo_coef_transp, size(mo_coef_transp,1), & - GauSlaNuclear_matrix, size(GauSlaNuclear_matrix,1), & - 0.d0, MOSlaNuclear_matrix, size(MOSlaNuclear_matrix,1)) -END_PROVIDER - -BEGIN_PROVIDER [ double precision, AO_orthoSlaH_matrix, (ao_num, nucl_num) ] - implicit none - BEGIN_DOC -! - END_DOC - call dgemm('T','N',ao_num,nucl_num,ao_num,1.d0, & - ao_ortho_canonical_coef, size(ao_ortho_canonical_coef,1), & - GauSlaH_matrix, size(GauSlaH_matrix,1), & - 0.d0, AO_orthoSlaH_matrix, size(AO_orthoSlaH_matrix,1)) -END_PROVIDER - diff --git a/plugins/Hartree_Fock_SlaterDressed/slater.irp.f b/plugins/Hartree_Fock_SlaterDressed/slater.irp.f deleted file mode 100644 index 27e4f10d..00000000 --- a/plugins/Hartree_Fock_SlaterDressed/slater.irp.f +++ /dev/null @@ -1,46 +0,0 @@ -BEGIN_PROVIDER [ double precision, slater_expo, (nucl_num) ] - implicit none - BEGIN_DOC - ! Exponents of the Slater functions - END_DOC - logical :: exists - call ezfio_has_Hartree_Fock_SlaterDressed_slater_expo_ezfio(exists) - if (exists) then - slater_expo(1:nucl_num) = slater_expo_ezfio(1:nucl_num) - else - integer :: i - do i=1,nucl_num - slater_expo(i) = nucl_charge(i) - enddo - call ezfio_set_Hartree_Fock_SlaterDressed_slater_expo_ezfio(slater_expo) - endif -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, slater_coef, (nucl_num,mo_tot_num) ] - implicit none - BEGIN_DOC - ! Exponents of the Slater functions - END_DOC - logical :: exists - slater_coef = 0.d0 - call ezfio_has_Hartree_Fock_SlaterDressed_slater_coef_ezfio(exists) - if (exists) then - slater_coef = slater_coef_ezfio - else - call ezfio_set_Hartree_Fock_SlaterDressed_slater_coef_ezfio(slater_coef) - endif -END_PROVIDER - -BEGIN_PROVIDER [ double precision, slater_normalization, (nucl_num) ] - implicit none - BEGIN_DOC - ! Normalization of Slater functions : sqrt(expo^3/pi) - END_DOC - integer :: i - do i=1,nucl_num - slater_normalization(i) = dsqrt( slater_expo(i)**3/dacos(-1.d0) ) - enddo - -END_PROVIDER - diff --git a/plugins/MP2/EZFIO.cfg b/plugins/MP2/EZFIO.cfg deleted file mode 100644 index 8577d8f1..00000000 --- a/plugins/MP2/EZFIO.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[energy] -type: double precision -doc: MP2 energy -interface: ezfio - diff --git a/plugins/MP2/H_apply.irp.f b/plugins/MP2/H_apply.irp.f deleted file mode 100644 index c9842a4a..00000000 --- a/plugins/MP2/H_apply.irp.f +++ /dev/null @@ -1,14 +0,0 @@ -use bitmasks -BEGIN_SHELL [ /usr/bin/env python2 ] -from generate_h_apply import * -from perturbation import perturbations - -s = H_apply("mp2") -s.set_perturbation("Moller_plesset") -print s - -s = H_apply("mp2_selection") -s.set_selection_pt2("Moller_Plesset") -print s -END_SHELL - diff --git a/plugins/MP2/NEEDED_CHILDREN_MODULES b/plugins/MP2/NEEDED_CHILDREN_MODULES deleted file mode 100644 index cf92308b..00000000 --- a/plugins/MP2/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -Perturbation Selectors_full SingleRefMethod ZMQ DavidsonUndressed diff --git a/plugins/MP2/mp2.irp.f b/plugins/MP2/mp2.irp.f deleted file mode 100644 index 2ea5fd14..00000000 --- a/plugins/MP2/mp2.irp.f +++ /dev/null @@ -1,23 +0,0 @@ -program mp2 - no_vvvv_integrals = .True. - SOFT_TOUCH no_vvvv_integrals - call run -end - -subroutine run - implicit none - double precision, allocatable :: pt2(:), norm_pert(:) - double precision :: H_pert_diag, E_old - integer :: N_st, iter - PROVIDE Fock_matrix_diag_mo H_apply_buffer_allocated - N_st = N_states - allocate (pt2(N_st), norm_pert(N_st)) - E_old = HF_energy - call H_apply_mp2(pt2, norm_pert, H_pert_diag, N_st) - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - print *, 'MP2 = ', pt2 - print *, 'E = ', E_old - print *, 'E+MP2 = ', E_old+pt2 - deallocate(pt2,norm_pert) -end diff --git a/plugins/MP2/mp2_wf.irp.f b/plugins/MP2/mp2_wf.irp.f deleted file mode 100644 index 1dda8d69..00000000 --- a/plugins/MP2/mp2_wf.irp.f +++ /dev/null @@ -1,43 +0,0 @@ -program mp2_wf - no_vvvv_integrals = .True. - SOFT_TOUCH no_vvvv_integrals - call run -end - -subroutine run - implicit none - BEGIN_DOC -! Save the MP2 wave function - END_DOC - integer :: i,k - - - double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:) - integer :: N_st, iter - N_st = N_states - allocate (pt2(N_st), norm_pert(N_st), H_pert_diag(N_st)) - - pt2 = 1.d0 - selection_criterion_factor = 0.d0 - TOUCH selection_criterion_min selection_criterion selection_criterion_factor - call H_apply_mp2_selection(pt2, norm_pert, H_pert_diag, N_st) - touch N_det psi_det psi_coef - psi_det = psi_det_sorted - psi_coef = psi_coef_sorted - touch N_det psi_det psi_coef - do i=N_det,1,-1 - if (dabs(psi_coef(i,1)) <= 1.d-8) then - N_det -= 1 - endif - enddo - print*,'N_det = ',N_det - print*,'-----' - print *, 'PT2 = ', pt2(1) - print *, 'E = ', HF_energy - print *, 'E_before +PT2 = ', HF_energy+pt2(1) - N_det = min(N_det,N_det_max) - touch N_det psi_det psi_coef - call save_wavefunction - call ezfio_set_mp2_energy(HF_energy+pt2(1)) - deallocate(pt2,norm_pert,H_pert_diag) -end diff --git a/plugins/MP2/tree_dependency.png b/plugins/MP2/tree_dependency.png deleted file mode 100644 index 96b06f0b..00000000 Binary files a/plugins/MP2/tree_dependency.png and /dev/null differ diff --git a/plugins/MRCC_Utils/EZFIO.cfg b/plugins/MRCC_Utils/EZFIO.cfg deleted file mode 100644 index 789f30ef..00000000 --- a/plugins/MRCC_Utils/EZFIO.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[energy] -type: double precision -doc: Calculated MRCC energy -interface: ezfio \ No newline at end of file diff --git a/plugins/MRCC_Utils/H_apply.irp.f b/plugins/MRCC_Utils/H_apply.irp.f deleted file mode 100644 index 375aa603..00000000 --- a/plugins/MRCC_Utils/H_apply.irp.f +++ /dev/null @@ -1,39 +0,0 @@ -use bitmasks -BEGIN_SHELL [ /usr/bin/env python2 ] -from generate_h_apply import * - -s = H_apply("mrcc") -s.data["parameters"] = ", delta_ij_, Nstates, Ndet_non_ref, Ndet_ref" -s.data["declarations"] += """ - integer, intent(in) :: Nstates, Ndet_ref, Ndet_non_ref - double precision, intent(in) :: delta_ij_(Nstates, Ndet_non_ref, Ndet_ref) -""" -s.data["keys_work"] = "call mrcc_dress(delta_ij_,Nstates,Ndet_non_ref,Ndet_ref,i_generator,key_idx,keys_out,N_int,iproc,key_mask)" -s.data["params_post"] += ", delta_ij_, Nstates, Ndet_non_ref, Ndet_ref" -s.data["params_main"] += "delta_ij_, Nstates, Ndet_non_ref, Ndet_ref" -s.data["decls_main"] += """ - integer, intent(in) :: Ndet_ref, Ndet_non_ref, Nstates - double precision, intent(in) :: delta_ij_(Nstates,Ndet_non_ref,Ndet_ref) -""" -s.data["finalization"] = "" -s.data["copy_buffer"] = "" -s.data["generate_psi_guess"] = "" -s.data["size_max"] = "3072" -print s - - - -s = H_apply("mrcc_PT2") -s.energy = "ci_electronic_energy_dressed" -s.set_perturbation("epstein_nesbet_2x2") -s.unset_openmp() -print s - -s = H_apply("mrcepa_PT2") -s.energy = "psi_energy" -s.set_perturbation("epstein_nesbet_2x2") -s.unset_openmp() -print s - -END_SHELL - diff --git a/plugins/MRCC_Utils/NEEDED_CHILDREN_MODULES b/plugins/MRCC_Utils/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 801d2f51..00000000 --- a/plugins/MRCC_Utils/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -Perturbation Selectors_full Generators_full Psiref_Utils Psiref_CAS diff --git a/plugins/MRCC_Utils/README.rst b/plugins/MRCC_Utils/README.rst deleted file mode 100644 index ae041734..00000000 --- a/plugins/MRCC_Utils/README.rst +++ /dev/null @@ -1,1064 +0,0 @@ -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -.. image:: tree_dependency.png - -* `Perturbation `_ -* `Selectors_full `_ -* `Generators_full `_ -* `Psiref_Utils `_ -* `Psiref_CAS `_ - -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -`a_coef `_ - Undocumented - - -`add_poly `_ - Add two polynomials - D(t) =! D(t) +( B(t)+C(t)) - - -`add_poly_multiply `_ - Add a polynomial multiplied by a constant - D(t) =! D(t) +( cst * B(t)) - - -`align_double `_ - Compute 1st dimension such that it is aligned for vectorization. - - -`apply_hole_local `_ - Undocumented - - -`apply_particle_local `_ - Undocumented - - -`apply_rotation `_ - Apply the rotation found by find_rotation - - -`approx_dble `_ - Undocumented - - -`b_coef `_ - Undocumented - - -`binom `_ - Binomial coefficients - - -`binom_func `_ - .. math :: - .br - \frac{i!}{j!(i-j)!} - .br - - -`binom_transp `_ - Binomial coefficients - - -`ci_eigenvectors_dressed `_ - Eigenvectors/values of the dressed CI matrix - - -`ci_eigenvectors_s2_dressed `_ - Eigenvectors/values of the dressed CI matrix - - -`ci_electronic_energy_dressed `_ - Eigenvectors/values of the dressed CI matrix - - -`ci_energy_dressed `_ - N_states lowest eigenvalues of the dressed CI matrix - - -`davidson_diag_hjj_mrcc `_ - Davidson diagonalization with specific diagonal elements of the H matrix - .br - H_jj : specific diagonal H matrix elements to diagonalize de Davidson - .br - dets_in : bitmasks corresponding to determinants - .br - u_in : guess coefficients on the various states. Overwritten - on exit - .br - dim_in : leftmost dimension of u_in - .br - sze : Number of determinants - .br - N_st : Number of eigenstates - .br - N_st_diag : Number of states in which H is diagonalized - .br - iunit : Unit for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_diag_hjj_sjj_mrcc `_ - Davidson diagonalization with specific diagonal elements of the H matrix - .br - H_jj : specific diagonal H matrix elements to diagonalize de Davidson - .br - S2_jj : specific diagonal S^2 matrix elements - .br - dets_in : bitmasks corresponding to determinants - .br - u_in : guess coefficients on the various states. Overwritten - on exit - .br - dim_in : leftmost dimension of u_in - .br - sze : Number of determinants - .br - N_st : Number of eigenstates - .br - N_st_diag : Number of states in which H is diagonalized. Assumed > sze - .br - iunit : Unit for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_diag_mrcc `_ - Davidson diagonalization. - .br - dets_in : bitmasks corresponding to determinants - .br - u_in : guess coefficients on the various states. Overwritten - on exit - .br - dim_in : leftmost dimension of u_in - .br - sze : Number of determinants - .br - N_st : Number of eigenstates - .br - iunit : Unit number for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_diag_mrcc_hs2 `_ - Davidson diagonalization. - .br - dets_in : bitmasks corresponding to determinants - .br - u_in : guess coefficients on the various states. Overwritten - on exit - .br - dim_in : leftmost dimension of u_in - .br - sze : Number of determinants - .br - N_st : Number of eigenstates - .br - iunit : Unit number for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`dble_fact `_ - Undocumented - - -`dble_fact_even `_ - n!! - - -`dble_fact_odd `_ - n!! - - -`dble_logfact `_ - n!! - - -`ddfact2 `_ - Undocumented - - -`dec_exc `_ - Undocumented - - -`diagonalize_ci_dressed `_ - Replace the coefficients of the CI states by the coefficients of the - eigenstates of the CI matrix - - -`dij `_ - Undocumented - - -`dij_unique `_ - Undocumented - - -`dset_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`dset_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`dsort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`dtranspose `_ - Transpose input matrix A into output matrix B - - -`erf0 `_ - Undocumented - - -`exc_inf `_ - Undocumented - - -`exccmp `_ - Undocumented - - -`exceq `_ - Undocumented - - -`f_integral `_ - function that calculates the following integral - \int_{\-infty}^{+\infty} x^n \exp(-p x^2) dx - - -`fact `_ - n! - - -`fact_inv `_ - 1/n! - - -`find_rotation `_ - Find A.C = B - - -`find_triples_and_quadruples `_ - Undocumented - - -`find_triples_and_quadruples_micro `_ - Undocumented - - -`gammln `_ - Undocumented - - -`gammp `_ - Undocumented - - -`gaussian_product `_ - Gaussian product in 1D. - e^{-a (x-x_A)^2} e^{-b (x-x_B)^2} = K_{ab}^x e^{-p (x-x_P)^2} - - -`gaussian_product_x `_ - Gaussian product in 1D. - e^{-a (x-x_A)^2} e^{-b (x-x_B)^2} = K_{ab}^x e^{-p (x-x_P)^2} - - -`gcf `_ - Undocumented - - -`get_dij `_ - Undocumented - - -`get_dij_index `_ - Undocumented - - -`get_pseudo_inverse `_ - Find C = A^-1 - - -`give_explicit_poly_and_gaussian `_ - Transforms the product of - (x-x_A)^a(1) (x-x_B)^b(1) (x-x_A)^a(2) (y-y_B)^b(2) (z-z_A)^a(3) (z-z_B)^b(3) exp(-(r-A)^2 alpha) exp(-(r-B)^2 beta) - into - fact_k * [ sum (l_x = 0,i_order(1)) P_new(l_x,1) * (x-P_center(1))^l_x ] exp (- p (x-P_center(1))^2 ) - * [ sum (l_y = 0,i_order(2)) P_new(l_y,2) * (y-P_center(2))^l_y ] exp (- p (y-P_center(2))^2 ) - * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 ) - - -`give_explicit_poly_and_gaussian_double `_ - Transforms the product of - (x-x_A)^a(1) (x-x_B)^b(1) (x-x_A)^a(2) (y-y_B)^b(2) (z-z_A)^a(3) (z-z_B)^b(3) - exp(-(r-A)^2 alpha) exp(-(r-B)^2 beta) exp(-(r-Nucl_center)^2 gama - .br - into - fact_k * [ sum (l_x = 0,i_order(1)) P_new(l_x,1) * (x-P_center(1))^l_x ] exp (- p (x-P_center(1))^2 ) - * [ sum (l_y = 0,i_order(2)) P_new(l_y,2) * (y-P_center(2))^l_y ] exp (- p (y-P_center(2))^2 ) - * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 ) - - -`give_explicit_poly_and_gaussian_x `_ - Transform the product of - (x-x_A)^a(1) (x-x_B)^b(1) (x-x_A)^a(2) (y-y_B)^b(2) (z-z_A)^a(3) (z-z_B)^b(3) exp(-(r-A)^2 alpha) exp(-(r-B)^2 beta) - into - fact_k (x-x_P)^iorder(1) (y-y_P)^iorder(2) (z-z_P)^iorder(3) exp(-p(r-P)^2) - - -`gser `_ - Undocumented - - -h_apply_mrcc - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_mrcc_diexc - Undocumented - - -h_apply_mrcc_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_mrcc_diexcp - Undocumented - - -h_apply_mrcc_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_mrcc_pt2 - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_mrcc_pt2_diexc - Undocumented - - -h_apply_mrcc_pt2_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_mrcc_pt2_diexcp - Undocumented - - -h_apply_mrcc_pt2_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_mrcepa_pt2 - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_mrcepa_pt2_collector - Collects results from the selection in an array of generators - - -h_apply_mrcepa_pt2_diexc - Undocumented - - -h_apply_mrcepa_pt2_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_mrcepa_pt2_diexcp - Undocumented - - -h_apply_mrcepa_pt2_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_mrcepa_pt2_slave - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_mrcepa_pt2_slave_inproc - Computes a buffer using threads - - -h_apply_mrcepa_pt2_slave_tcp - Computes a buffer over the network - - -`h_matrix_dressed `_ - Dressed H with Delta_ij - - -`h_s2_u_0_mrcc_nstates `_ - Computes v_0 = H|u_0> and s_0 = S^2 |u_0> - .br - n : number of determinants - .br - H_jj : array of - .br - S2_jj : array of - - -`h_u_0_mrcc_nstates `_ - Computes v_0 = H|u_0> - .br - n : number of determinants - .br - H_jj : array of - - -`heap_dsort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_dsort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`heap_i2sort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_i2sort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`heap_i8sort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_i8sort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`heap_isort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_isort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`heap_sort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_sort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`hermite `_ - Hermite polynomial - - -`hh_exists `_ - Undocumented - - -`hh_shortcut `_ - Undocumented - - -`hij_mrcc `_ - < ref | H | Non-ref > matrix - - -`i2radix_sort `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`i2set_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`i2set_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`i2sort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`i8radix_sort `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`i8radix_sort_big `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`i8set_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`i8set_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`i8sort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_dsort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_dsort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`insertion_i2sort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_i2sort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`insertion_i8sort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_i8sort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`insertion_isort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_isort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`insertion_sort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_sort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`inv_int `_ - 1/i - - -`iradix_sort `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`iradix_sort_big `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`is_generable `_ - Undocumented - - -`iset_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`iset_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`isort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`lambda_mrcc `_ - cm/ or perturbative 1/Delta_E(m) - - -`lambda_mrcc_kept `_ - cm/ or perturbative 1/Delta_E(m) - - -`lambda_mrcc_pt2 `_ - cm/ or perturbative 1/Delta_E(m) - - -`lapack_diag `_ - Diagonalize matrix H - .br - H is untouched between input and ouptut - .br - eigevalues(i) = ith lowest eigenvalue of the H matrix - .br - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - .br - - -`lapack_diag_s2 `_ - Diagonalize matrix H - .br - H is untouched between input and ouptut - .br - eigevalues(i) = ith lowest eigenvalue of the H matrix - .br - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - .br - - -`lapack_diagd `_ - Diagonalize matrix H - .br - H is untouched between input and ouptut - .br - eigevalues(i) = ith lowest eigenvalue of the H matrix - .br - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - .br - - -`lapack_partial_diag `_ - Diagonalize matrix H - .br - H is untouched between input and ouptut - .br - eigevalues(i) = ith lowest eigenvalue of the H matrix - .br - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - .br - - -`logfact `_ - n! - - -`lowercase `_ - Transform to lower case - - -`map_load_from_disk `_ - Undocumented - - -`map_save_to_disk `_ - Undocumented - - -`mrcc_dress `_ - Undocumented - - -`mrmode `_ - Undocumented - - -`multiply_poly `_ - Multiply two polynomials - D(t) =! D(t) +( B(t)*C(t)) - - -`n_ex_exists `_ - Undocumented - - -`n_hh_exists `_ - Undocumented - - -`n_pp_exists `_ - Undocumented - - -`normalize `_ - Normalizes vector u - u is expected to be aligned in memory. - - -`nproc `_ - Number of current OpenMP threads - - -`ortho_canonical `_ - Compute C_new=C_old.U.s^-1/2 canonical orthogonalization. - .br - overlap : overlap matrix - .br - LDA : leftmost dimension of overlap array - .br - N : Overlap matrix is NxN (array is (LDA,N) ) - .br - C : Coefficients of the vectors to orthogonalize. On exit, - orthogonal vectors - .br - LDC : leftmost dimension of C - .br - m : Coefficients matrix is MxN, ( array is (LDC,N) ) - .br - - -`ortho_lowdin `_ - Compute C_new=C_old.S^-1/2 orthogonalization. - .br - overlap : overlap matrix - .br - LDA : leftmost dimension of overlap array - .br - N : Overlap matrix is NxN (array is (LDA,N) ) - .br - C : Coefficients of the vectors to orthogonalize. On exit, - orthogonal vectors - .br - LDC : leftmost dimension of C - .br - m : Coefficients matrix is MxN, ( array is (LDC,N) ) - .br - - -`ortho_qr `_ - Orthogonalization using Q.R factorization - .br - A : matrix to orthogonalize - .br - LDA : leftmost dimension of A - .br - n : Number of rows of A - .br - m : Number of columns of A - .br - - -`overlap_a_b_c `_ - Undocumented - - -`overlap_gaussian_x `_ - .. math:: - .br - \sum_{-infty}^{+infty} (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2) dx - .br - - -`overlap_gaussian_xyz `_ - .. math:: - .br - S_x = \int (x-A_x)^{a_x} exp(-\alpha(x-A_x)^2) (x-B_x)^{b_x} exp(-beta(x-B_x)^2) dx \\ - S = S_x S_y S_z - .br - - -`overlap_x_abs `_ - .. math :: - .br - \int_{-infty}^{+infty} (x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) dx - .br - - -`pouet `_ - Undocumented - - -`pp_exists `_ - Undocumented - - -`progress_active `_ - Current status for displaying progress bars. Global variable. - - -`progress_bar `_ - Current status for displaying progress bars. Global variable. - - -`progress_timeout `_ - Current status for displaying progress bars. Global variable. - - -`progress_title `_ - Current status for displaying progress bars. Global variable. - - -`progress_value `_ - Current status for displaying progress bars. Global variable. - - -`psi_non_ref_sorted `_ - Undocumented - - -`psi_non_ref_sorted_idx `_ - Undocumented - - -`psi_ref_lock `_ - Locks on ref determinants to fill delta_ij - - -`recentered_poly2 `_ - Recenter two polynomials - - -`rho_mrcc `_ - Undocumented - - -`rint `_ - .. math:: - .br - \int_0^1 dx \exp(-p x^2) x^n - .br - - -`rint1 `_ - Standard version of rint - - -`rint_large_n `_ - Version of rint for large values of n - - -`rint_sum `_ - Needed for the calculation of two-electron integrals. - - -`rinteg `_ - Undocumented - - -`rintgauss `_ - Undocumented - - -`run_progress `_ - Display a progress bar with documentation of what is happening - - -`sabpartial `_ - Undocumented - - -`searchdet `_ - Undocumented - - -`searchexc `_ - Undocumented - - -`set_generators_bitmasks_as_holes_and_particles `_ - Undocumented - - -`set_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`set_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`set_zero_extra_diag `_ - Undocumented - - -`sort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`sort_det `_ - Undocumented - - -`sort_exc `_ - Undocumented - - -`start_progress `_ - Starts the progress bar - - -`stop_progress `_ - Stop the progress bar - - -`svd `_ - Compute A = U.D.Vt - .br - LDx : leftmost dimension of x - .br - Dimsneion of A is m x n - .br - - -`tamise_exc `_ - Uncodumented : TODO - - -`transpose `_ - Transpose input matrix A into output matrix B - - -`u_0_h_u_0_mrcc_nstates `_ - Computes e_0 = / - .br - n : number of determinants - .br - - -`u_dot_u `_ - Compute - - -`u_dot_v `_ - Compute - - -`unsortedsearchdet `_ - Undocumented - - -`wall_time `_ - The equivalent of cpu_time, but for the wall time. - - -`write_git_log `_ - Write the last git commit in file iunit. - diff --git a/plugins/MRCC_Utils/amplitudes.irp.f b/plugins/MRCC_Utils/amplitudes.irp.f deleted file mode 100644 index 1dcf2a2b..00000000 --- a/plugins/MRCC_Utils/amplitudes.irp.f +++ /dev/null @@ -1,270 +0,0 @@ - BEGIN_PROVIDER [ integer, n_exc_active ] -&BEGIN_PROVIDER [ integer, active_pp_idx, (hh_nex) ] -&BEGIN_PROVIDER [ integer, active_hh_idx, (hh_nex) ] -&BEGIN_PROVIDER [ logical, is_active_exc, (hh_nex) ] - implicit none - BEGIN_DOC - ! is_active_exc : True if the excitation involves at least one active MO - ! - ! n_exc_active : Number of active excitations : Number of excitations without the inactive ones. - ! - ! active_hh_idx : - ! - ! active_pp_idx : - END_DOC - integer :: hh, pp, II - integer :: ind - logical :: ok - integer(bit_kind) :: myDet(N_int, 2), myMask(N_int, 2) - - integer, allocatable :: pathTo(:) - integer, external :: searchDet - - allocate(pathTo(N_det_non_ref)) - - pathTo(:) = 0 - is_active_exc(:) = .True. - n_exc_active = 0 - -! do hh = 1, hh_shortcut(0) -! do pp = hh_shortcut(hh), hh_shortcut(hh+1)-1 -! do II = 1, N_det_ref -! -! call apply_hole_local(psi_ref(1,1,II), hh_exists(1, hh), myMask, ok, N_int) -! if(.not. ok) cycle -! -! call apply_particle_local(myMask, pp_exists(1, pp), myDet, ok, N_int) -! if(.not. ok) cycle -! -! ind = searchDet(psi_non_ref_sorted(1,1,1), myDet(1,1), N_det_non_ref, N_int) -! if(ind == -1) cycle -! -! logical, external :: is_a_two_holes_two_particles -! if (is_a_two_holes_two_particles(myDet)) then -! is_active_exc(pp) = .False. -! endif - -! ind = psi_non_ref_sorted_idx(ind) -! if(pathTo(ind) == 0) then -! pathTo(ind) = pp -! else -! is_active_exc(pp) = .true. -! is_active_exc(pathTo(ind)) = .true. -! end if - -! end do -! end do -! end do - - do hh = 1, hh_shortcut(0) - do pp = hh_shortcut(hh), hh_shortcut(hh+1)-1 - if(is_active_exc(pp)) then - n_exc_active = n_exc_active + 1 - active_hh_idx(n_exc_active) = hh - active_pp_idx(n_exc_active) = pp - end if - end do - end do - - deallocate(pathTo) - - print *, n_exc_active, "active excitations /", hh_nex - -END_PROVIDER - -BEGIN_PROVIDER [ logical, has_a_unique_parent, (N_det_non_ref) ] - implicit none - BEGIN_DOC - ! True if the determinant in the non-reference has a unique parent - END_DOC - integer :: i,j,n - integer :: degree - do j=1,N_det_non_ref - has_a_unique_parent(j) = .True. - n=0 - do i=1,N_det_ref - call get_excitation_degree(psi_ref(1,1,i), psi_non_ref(1,1,j), degree, N_int) - if (degree < 2) then - n = n+1 - if (n > 1) then - has_a_unique_parent(j) = .False. - exit - endif - endif - enddo - enddo - -END_PROVIDER - - - -BEGIN_PROVIDER [ integer, n_exc_active_sze ] - implicit none - BEGIN_DOC - ! Dimension of arrays to avoid zero-sized arrays - END_DOC - n_exc_active_sze = max(n_exc_active,1) -END_PROVIDER - - - - BEGIN_PROVIDER [ integer, active_excitation_to_determinants_idx, (0:N_det_ref+1, n_exc_active_sze) ] -&BEGIN_PROVIDER [ double precision, active_excitation_to_determinants_val, (N_states,N_det_ref+1, n_exc_active_sze) ] - implicit none - BEGIN_DOC - ! Sparse matrix A containing the matrix to transform the active excitations to - ! determinants : A | \Psi_0 > = | \Psi_SD > - END_DOC - integer :: s, ppp, pp, hh, II, ind, wk, i - integer, allocatable :: lref(:) - integer(bit_kind) :: myDet(N_int,2), myMask(N_int,2) - double precision :: phase - logical :: ok - integer, external :: searchDet - - - !$OMP PARALLEL default(none) shared(psi_non_ref, hh_exists, pp_exists, N_int,& - !$OMP active_excitation_to_determinants_val, active_excitation_to_determinants_idx)& - !$OMP shared(hh_shortcut, psi_ref_coef, N_det_non_ref, psi_non_ref_sorted, & - !$OMP psi_non_ref_sorted_idx, psi_ref, N_det_ref, N_states)& - !$OMP shared(active_hh_idx, active_pp_idx, n_exc_active)& - !$OMP private(lref, pp, II, ok, myMask, myDet, ind, phase, wk, ppp, hh, s) - allocate(lref(N_det_non_ref)) - !$OMP DO schedule(dynamic) - do ppp=1,n_exc_active - active_excitation_to_determinants_val(:,:,ppp) = 0d0 - active_excitation_to_determinants_idx(:,ppp) = 0 - pp = active_pp_idx(ppp) - hh = active_hh_idx(ppp) - lref = 0 - do II = 1, N_det_ref - call apply_hole_local(psi_ref(1,1,II), hh_exists(1, hh), myMask, ok, N_int) - if(.not. ok) cycle - call apply_particle_local(myMask, pp_exists(1, pp), myDet, ok, N_int) - if(.not. ok) cycle - ind = searchDet(psi_non_ref_sorted(1,1,1), myDet(1,1), N_det_non_ref, N_int) - if(ind /= -1) then - call get_phase(myDet(1,1), psi_ref(1,1,II), phase, N_int) - if (phase > 0.d0) then - lref(psi_non_ref_sorted_idx(ind)) = II - else - lref(psi_non_ref_sorted_idx(ind)) = -II - endif - end if - end do - wk = 0 - do i=1, N_det_non_ref - if(lref(i) > 0) then - wk += 1 - do s=1,N_states - active_excitation_to_determinants_val(s,wk, ppp) = psi_ref_coef(lref(i), s) - enddo - active_excitation_to_determinants_idx(wk, ppp) = i - else if(lref(i) < 0) then - wk += 1 - do s=1,N_states - active_excitation_to_determinants_val(s,wk, ppp) = -psi_ref_coef(-lref(i), s) - enddo - active_excitation_to_determinants_idx(wk, ppp) = i - end if - end do - active_excitation_to_determinants_idx(0,ppp) = wk - end do - !$OMP END DO - deallocate(lref) - !$OMP END PARALLEL - -END_PROVIDER - - - BEGIN_PROVIDER [ integer, mrcc_AtA_ind, (N_det_ref * n_exc_active_sze) ] -&BEGIN_PROVIDER [ double precision, mrcc_AtA_val, (N_states, N_det_ref * n_exc_active_sze) ] -&BEGIN_PROVIDER [ integer, mrcc_col_shortcut, (n_exc_active_sze) ] -&BEGIN_PROVIDER [ integer, mrcc_N_col, (n_exc_active_sze) ] - implicit none - BEGIN_DOC - ! A is active_excitation_to_determinants in At.A - END_DOC - integer :: AtA_size, i,k - integer :: at_roww, at_row, wk, a_coll, a_col, r1, r2, s - double precision, allocatable :: t(:), A_val_mwen(:,:), As2_val_mwen(:,:) - integer, allocatable :: A_ind_mwen(:) - double precision :: sij - PROVIDE psi_non_ref - - mrcc_AtA_ind(:) = 0 - mrcc_AtA_val(:,:) = 0.d0 - mrcc_col_shortcut(:) = 0 - mrcc_N_col(:) = 0 - AtA_size = 0 - - - !$OMP PARALLEL default(none) shared(k, active_excitation_to_determinants_idx,& - !$OMP active_excitation_to_determinants_val, hh_nex) & - !$OMP private(at_row, a_col, t, i, r1, r2, wk, A_ind_mwen, A_val_mwen,& - !$OMP As2_val_mwen, a_coll, at_roww,sij) & - !$OMP shared(N_states,mrcc_col_shortcut, mrcc_N_col, AtA_size, mrcc_AtA_val, mrcc_AtA_ind, & - !$OMP n_exc_active, active_pp_idx,psi_non_ref) - allocate(A_val_mwen(N_states,hh_nex), As2_val_mwen(N_states,hh_nex), A_ind_mwen(hh_nex), t(N_states) ) - - !$OMP DO schedule(dynamic, 100) - do at_roww = 1, n_exc_active ! hh_nex - at_row = active_pp_idx(at_roww) - wk = 0 - - do a_coll = 1, n_exc_active - a_col = active_pp_idx(a_coll) - t(:) = 0d0 - r1 = 1 - r2 = 1 - do while ((active_excitation_to_determinants_idx(r1, at_roww) /= 0).and.(active_excitation_to_determinants_idx(r2, a_coll) /= 0)) - if(active_excitation_to_determinants_idx(r1, at_roww) > active_excitation_to_determinants_idx(r2, a_coll)) then - r2 = r2+1 - else if(active_excitation_to_determinants_idx(r1, at_roww) < active_excitation_to_determinants_idx(r2, a_coll)) then - r1 = r1+1 - else - do s=1,N_states - t(s) = t(s) - active_excitation_to_determinants_val(s,r1, at_roww) * active_excitation_to_determinants_val(s,r2, a_coll) - enddo - r1 = r1+1 - r2 = r2+1 - end if - end do - - if (a_col == at_row) then - t(:) = t(:) + 1.d0 - endif - if (sum(dabs(t(:))) > 0.d0) then - wk = wk+1 - A_ind_mwen(wk) = a_col - A_val_mwen(:,wk) = t(:) - endif - - end do - - if(wk /= 0) then - !$OMP CRITICAL - mrcc_col_shortcut(at_roww) = AtA_size+1 - mrcc_N_col(at_roww) = wk - if (AtA_size+wk > size(mrcc_AtA_ind,1)) then - print *, AtA_size+wk , size(mrcc_AtA_ind,1) - stop 'too small' - endif - do i=1,wk - mrcc_AtA_ind(AtA_size+i) = A_ind_mwen(i) - do s=1,N_states - mrcc_AtA_val(s,AtA_size+i) = A_val_mwen(s,i) - enddo - enddo - AtA_size += wk - !$OMP END CRITICAL - end if - end do - !$OMP END DO NOWAIT - deallocate (A_ind_mwen, A_val_mwen, As2_val_mwen, t) - !$OMP END PARALLEL - - print *, "At.A SIZE", ata_size - -END_PROVIDER - diff --git a/plugins/MRCC_Utils/mrcc_dress.irp.f b/plugins/MRCC_Utils/mrcc_dress.irp.f deleted file mode 100644 index 41041288..00000000 --- a/plugins/MRCC_Utils/mrcc_dress.irp.f +++ /dev/null @@ -1,423 +0,0 @@ -use omp_lib -use bitmasks - -BEGIN_PROVIDER [ integer(omp_lock_kind), psi_ref_lock, (psi_det_size) ] - implicit none - BEGIN_DOC - ! Locks on ref determinants to fill delta_ij - END_DOC - integer :: i - do i=1,psi_det_size - call omp_init_lock( psi_ref_lock(i) ) - enddo - -END_PROVIDER - - -subroutine mrcc_dress(delta_ij_, Nstates, Ndet_non_ref, Ndet_ref,i_generator,n_selected,det_buffer,Nint,iproc,key_mask) - use bitmasks - implicit none - - integer, intent(in) :: i_generator,n_selected, Nint, iproc - integer, intent(in) :: Nstates, Ndet_ref, Ndet_non_ref - double precision, intent(inout) :: delta_ij_(Nstates,Ndet_non_ref,Ndet_ref) - - integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected) - integer :: i,j,k,l,m - integer :: degree_alpha(psi_det_size) - integer :: idx_alpha(0:psi_det_size) - logical :: good, fullMatch - - integer(bit_kind) :: tq(Nint,2,n_selected) - integer :: N_tq, c_ref ,degree - - double precision :: hIk, hla, hIl, dIk(Nstates), dka(Nstates), dIa(Nstates) - double precision, allocatable :: dIa_hla(:,:) - double precision :: haj, phase, phase2 - double precision :: f(Nstates), ci_inv(Nstates) - integer :: exc(0:2,2,2) - integer :: h1,h2,p1,p2,s1,s2 - integer(bit_kind) :: tmp_det(Nint,2) - integer :: iint, ipos - integer :: i_state, k_sd, l_sd, i_I, i_alpha - - integer(bit_kind),allocatable :: miniList(:,:,:) - integer(bit_kind),intent(in) :: key_mask(Nint, 2) - integer,allocatable :: idx_miniList(:) - integer :: N_miniList, ni, leng - double precision, allocatable :: hij_cache(:) - - integer(bit_kind), allocatable :: microlist(:,:,:), microlist_zero(:,:,:) - integer, allocatable :: idx_microlist(:), N_microlist(:), ptr_microlist(:), idx_microlist_zero(:) - integer :: mobiles(2), smallerlist - logical, external :: is_generable - - leng = max(N_det_generators, N_det_non_ref) - allocate(miniList(Nint, 2, leng), idx_minilist(leng), hij_cache(N_det_non_ref)) - - !create_minilist_find_previous(key_mask, fullList, miniList, N_fullList, N_miniList, fullMatch, Nint) - call create_minilist_find_previous(key_mask, psi_det_generators, miniList, i_generator-1, N_miniList, fullMatch, Nint) - - if(fullMatch) then - return - end if - - allocate(ptr_microlist(0:mo_tot_num*2+1), & - N_microlist(0:mo_tot_num*2) ) - allocate( microlist(Nint,2,N_minilist*4), & - idx_microlist(N_minilist*4)) - - if(key_mask(1,1) /= 0_8) then - call create_microlist(miniList, N_minilist, key_mask, microlist, idx_microlist, N_microlist, ptr_microlist, Nint) - call find_triples_and_quadruples_micro(i_generator,n_selected,det_buffer,Nint,tq,N_tq,microlist,ptr_microlist,N_microlist,key_mask) - else - call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq,miniList,N_minilist) - end if - - - - deallocate(microlist, idx_microlist) - - allocate (dIa_hla(Nstates,Ndet_non_ref)) - - ! |I> - - ! |alpha> - - if(N_tq > 0) then - - call create_minilist(key_mask, psi_non_ref, miniList, idx_minilist, N_det_non_ref, N_minilist, Nint) - if(N_minilist == 0) return - - - if(key_mask(1,1) /= 0) then !!!!!!!!!!! PAS GENERAL !!!!!!!!! - allocate(microlist_zero(Nint,2,N_minilist), idx_microlist_zero(N_minilist)) - - allocate( microlist(Nint,2,N_minilist*4), & - idx_microlist(N_minilist*4)) - call create_microlist(miniList, N_minilist, key_mask, microlist, idx_microlist, N_microlist, ptr_microlist, Nint) - - - do i=0,mo_tot_num*2 - do k=ptr_microlist(i),ptr_microlist(i+1)-1 - idx_microlist(k) = idx_minilist(idx_microlist(k)) - end do - end do - - do l=1,N_microlist(0) - do k=1,Nint - microlist_zero(k,1,l) = microlist(k,1,l) - microlist_zero(k,2,l) = microlist(k,2,l) - enddo - idx_microlist_zero(l) = idx_microlist(l) - enddo - end if - end if - - - - do i_alpha=1,N_tq -! ok = .false. -! do i=N_det_generators, 1, -1 -! if(is_generable(psi_det_generators(1,1,i), tq(1,1,i_alpha), Nint)) then -! ok = .true. -! exit -! end if -! end do -! if(.not. ok) then -! cycle -! end if - - if(key_mask(1,1) /= 0) then - call getMobiles(tq(1,1,i_alpha), key_mask, mobiles, Nint) - - if(N_microlist(mobiles(1)) < N_microlist(mobiles(2))) then - smallerlist = mobiles(1) - else - smallerlist = mobiles(2) - end if - - - do l=0,N_microlist(smallerlist)-1 - microlist_zero(:,:,ptr_microlist(1) + l) = microlist(:,:,ptr_microlist(smallerlist) + l) - idx_microlist_zero(ptr_microlist(1) + l) = idx_microlist(ptr_microlist(smallerlist) + l) - end do - - call get_excitation_degree_vector(microlist_zero,tq(1,1,i_alpha),degree_alpha,Nint,N_microlist(smallerlist)+N_microlist(0),idx_alpha) - do j=1,idx_alpha(0) - idx_alpha(j) = idx_microlist_zero(idx_alpha(j)) - end do - else - call get_excitation_degree_vector(miniList,tq(1,1,i_alpha),degree_alpha,Nint,N_minilist,idx_alpha) - do j=1,idx_alpha(0) - idx_alpha(j) = idx_miniList(idx_alpha(j)) - end do - end if - - - do l_sd=1,idx_alpha(0) - k_sd = idx_alpha(l_sd) - call i_h_j(tq(1,1,i_alpha),psi_non_ref(1,1,idx_alpha(l_sd)),Nint,hij_cache(k_sd)) - enddo - - ! |I> - do i_I=1,N_det_ref - ! Find triples and quadruple grand parents - call get_excitation_degree(tq(1,1,i_alpha),psi_ref(1,1,i_I),degree,Nint) - if (degree > 4) then - cycle - endif - - do i_state=1,Nstates - dIa(i_state) = 0.d0 - enddo - - ! |alpha> - do k_sd=1,idx_alpha(0) - - ! Loop if lambda == 0 - logical :: loop - loop = .True. - do i_state=1,Nstates - if (lambda_mrcc(i_state,idx_alpha(k_sd)) /= 0.d0) then - loop = .False. - exit - endif - enddo - if (loop) then - cycle - endif - - call get_excitation_degree(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(k_sd)),degree,Nint) - if (degree > 2) then - cycle - endif - - ! - ! - hIk = hij_mrcc(idx_alpha(k_sd),i_I) - ! call i_h_j(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(k_sd)),Nint,hIk) - do i_state=1,Nstates - dIk(i_state) = hIk * lambda_mrcc(i_state,idx_alpha(k_sd)) - enddo - ! |l> = Exc(k -> alpha) |I> - call get_excitation(psi_non_ref(1,1,idx_alpha(k_sd)),tq(1,1,i_alpha),exc,degree,phase,Nint) - call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) - do k=1,N_int - tmp_det(k,1) = psi_ref(k,1,i_I) - tmp_det(k,2) = psi_ref(k,2,i_I) - enddo - - logical :: ok - call apply_excitation(psi_ref(1,1,i_I), exc, tmp_det, ok, Nint) - if(.not. ok) cycle - - ! - do i_state=1,Nstates - dka(i_state) = 0.d0 - enddo - do l_sd=k_sd+1,idx_alpha(0) - - call get_excitation_degree(tmp_det,psi_non_ref(1,1,idx_alpha(l_sd)),degree,Nint) - if (degree == 0) then - - loop = .True. - do i_state=1,Nstates - if (lambda_mrcc(i_state,idx_alpha(l_sd)) /= 0.d0) then - loop = .False. - exit - endif - enddo - if (.not.loop) then - call get_excitation(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(l_sd)),exc,degree,phase2,Nint) - hIl = hij_mrcc(idx_alpha(l_sd),i_I) -! call i_h_j(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(l_sd)),Nint,hIl) - do i_state=1,Nstates - dka(i_state) = hIl * lambda_mrcc(i_state,idx_alpha(l_sd)) * phase * phase2 - enddo - endif - - exit - endif - enddo - do i_state=1,Nstates - dIa(i_state) = dIa(i_state) + dIk(i_state) * dka(i_state) - enddo - enddo - - do i_state=1,Nstates - ci_inv(i_state) = psi_ref_coef_inv(i_I,i_state) - enddo - do l_sd=1,idx_alpha(0) - k_sd = idx_alpha(l_sd) - hla = hij_cache(k_sd) -! call i_h_j(tq(1,1,i_alpha),psi_non_ref(1,1,idx_alpha(l_sd)),Nint,hla) - do i_state=1,Nstates - dIa_hla(i_state,k_sd) = dIa(i_state) * hla - enddo - enddo - call omp_set_lock( psi_ref_lock(i_I) ) - - - do i_state=1,Nstates - if(dabs(psi_ref_coef(i_I,i_state)).ge.5.d-5)then - do l_sd=1,idx_alpha(0) - k_sd = idx_alpha(l_sd) - delta_ij_(i_state,k_sd,i_I) = delta_ij_(i_state,k_sd,i_I) + dIa_hla(i_state,k_sd) - enddo - else - do l_sd=1,idx_alpha(0) - k_sd = idx_alpha(l_sd) - delta_ij_(i_state,k_sd,i_I) = delta_ij_(i_state,k_sd,i_I) + 0.5d0 * dIa_hla(i_state,k_sd) - enddo - endif - enddo - call omp_unset_lock( psi_ref_lock(i_I) ) - enddo - enddo - deallocate (dIa_hla,hij_cache) - deallocate(miniList, idx_miniList) -end - - -subroutine find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq,miniList,N_miniList) - - use bitmasks - implicit none - - integer, intent(in) :: i_generator,n_selected, Nint - - integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected) - integer :: i,j,k,m - logical :: is_in_wavefunction - integer :: degree(psi_det_size) - integer :: idx(0:psi_det_size) - logical :: good - - integer(bit_kind), intent(out) :: tq(Nint,2,n_selected) - integer, intent(out) :: N_tq - - - integer :: nt,ni - logical, external :: is_connected_to - - - integer(bit_kind),intent(in) :: miniList(Nint,2,N_det_generators) - integer,intent(in) :: N_miniList - - - - N_tq = 0 - - - - i_loop : do i=1,N_selected - if(is_connected_to(det_buffer(1,1,i), miniList, Nint, N_miniList)) then - cycle - end if - - ! Select determinants that are triple or quadruple excitations - ! from the ref - good = .True. - call get_excitation_degree_vector(psi_ref,det_buffer(1,1,i),degree,Nint,N_det_ref,idx) - !good=(idx(0) == 0) tant que degree > 2 pas retourné par get_excitation_degree_vector - do k=1,idx(0) - if (degree(k) < 3) then - good = .False. - exit - endif - enddo - if (good) then - if (.not. is_in_wavefunction(det_buffer(1,1,i),Nint)) then - N_tq += 1 - do k=1,N_int - tq(k,1,N_tq) = det_buffer(k,1,i) - tq(k,2,N_tq) = det_buffer(k,2,i) - enddo - endif - endif - enddo i_loop -end - - -subroutine find_triples_and_quadruples_micro(i_generator,n_selected,det_buffer,Nint,tq,N_tq,microlist,ptr_microlist,N_microlist,key_mask) - - use bitmasks - implicit none - - integer, intent(in) :: i_generator,n_selected, Nint - - integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected) - integer :: i,j,k,m - logical :: is_in_wavefunction - integer :: degree(psi_det_size) - integer :: idx(0:psi_det_size) - logical :: good - - integer(bit_kind), intent(out) :: tq(Nint,2,n_selected) - integer, intent(out) :: N_tq - - - integer :: nt,ni - logical, external :: is_connected_to - - - integer(bit_kind),intent(in) :: microlist(Nint,2,*) - integer,intent(in) :: ptr_microlist(0:*) - integer,intent(in) :: N_microlist(0:*) - integer(bit_kind),intent(in) :: key_mask(Nint, 2) - - integer :: mobiles(2), smallerlist - - N_tq = 0 - - - - i_loop : do i=1,N_selected - call getMobiles(det_buffer(1,1,i), key_mask, mobiles, Nint) - if(N_microlist(mobiles(1)) < N_microlist(mobiles(2))) then - smallerlist = mobiles(1) - else - smallerlist = mobiles(2) - end if - - if(N_microlist(smallerlist) > 0) then - if(is_connected_to(det_buffer(1,1,i), microlist(1,1,ptr_microlist(smallerlist)), Nint, N_microlist(smallerlist))) then - cycle - end if - end if - - if(N_microlist(0) > 0) then - if(is_connected_to(det_buffer(1,1,i), microlist, Nint, N_microlist(0))) then - cycle - end if - end if - - ! Select determinants that are triple or quadruple excitations - ! from the ref - good = .True. - call get_excitation_degree_vector(psi_ref,det_buffer(1,1,i),degree,Nint,N_det_ref,idx) - !good=(idx(0) == 0) tant que degree > 2 pas retourné par get_excitation_degree_vector - do k=1,idx(0) - if (degree(k) < 3) then - good = .False. - exit - endif - enddo - if (good) then - if (.not. is_in_wavefunction(det_buffer(1,1,i),Nint)) then - N_tq += 1 - do k=1,N_int - tq(k,1,N_tq) = det_buffer(k,1,i) - tq(k,2,N_tq) = det_buffer(k,2,i) - enddo - endif - endif - enddo i_loop -end - - - - - - diff --git a/plugins/MRCC_Utils/mrcc_utils.irp.f b/plugins/MRCC_Utils/mrcc_utils.irp.f deleted file mode 100644 index dc739c75..00000000 --- a/plugins/MRCC_Utils/mrcc_utils.irp.f +++ /dev/null @@ -1,1033 +0,0 @@ -use bitmasks - -BEGIN_PROVIDER [ integer, mrmode ] - mrmode = 0 -END_PROVIDER - - - - BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states, N_det_non_ref) ] -&BEGIN_PROVIDER [ integer, lambda_mrcc_pt2, (0:psi_det_size) ] -&BEGIN_PROVIDER [ integer, lambda_mrcc_kept, (0:psi_det_size) ] - implicit none - BEGIN_DOC - ! cm/ or perturbative 1/Delta_E(m) - END_DOC - integer :: i,k - double precision :: ihpsi_current(N_states) - integer :: i_pert_count - double precision :: hii, lambda_pert - integer :: N_lambda_mrcc_pt2, N_lambda_mrcc_pt3 - - i_pert_count = 0 - lambda_mrcc = 0.d0 - N_lambda_mrcc_pt2 = 0 - N_lambda_mrcc_pt3 = 0 - lambda_mrcc_pt2(0) = 0 - lambda_mrcc_kept(0) = 0 - - do i=1,N_det_non_ref - call i_h_psi(psi_non_ref(1,1,i), psi_ref, psi_ref_coef, N_int, N_det_ref,& - size(psi_ref_coef,1), N_states,ihpsi_current) - call i_H_j(psi_non_ref(1,1,i),psi_non_ref(1,1,i),N_int,hii) - do k=1,N_states - if (ihpsi_current(k) == 0.d0) then - ihpsi_current(k) = 1.d-32 - endif -! lambda_mrcc(k,i) = psi_non_ref_coef(i,k)/ihpsi_current(k) - lambda_mrcc(k,i) = min(-1.d-32,psi_non_ref_coef(i,k)/ihpsi_current(k) ) - lambda_pert = 1.d0 / (psi_ref_energy_diagonalized(k)-hii) - if (lambda_pert / lambda_mrcc(k,i) < 0.5d0) then - ! Ignore lamdba - i_pert_count += 1 - lambda_mrcc(k,i) = 0.d0 - if (lambda_mrcc_pt2(N_lambda_mrcc_pt2) /= i) then - N_lambda_mrcc_pt2 += 1 - lambda_mrcc_pt2(N_lambda_mrcc_pt2) = i - endif - else - ! Keep lamdba - if (lambda_mrcc_kept(N_lambda_mrcc_pt3) /= i) then - N_lambda_mrcc_pt3 += 1 - lambda_mrcc_kept(N_lambda_mrcc_pt3) = i - endif - endif - enddo - enddo - lambda_mrcc_pt2(0) = N_lambda_mrcc_pt2 - lambda_mrcc_kept(0) = N_lambda_mrcc_pt3 - print*,'N_det_non_ref = ',N_det_non_ref - print*,'psi_coef_ref_ratio = ',psi_ref_coef(2,1)/psi_ref_coef(1,1) - print*,'lambda max = ',maxval(dabs(lambda_mrcc)) - print*,'Number of ignored determinants = ',i_pert_count - -END_PROVIDER - -! BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states, N_det_non_ref) ] -!&BEGIN_PROVIDER [ integer, lambda_mrcc_pt2, (0:psi_det_size) ] -!&BEGIN_PROVIDER [ integer, lambda_mrcc_kept, (0:psi_det_size) ] -!&BEGIN_PROVIDER [ double precision, lambda_pert, (N_states, N_det_non_ref) ] -! implicit none -! BEGIN_DOC -! ! cm/ or perturbative 1/Delta_E(m) -! END_DOC -! integer :: i,k -! double precision :: ihpsi_current(N_states) -! integer :: i_pert_count -! double precision :: hii, E2(N_states), E2var(N_states) -! integer :: N_lambda_mrcc_pt2, N_lambda_mrcc_pt3 -! -! i_pert_count = 0 -! lambda_mrcc = 0.d0 -! N_lambda_mrcc_pt2 = 0 -! N_lambda_mrcc_pt3 = 0 -! lambda_mrcc_pt2(0) = 0 -! lambda_mrcc_kept(0) = 0 -! -! E2 = 0.d0 -! E2var = 0.d0 -! do i=1,N_det_non_ref -! call i_h_psi(psi_non_ref(1,1,i), psi_ref, psi_ref_coef, N_int, N_det_ref,& -! size(psi_ref_coef,1), N_states,ihpsi_current) -! call i_H_j(psi_non_ref(1,1,i),psi_non_ref(1,1,i),N_int,hii) -! do k=1,N_states -! if (ihpsi_current(k) == 0.d0) then -! ihpsi_current(k) = 1.d-32 -! endif -! lambda_mrcc(k,i) = psi_non_ref_coef(i,k)/ihpsi_current(k) -! lambda_pert(k,i) = 1.d0 / (psi_ref_energy_diagonalized(k)-hii) -! E2(k) += ihpsi_current(k)*ihpsi_current(k) / (psi_ref_energy_diagonalized(k)-hii) -! E2var(k) += ihpsi_current(k) * psi_non_ref_coef(i,k) -! enddo -! enddo -! -! do i=1,N_det_non_ref -! call i_h_psi(psi_non_ref(1,1,i), psi_ref, psi_ref_coef, N_int, N_det_ref,& -! size(psi_ref_coef,1), N_states,ihpsi_current) -! call i_H_j(psi_non_ref(1,1,i),psi_non_ref(1,1,i),N_int,hii) -! do k=1,N_states -! if (ihpsi_current(k) == 0.d0) then -! ihpsi_current(k) = 1.d-32 -! endif -! lambda_mrcc(k,i) = psi_non_ref_coef(i,k)/ihpsi_current(k) -! lambda_pert(k,i) = 1.d0 / (psi_ref_energy_diagonalized(k)-hii) * E2var(k)/E2(k) -! enddo -! enddo -! lambda_mrcc_pt2(0) = N_lambda_mrcc_pt2 -! lambda_mrcc_kept(0) = N_lambda_mrcc_pt3 -! print*,'N_det_non_ref = ',N_det_non_ref -! print*,'psi_coef_ref_ratio = ',psi_ref_coef(2,1)/psi_ref_coef(1,1) -! print*,'lambda max = ',maxval(dabs(lambda_mrcc)) -! print*,'Number of ignored determinants = ',i_pert_count -! -!END_PROVIDER - - - -BEGIN_PROVIDER [ double precision, hij_mrcc, (N_det_non_ref,N_det_ref) ] - implicit none - BEGIN_DOC - ! < ref | H | Non-ref > matrix - END_DOC - integer :: i_I, k_sd - do i_I=1,N_det_ref - do k_sd=1,N_det_non_ref - call i_h_j(psi_ref(1,1,i_I),psi_non_ref(1,1,k_sd),N_int,hij_mrcc(k_sd,i_I)) - enddo - enddo - -END_PROVIDER - - - - -logical function is_generable(det1, det2, Nint) - use bitmasks - implicit none - integer, intent(in) :: Nint - integer(bit_kind) :: det1(Nint, 2), det2(Nint, 2) - integer :: degree, f, exc(0:2, 2, 2), t - integer :: h1, h2, p1, p2, s1, s2 - integer, external :: searchExc - logical, external :: excEq - double precision :: phase - integer :: tmp_array(4) - - is_generable = .false. - call get_excitation(det1, det2, exc, degree, phase, Nint) - if(degree == -1) return - if(degree == 0) then - is_generable = .true. - return - end if - if(degree > 2) stop "?22??" - - call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) - - if(degree == 1) then - h2 = h1 - p2 = p1 - s2 = s1 - h1 = 0 - p1 = 0 - s1 = 0 - end if - - if(h1 + (s1-1)*mo_tot_num < h2 + (s2-1)*mo_tot_num) then - tmp_array = (/s1, h1, s2, h2/) - else - tmp_array = (/s2, h2, s1, h1/) - end if - f = searchExc(hh_exists(1,1), tmp_array, hh_shortcut(0)) - - if(p1 + (s1-1)*mo_tot_num < p2 + (s2-1)*mo_tot_num) then - tmp_array = (/s1, p1, s2, p2/) - else - tmp_array = (/s2, p2, s1, p1/) - end if - if (f /= -1) then - f = searchExc(pp_exists(1,hh_shortcut(f)), tmp_array, hh_shortcut(f+1)-hh_shortcut(f)) - endif - - is_generable = (f /= -1) -end function - - - -integer function searchDet(dets, det, n, Nint) - implicit none - use bitmasks - - integer(bit_kind),intent(in) :: dets(Nint,2,n), det(Nint,2) - integer, intent(in) :: nint, n - integer :: l, h, c - integer, external :: detCmp - logical, external :: detEq - - l = 1 - h = n - do while(.true.) - searchDet = (l+h)/2 - c = detCmp(dets(1,1,searchDet), det(1,1), Nint) - if(c == 0) then - return - else if(c == 1) then - h = searchDet-1 - else - l = searchDet+1 - end if - if(l > h) then - searchDet = -1 - return - end if - - end do -end function - - -integer function unsortedSearchDet(dets, det, n, Nint) - implicit none - use bitmasks - - integer(bit_kind),intent(in) :: dets(Nint,2,n), det(Nint,2) - integer, intent(in) :: nint, n - integer :: l, h, c - integer, external :: detCmp - logical, external :: detEq - - do l=1, n - if(detEq(det, dets(1,1,l), N_int)) then - unsortedSearchDet = l - return - end if - end do - unsortedSearchDet = -1 -end function - - -integer function searchExc(excs, exc, n) - implicit none - use bitmasks - - integer, intent(in) :: n - integer,intent(in) :: excs(4,n), exc(4) - integer :: l, h, c - integer, external :: excCmp - logical, external :: excEq - - l = 1 - h = n - do - searchExc = (l+h)/2 - c = excCmp(excs(1,searchExc), exc(1)) - if(c == 0) return - if(c == 1) then - h = searchExc-1 - else - l = searchExc+1 - end if - if(l > h) then - searchExc = -1 - return - end if - end do -end function - - -subroutine sort_det(key, idx, N_key, Nint) - implicit none - - - integer, intent(in) :: Nint, N_key - integer(8),intent(inout) :: key(Nint,2,N_key) - integer,intent(inout) :: idx(N_key) - integer(8) :: tmp(Nint, 2) - integer :: tmpidx,i,ni - - do i=1,N_key - idx(i) = i - end do - - do i=N_key/2,1,-1 - call tamiser(key, idx, i, N_key, Nint, N_key) - end do - - do i=N_key,2,-1 - do ni=1,Nint - tmp(ni,1) = key(ni,1,i) - tmp(ni,2) = key(ni,2,i) - key(ni,1,i) = key(ni,1,1) - key(ni,2,i) = key(ni,2,1) - key(ni,1,1) = tmp(ni,1) - key(ni,2,1) = tmp(ni,2) - enddo - - tmpidx = idx(i) - idx(i) = idx(1) - idx(1) = tmpidx - call tamiser(key, idx, 1, i-1, Nint, N_key) - end do -end subroutine - - -subroutine sort_exc(key, N_key) - implicit none - - - integer, intent(in) :: N_key - integer,intent(inout) :: key(4,N_key) - integer :: tmp(4) - integer :: i,ni - - - do i=N_key/2,1,-1 - call tamise_exc(key, i, N_key, N_key) - end do - - do i=N_key,2,-1 - do ni=1,4 - tmp(ni) = key(ni,i) - key(ni,i) = key(ni,1) - key(ni,1) = tmp(ni) - enddo - - call tamise_exc(key, 1, i-1, N_key) - end do -end subroutine - - -logical function exc_inf(exc1, exc2) - implicit none - integer,intent(in) :: exc1(4), exc2(4) - integer :: i - exc_inf = .false. - do i=1,4 - if(exc1(i) < exc2(i)) then - exc_inf = .true. - return - else if(exc1(i) > exc2(i)) then - return - end if - end do -end function - - -subroutine tamise_exc(key, no, n, N_key) - use bitmasks - implicit none - - BEGIN_DOC -! Uncodumented : TODO - END_DOC - integer,intent(in) :: no, n, N_key - integer,intent(inout) :: key(4, N_key) - integer :: k,j - integer :: tmp(4) - logical :: exc_inf - integer :: ni - - k = no - j = 2*k - do while(j <= n) - if(j < n) then - if (exc_inf(key(1,j), key(1,j+1))) then - j = j+1 - endif - endif - if(exc_inf(key(1,k), key(1,j))) then - do ni=1,4 - tmp(ni) = key(ni,k) - key(ni,k) = key(ni,j) - key(ni,j) = tmp(ni) - enddo - k = j - j = k+k - else - return - endif - enddo -end subroutine - - -subroutine dec_exc(exc, h1, h2, p1, p2) - implicit none - integer, intent(in) :: exc(0:2,2,2) - integer, intent(out) :: h1, h2, p1, p2 - integer :: degree, s1, s2 - - degree = exc(0,1,1) + exc(0,1,2) - - h1 = 0 - h2 = 0 - p1 = 0 - p2 = 0 - - if(degree == 0) return - - call decode_exc(exc, degree, h1, p1, h2, p2, s1, s2) - - h1 += mo_tot_num * (s1-1) - p1 += mo_tot_num * (s1-1) - - if(degree == 2) then - h2 += mo_tot_num * (s2-1) - p2 += mo_tot_num * (s2-1) - if(h1 > h2) then - s1 = h1 - h1 = h2 - h2 = s1 - end if - if(p1 > p2) then - s1 = p1 - p1 = p2 - p2 = s1 - end if - else - h2 = h1 - p2 = p1 - p1 = 0 - h1 = 0 - end if -end subroutine - - - BEGIN_PROVIDER [ integer, N_hh_exists ] -&BEGIN_PROVIDER [ integer, N_pp_exists ] -&BEGIN_PROVIDER [ integer, N_ex_exists ] - implicit none - integer :: exc(0:2, 2, 2), degree, n, on, s, l, i - integer :: h1, h2, p1, p2 - double precision :: phase - logical,allocatable :: hh(:,:) , pp(:,:) - - allocate(hh(0:mo_tot_num*2, 0:mo_tot_num*2)) - allocate(pp(0:mo_tot_num*2, 0:mo_tot_num*2)) - hh = .false. - pp = .false. - N_hh_exists = 0 - N_pp_exists = 0 - N_ex_exists = 0 - - n = 0 - !TODO Openmp - do i=1, N_det_ref - do l=1, N_det_non_ref - call get_excitation(psi_ref(1,1,i), psi_non_ref(1,1,l), exc, degree, phase, N_int) - if(degree == -1) cycle - call dec_exc(exc, h1, h2, p1, p2) - N_ex_exists += 1 - if(.not. hh(h1,h2)) N_hh_exists = N_hh_exists + 1 - if(.not. pp(p1,p2)) N_pp_exists = N_pp_exists + 1 - hh(h1,h2) = .true. - pp(p1,p2) = .true. - end do - end do - N_pp_exists = min(N_ex_exists, N_pp_exists * N_hh_exists) -END_PROVIDER - - - - BEGIN_PROVIDER [ integer(bit_kind), psi_non_ref_sorted, (N_int, 2, N_det_non_ref) ] -&BEGIN_PROVIDER [ integer, psi_non_ref_sorted_idx, (N_det_non_ref) ] - implicit none - psi_non_ref_sorted = psi_non_ref - call sort_det(psi_non_ref_sorted, psi_non_ref_sorted_idx, N_det_non_ref, N_int) -END_PROVIDER - - - BEGIN_PROVIDER [ double precision, dIj_unique, (hh_nex, N_states) ] -&BEGIN_PROVIDER [ double precision, rho_mrcc, (N_det_non_ref, N_states) ] - implicit none - logical :: ok - integer :: i, j, k, s, II, pp, ppp, hh, ind, wk, a_col, at_row - integer, external :: searchDet, unsortedSearchDet - integer(bit_kind) :: myDet(N_int, 2), myMask(N_int, 2) - integer :: N, INFO, r1, r2 - double precision , allocatable :: AtB(:), x(:), x_new(:), A_val_mwen(:,:), t(:) - double precision :: norm, cx, res - integer, allocatable :: lref(:), A_ind_mwen(:) - double precision :: phase - - - double precision, allocatable :: rho_mrcc_inact(:) - integer :: a_coll, at_roww - - print *, "TI", hh_nex, N_det_non_ref - - allocate(rho_mrcc_inact(N_det_non_ref)) - allocate(x_new(hh_nex)) - allocate(x(hh_nex), AtB(hh_nex)) - - do s=1,N_states - - AtB(:) = 0.d0 - !$OMP PARALLEL default(none) shared(k, psi_non_ref_coef, active_excitation_to_determinants_idx,& - !$OMP active_excitation_to_determinants_val, N_det_ref, hh_nex, N_det_non_ref) & - !$OMP private(at_row, a_col, i, j, r1, r2, wk, A_ind_mwen, A_val_mwen, a_coll, at_roww)& - !$OMP shared(N_states,mrcc_col_shortcut, mrcc_N_col, AtB, mrcc_AtA_val, mrcc_AtA_ind, s, n_exc_active, active_pp_idx) - - !$OMP DO schedule(static, 100) - do at_roww = 1, n_exc_active ! hh_nex - at_row = active_pp_idx(at_roww) - do i=1,active_excitation_to_determinants_idx(0,at_roww) - AtB(at_row) = AtB(at_row) + psi_non_ref_coef(active_excitation_to_determinants_idx(i, at_roww), s) * active_excitation_to_determinants_val(s,i, at_roww) - end do - end do - !$OMP END DO - - !$OMP END PARALLEL - - X(:) = 0d0 - - - do a_coll = 1, n_exc_active - a_col = active_pp_idx(a_coll) - X(a_col) = AtB(a_col) - end do - - rho_mrcc_inact(:) = 0d0 - - allocate(lref(N_det_ref)) - do hh = 1, hh_shortcut(0) - do pp = hh_shortcut(hh), hh_shortcut(hh+1)-1 - if(is_active_exc(pp)) cycle - lref = 0 - AtB(pp) = 0.d0 - do II=1,N_det_ref - call apply_hole_local(psi_ref(1,1,II), hh_exists(1, hh), myMask, ok, N_int) - if(.not. ok) cycle - call apply_particle_local(myMask, pp_exists(1, pp), myDet, ok, N_int) - if(.not. ok) cycle - ind = searchDet(psi_non_ref_sorted(1,1,1), myDet(1,1), N_det_non_ref, N_int) - if(ind == -1) cycle - ind = psi_non_ref_sorted_idx(ind) - call get_phase(myDet(1,1), psi_ref(1,1,II), phase, N_int) - AtB(pp) += psi_non_ref_coef(ind, s) * psi_ref_coef(II, s) * phase - lref(II) = ind - if(phase < 0.d0) lref(II) = -ind - end do - X(pp) = AtB(pp) - do II=1,N_det_ref - if(lref(II) > 0) then - rho_mrcc_inact(lref(II)) = psi_ref_coef(II,s) * X(pp) - else if(lref(II) < 0) then - rho_mrcc_inact(-lref(II)) = -psi_ref_coef(II,s) * X(pp) - end if - end do - end do - end do - deallocate(lref) - - x_new = x - - double precision :: factor, resold - factor = 1.d0 - resold = huge(1.d0) - - do k=0,hh_nex/4 - res = 0.d0 - do a_coll = 1, n_exc_active - a_col = active_pp_idx(a_coll) - cx = 0.d0 - do i=mrcc_col_shortcut(a_coll), mrcc_col_shortcut(a_coll) + mrcc_N_col(a_coll) - 1 - cx = cx + x(mrcc_AtA_ind(i)) * mrcc_AtA_val(s,i) - end do - x_new(a_col) = AtB(a_col) + cx * factor - res = res + (X_new(a_col) - X(a_col))*(X_new(a_col) - X(a_col)) - X(a_col) = X_new(a_col) - end do - - if (res > resold) then - factor = factor * 0.5d0 - endif - - if(iand(k, 127) == 0) then - print *, k, res, 1.d0 - res/resold - endif - - if ( res < 1d-10 ) then - exit - endif - if ( (res/resold > 0.99d0) ) then - exit - endif - resold = res - - end do - dIj_unique(1:size(X), s) = X(1:size(X)) - print *, k, res, 1.d0 - res/resold - - - do i=1,N_det_non_ref - rho_mrcc(i,s) = 0.d0 - enddo - - do a_coll=1,n_exc_active - a_col = active_pp_idx(a_coll) - do j=1,N_det_non_ref - i = active_excitation_to_determinants_idx(j,a_coll) - if (i==0) exit - if (rho_mrcc_inact(i) /= 0.d0) then - call debug_det(psi_non_ref(1,1,i),N_int) - stop - endif - rho_mrcc(i,s) = rho_mrcc(i,s) + active_excitation_to_determinants_val(s,j,a_coll) * dIj_unique(a_col,s) - enddo - end do - - double precision :: norm2_ref, norm2_inact, a, b, c, Delta - ! Psi = Psi_ref + Psi_inactive + f*Psi_active - ! Find f to normalize Psi - - norm2_ref = 0.d0 - do i=1,N_det_ref - norm2_ref = norm2_ref + psi_ref_coef(i,s)*psi_ref_coef(i,s) - enddo - - a = 0.d0 - do i=1,N_det_non_ref - a = a + rho_mrcc(i,s)*rho_mrcc(i,s) - enddo - - norm = a + norm2_ref - print *, "norm : ", sqrt(norm) - - norm = sqrt((1.d0-norm2_ref)/a) - - ! Renormalize Psi+A.X - do i=1,N_det_non_ref - rho_mrcc(i,s) = rho_mrcc(i,s) * norm - enddo - -!norm = norm2_ref -!do i=1,N_det_non_ref -! norm = norm + rho_mrcc(i,s)**2 -!enddo -!print *, 'check', norm -!stop - - - - norm = 0.d0 - double precision :: f, g, gmax - gmax = maxval(dabs(psi_non_ref_coef(:,s))) - do i=1,N_det_non_ref - if (lambda_type == 2) then - f = 1.d0 - else - if (rho_mrcc(i,s) == 0.d0) then - cycle - endif - ! f is such that f.\tilde{c_i} = c_i - f = psi_non_ref_coef(i,s) / rho_mrcc(i,s) - - ! Avoid numerical instabilities - g = 2.d0+100.d0*exp(-20.d0*dabs(psi_non_ref_coef(i,s)/gmax)) - f = min(f, g) - f = max(f,-g) - - endif - - norm = norm + (rho_mrcc(i,s)*f)**2 - rho_mrcc(i,s) = f - enddo - ! rho_mrcc now contains the mu_i factors - - print *, 'norm of |T Psi_0> = ', dsqrt(norm) - if (norm > 1.d0) then - stop 'Error : Norm of the SD larger than the norm of the reference.' - endif - - end do - -END_PROVIDER - - - - -BEGIN_PROVIDER [ double precision, dij, (N_det_ref, N_det_non_ref, N_states) ] - integer :: s,i,j - double precision, external :: get_dij_index - print *, "computing amplitudes..." - do s=1, N_states - do i=1, N_det_non_ref - do j=1, N_det_ref - !DIR$ FORCEINLINE - dij(j, i, s) = get_dij_index(j, i, s, N_int) - end do - end do - end do - print *, "done computing amplitudes" -END_PROVIDER - - - -!double precision function f_fit(x) -! implicit none -! double precision :: x -! f_fit = 0.d0 -! return -! if (x < 0.d0) then -! f_fit = 0.d0 -! else if (x < 1.d0) then -! f_fit = 1.d0/0.367879441171442 * ( x**2 * exp(-x**2)) -! else -! f_fit = 1.d0 -! endif -!end -! -!double precision function get_dij_index(II, i, s, Nint) -! integer, intent(in) :: II, i, s, Nint -! double precision, external :: get_dij -! double precision :: HIi, phase, c, a, b, d -! -! call i_h_j(psi_ref(1,1,II), psi_non_ref(1,1,i), Nint, HIi) -! call get_phase(psi_ref(1,1,II), psi_non_ref(1,1,i), phase, N_int) -! -! a = lambda_pert(s,i) -! b = lambda_mrcc(s,i) -! c = f_fit(a/b) -! -! d = get_dij(psi_ref(1,1,II), psi_non_ref(1,1,i), s, Nint) * phase* rho_mrcc(i,s) -! -! c = f_fit(a*HIi/d) -! -! get_dij_index = HIi * a * c + (1.d0 - c) * d -! get_dij_index = d -! return -! -! if(lambda_type == 0) then -! call get_phase(psi_ref(1,1,II), psi_non_ref(1,1,i), phase, N_int) -! get_dij_index = get_dij(psi_ref(1,1,II), psi_non_ref(1,1,i), s, Nint) * phase -! get_dij_index = get_dij_index * rho_mrcc(i,s) -! else if(lambda_type == 1) then -! call i_h_j(psi_ref(1,1,II), psi_non_ref(1,1,i), Nint, HIi) -! get_dij_index = HIi * lambda_mrcc(s, i) -! else if(lambda_type == 2) then -! call get_phase(psi_ref(1,1,II), psi_non_ref(1,1,i), phase, N_int) -! get_dij_index = get_dij(psi_ref(1,1,II), psi_non_ref(1,1,i), s, Nint) * phase -! get_dij_index = get_dij_index * rho_mrcc(i,s) -! end if -!end function - -double precision function get_dij_index(II, i, s, Nint) - integer, intent(in) :: II, i, s, Nint - double precision, external :: get_dij - double precision :: HIi, phase - - if(lambda_type == 0) then - call get_phase(psi_ref(1,1,II), psi_non_ref(1,1,i), phase, N_int) - get_dij_index = get_dij(psi_ref(1,1,II), psi_non_ref(1,1,i), s, Nint) * phase - get_dij_index = get_dij_index * rho_mrcc(i,s) - else if(lambda_type == 1) then - call i_h_j(psi_ref(1,1,II), psi_non_ref(1,1,i), Nint, HIi) - get_dij_index = HIi * lambda_mrcc(s, i) - else if(lambda_type == 2) then - call get_phase(psi_ref(1,1,II), psi_non_ref(1,1,i), phase, N_int) - get_dij_index = get_dij(psi_ref(1,1,II), psi_non_ref(1,1,i), s, Nint) * phase - get_dij_index = get_dij_index * rho_mrcc(i,s) - end if -end function - - -double precision function get_dij(det1, det2, s, Nint) - use bitmasks - implicit none - integer, intent(in) :: s, Nint - integer(bit_kind) :: det1(Nint, 2), det2(Nint, 2) - integer :: degree, f, exc(0:2, 2, 2), t - integer :: h1, h2, p1, p2, s1, s2 - integer, external :: searchExc - logical, external :: excEq - double precision :: phase - integer :: tmp_array(4) - - get_dij = 0d0 - call get_excitation(det1, det2, exc, degree, phase, Nint) - if(degree == -1) return - if(degree == 0) then - stop "get_dij" - end if - - call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) - - if(degree == 1) then - h2 = h1 - p2 = p1 - s2 = s1 - h1 = 0 - p1 = 0 - s1 = 0 - end if - - if(h1 + (s1-1)*mo_tot_num < h2 + (s2-1)*mo_tot_num) then - tmp_array = (/s1, h1, s2, h2/) - else - tmp_array = (/s2, h2, s1, h1/) - end if - f = searchExc(hh_exists(1,1), tmp_array, hh_shortcut(0)) - - if(f == -1) return - - if(p1 + (s1-1)*mo_tot_num < p2 + (s2-1)*mo_tot_num) then - tmp_array = (/s1, p1, s2, p2/) - else - tmp_array = (/s2, p2, s1, p1/) - end if - t = searchExc(pp_exists(1,hh_shortcut(f)), tmp_array, hh_shortcut(f+1)-hh_shortcut(f)) - - if(t /= -1) then - get_dij = dIj_unique(t - 1 + hh_shortcut(f), s) - end if -end function - - - BEGIN_PROVIDER [ integer, hh_exists, (4, N_hh_exists) ] -&BEGIN_PROVIDER [ integer, pp_exists, (4, N_pp_exists) ] -&BEGIN_PROVIDER [ integer, hh_shortcut, (0:N_hh_exists + 1) ] -&BEGIN_PROVIDER [ integer, hh_nex ] - implicit none - BEGIN_DOC - ! - ! hh_exists : - ! - ! pp_exists : - ! - ! hh_shortcut : - ! - ! hh_nex : Total number of excitation operators - ! - END_DOC - integer,allocatable :: num(:,:) - integer :: exc(0:2, 2, 2), degree, n, on, s, l, i - integer :: h1, h2, p1, p2 - double precision :: phase - logical, external :: excEq - - allocate(num(4, N_ex_exists+1)) - - hh_shortcut = 0 - hh_exists = 0 - pp_exists = 0 - num = 0 - - n = 0 - do i=1, N_det_ref - do l=1, N_det_non_ref - call get_excitation(psi_ref(1,1,i), psi_non_ref(1,1,l), exc, degree, phase, N_int) - if(degree == -1) cycle - call dec_exc(exc, h1, h2, p1, p2) - n += 1 - num(:, n) = (/h1, h2, p1, p2/) - end do - end do - - call sort_exc(num, n) - - hh_shortcut(0) = 1 - hh_shortcut(1) = 1 - hh_exists(:,1) = (/1, num(1,1), 1, num(2,1)/) - pp_exists(:,1) = (/1, num(3,1), 1, num(4,1)/) - s = 1 - do i=2,n - if(.not. excEq(num(1,i), num(1,s))) then - s += 1 - num(:, s) = num(:, i) - pp_exists(:,s) = (/1, num(3,s), 1, num(4,s)/) - if(hh_exists(2, hh_shortcut(0)) /= num(1,s) .or. & - hh_exists(4, hh_shortcut(0)) /= num(2,s)) then - hh_shortcut(0) += 1 - hh_shortcut(hh_shortcut(0)) = s - hh_exists(:,hh_shortcut(0)) = (/1, num(1,s), 1, num(2,s)/) - end if - end if - end do - hh_shortcut(hh_shortcut(0)+1) = s+1 - - if (hh_shortcut(0) > N_hh_exists) then - print *, 'Error in ', irp_here - print *, 'hh_shortcut(0) :', hh_shortcut(0) - print *, 'N_hh_exists : ', N_hh_exists - print *, 'Is your active space defined?' - stop - endif - - if (hh_shortcut(hh_shortcut(0)+1)-1 > N_pp_exists) then - print *, 'Error 1 in ', irp_here - print *, 'hh_shortcut(hh_shortcut(0)+1)-1 :', hh_shortcut(hh_shortcut(0)+1)-1 - print *, 'N_pp_exists : ', N_pp_exists - print *, 'Is your active space defined?' - stop - endif - - do s=2,4,2 - do i=1,hh_shortcut(0) - if(hh_exists(s, i) == 0) then - hh_exists(s-1, i) = 0 - else if(hh_exists(s, i) > mo_tot_num) then - hh_exists(s, i) -= mo_tot_num - hh_exists(s-1, i) = 2 - end if - end do - - - do i=1,hh_shortcut(hh_shortcut(0)+1)-1 - if(pp_exists(s, i) == 0) then - pp_exists(s-1, i) = 0 - else if(pp_exists(s, i) > mo_tot_num) then - pp_exists(s, i) -= mo_tot_num - pp_exists(s-1, i) = 2 - end if - end do - end do - hh_nex = hh_shortcut(hh_shortcut(0)+1)-1 -END_PROVIDER - - -logical function excEq(exc1, exc2) - implicit none - integer, intent(in) :: exc1(4), exc2(4) - integer :: i - excEq = .false. - do i=1, 4 - if(exc1(i) /= exc2(i)) return - end do - excEq = .true. -end function - - -integer function excCmp(exc1, exc2) - implicit none - integer, intent(in) :: exc1(4), exc2(4) - integer :: i - excCmp = 0 - do i=1, 4 - if(exc1(i) > exc2(i)) then - excCmp = 1 - return - else if(exc1(i) < exc2(i)) then - excCmp = -1 - return - end if - end do -end function - - -subroutine apply_hole_local(det, exc, res, ok, Nint) - use bitmasks - implicit none - integer, intent(in) :: Nint - integer, intent(in) :: exc(4) - integer :: s1, s2, h1, h2 - integer(bit_kind),intent(in) :: det(Nint, 2) - integer(bit_kind),intent(out) :: res(Nint, 2) - logical, intent(out) :: ok - integer :: ii, pos - - ok = .false. - s1 = exc(1) - h1 = exc(2) - s2 = exc(3) - h2 = exc(4) - res = det - - if(h1 /= 0) then - ii = (h1-1)/bit_kind_size + 1 - pos = iand(h1-1,bit_kind_size-1) ! mod 64 - if(iand(det(ii, s1), ishft(1_bit_kind, pos)) == 0_8) then - return - endif - res(ii, s1) = ibclr(res(ii, s1), pos) - end if - - ii = (h2-1)/bit_kind_size + 1 - pos = iand(h2-1,bit_kind_size-1) ! mod 64 - if(iand(det(ii, s2), ishft(1_bit_kind, pos)) == 0_8) then - return - endif - res(ii, s2) = ibclr(res(ii, s2), pos) - ok = .true. -end subroutine - - -subroutine apply_particle_local(det, exc, res, ok, Nint) - use bitmasks - implicit none - integer, intent(in) :: Nint - integer, intent(in) :: exc(4) - integer :: s1, s2, p1, p2 - integer(bit_kind),intent(in) :: det(Nint, 2) - integer(bit_kind),intent(out) :: res(Nint, 2) - logical, intent(out) :: ok - integer :: ii, pos - - ok = .false. - s1 = exc(1) - p1 = exc(2) - s2 = exc(3) - p2 = exc(4) - res = det - - if(p1 /= 0) then - ii = (p1-1)/bit_kind_size + 1 - pos = iand(p1-1,bit_kind_size-1) - if(iand(det(ii, s1), ishft(1_bit_kind, pos)) /= 0_8) then - return - endif - res(ii, s1) = ibset(res(ii, s1), pos) - end if - - ii = (p2-1)/bit_kind_size + 1 - pos = iand(p2-1,bit_kind_size-1) - if(iand(det(ii, s2), ishft(1_bit_kind, pos)) /= 0_8) then - return - endif - res(ii, s2) = ibset(res(ii, s2), pos) - - - ok = .true. -end subroutine - - - - diff --git a/plugins/MRCC_Utils/tree_dependency.png b/plugins/MRCC_Utils/tree_dependency.png deleted file mode 100644 index 3c535b5c..00000000 Binary files a/plugins/MRCC_Utils/tree_dependency.png and /dev/null differ diff --git a/plugins/Molden/.gitignore b/plugins/Molden/.gitignore new file mode 100644 index 00000000..4302ee4e --- /dev/null +++ b/plugins/Molden/.gitignore @@ -0,0 +1,19 @@ +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Electrons +Ezfio_files +IRPF90_man +IRPF90_temp +MO_Basis +MPI +Makefile +Makefile.depend +Nuclei +Utils +ezfio_interface.irp.f +irpf90.make +irpf90_entities +print_mo +tags \ No newline at end of file diff --git a/plugins/Molden/tree_dependency.png b/plugins/Molden/tree_dependency.png deleted file mode 100644 index 0216e589..00000000 Binary files a/plugins/Molden/tree_dependency.png and /dev/null differ diff --git a/plugins/Orbital_Entanglement/tree_dependency b/plugins/Orbital_Entanglement/tree_dependency deleted file mode 100644 index a601745c..00000000 --- a/plugins/Orbital_Entanglement/tree_dependency +++ /dev/null @@ -1,21 +0,0 @@ -// ['Orbital_Entanglement'] -digraph { - Orbital_Entanglement [fontcolor=red] - Orbital_Entanglement -> Determinants - Determinants -> Integrals_Monoelec - Integrals_Monoelec -> MO_Basis - MO_Basis -> AO_Basis - AO_Basis -> Nuclei - Nuclei -> Ezfio_files - Nuclei -> Utils - MO_Basis -> Electrons - Electrons -> Ezfio_files - Integrals_Monoelec -> Pseudo - Pseudo -> Nuclei - Determinants -> Integrals_Bielec - Integrals_Bielec -> Pseudo - Integrals_Bielec -> Bitmask - Bitmask -> MO_Basis - Integrals_Bielec -> ZMQ - ZMQ -> Utils -} \ No newline at end of file diff --git a/plugins/Orbital_Entanglement/tree_dependency.png b/plugins/Orbital_Entanglement/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/Perturbation/tree_dependency.png b/plugins/Perturbation/tree_dependency.png deleted file mode 100644 index 166e8035..00000000 Binary files a/plugins/Perturbation/tree_dependency.png and /dev/null differ diff --git a/plugins/Properties/tree_dependency.png b/plugins/Properties/tree_dependency.png deleted file mode 100644 index bab94f08..00000000 Binary files a/plugins/Properties/tree_dependency.png and /dev/null differ diff --git a/plugins/Psiref_CAS/tree_dependency.png b/plugins/Psiref_CAS/tree_dependency.png deleted file mode 100644 index 5e496a28..00000000 Binary files a/plugins/Psiref_CAS/tree_dependency.png and /dev/null differ diff --git a/plugins/Psiref_Utils/NEEDED_CHILDREN_MODULES b/plugins/Psiref_Utils/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 065099eb..00000000 --- a/plugins/Psiref_Utils/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -Bitmask Determinants diff --git a/plugins/Psiref_Utils/tree_dependency.png b/plugins/Psiref_Utils/tree_dependency.png deleted file mode 100644 index c527d617..00000000 Binary files a/plugins/Psiref_Utils/tree_dependency.png and /dev/null differ diff --git a/plugins/QMC/densify_coefmatrix.irp.f b/plugins/QMC/densify_coefmatrix.irp.f deleted file mode 100644 index 2e1894b2..00000000 --- a/plugins/QMC/densify_coefmatrix.irp.f +++ /dev/null @@ -1,8 +0,0 @@ -program densify - implicit none - read_wf = .True. - touch read_wf - call generate_all_alpha_beta_det_products() - call diagonalize_ci - call save_wavefunction -end diff --git a/plugins/QMC/save_for_qmcchem.irp.f b/plugins/QMC/save_for_qmcchem.irp.f deleted file mode 100644 index e9fa60c4..00000000 --- a/plugins/QMC/save_for_qmcchem.irp.f +++ /dev/null @@ -1,45 +0,0 @@ -program save_for_qmc - - integer :: iunit - logical :: exists - double precision :: e_ref - - ! Determinants - read_wf = .True. - TOUCH read_wf - print *, "N_det = ", N_det - call write_spindeterminants - - ! Reference Energy - if (do_pseudo) then - call write_pseudopotential - endif - call system( & - 'mkdir -p '//trim(ezfio_filename)//'/simulation ;' // & - 'cp '//trim(ezfio_filename)//'/.version '//trim(ezfio_filename)//'/simulation/.version ; ' // & - 'mkdir -p '//trim(ezfio_filename)//'/properties ;' // & - 'cp '//trim(ezfio_filename)//'/.version '//trim(ezfio_filename)//'/properties/.version ; ' // & - 'echo T > '//trim(ezfio_filename)//'/properties/e_loc' & - ) - iunit = 13 - open(unit=iunit,file=trim(ezfio_filename)//'/simulation/e_ref',action='write') - call ezfio_has_full_ci_zmq_energy_pt2(exists) - if (exists) then - call ezfio_get_full_ci_zmq_energy_pt2(e_ref) - else - call ezfio_has_full_ci_zmq_energy(exists) - if (exists) then - call ezfio_get_full_ci_zmq_energy(e_ref) - else - call ezfio_has_hartree_fock_energy(exists) - if (exists) then - call ezfio_get_hartree_fock_energy(e_ref) - else - e_ref = 0.d0 - endif - endif - endif - write(iunit,*) e_ref - close(iunit) - -end diff --git a/plugins/QMC/tree_dependency.png b/plugins/QMC/tree_dependency.png deleted file mode 100644 index 3b844e5c..00000000 Binary files a/plugins/QMC/tree_dependency.png and /dev/null differ diff --git a/plugins/Selectors_full/tree_dependency.png b/plugins/Selectors_full/tree_dependency.png deleted file mode 100644 index 66b2e88a..00000000 Binary files a/plugins/Selectors_full/tree_dependency.png and /dev/null differ diff --git a/plugins/Selectors_no_sorted/tree_dependency.png b/plugins/Selectors_no_sorted/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/SingleRefMethod/tree_dependency.png b/plugins/SingleRefMethod/tree_dependency.png deleted file mode 100644 index 2b7f777f..00000000 Binary files a/plugins/SingleRefMethod/tree_dependency.png and /dev/null differ diff --git a/plugins/Symmetry/NEEDED_CHILDREN_MODULES b/plugins/Symmetry/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 7ea84ba4..00000000 --- a/plugins/Symmetry/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -Bitmask Nuclei Determinants diff --git a/plugins/Symmetry/README.rst b/plugins/Symmetry/README.rst deleted file mode 100644 index ba643f88..00000000 --- a/plugins/Symmetry/README.rst +++ /dev/null @@ -1,12 +0,0 @@ -======== -Symmetry -======== - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. diff --git a/plugins/Symmetry/Symmetry.main.irp.f b/plugins/Symmetry/Symmetry.main.irp.f deleted file mode 100644 index ffce8082..00000000 --- a/plugins/Symmetry/Symmetry.main.irp.f +++ /dev/null @@ -1,28 +0,0 @@ -program Symmetry - implicit none - BEGIN_DOC -! TODO - END_DOC - integer :: i, j, k - character*8 :: sym - -do k=1,n_irrep - print *, sym_operation(k) - do i=1,mo_tot_num - print '(1000(F8.4,X))', mo_symm(i,:,k), sum(mo_symm(i,:,k)) - enddo - print *, '' -enddo - - print *, 'Molecule is linear: ', molecule_is_linear - print *, 'Has center of inversion: ', molecule_has_center_of_inversion - print *, 'Has S2n improper rotation: ', molecule_has_improper_rotation - print *, 'Symmetry rotation axis: ', sym_rotation_axis(:) - print *, 'Group: '//point_group - print *, 'Symmetry irreps : ', sym_irrep(1:n_irrep) - print *, 'Symmetry operations : ', sym_operation(1:n_irrep) - print *, 'Character table' - do i=1,n_irrep - print *, i, real(character_table(i,:)) - enddo -end diff --git a/plugins/Symmetry/aos.irp.f b/plugins/Symmetry/aos.irp.f deleted file mode 100644 index ed746a40..00000000 --- a/plugins/Symmetry/aos.irp.f +++ /dev/null @@ -1,131 +0,0 @@ -BEGIN_PROVIDER [ double precision, sym_box, (3,2) ] - implicit none - BEGIN_DOC - ! Opposite points of the box containing the molecule - END_DOC - integer :: i,xyz - sym_box(:,:) = 0.d0 - do xyz=1,3 - do i=1,nucl_num - sym_box(xyz,1) = min(sym_box(xyz,1), nucl_coord_sym(i,xyz)) - sym_box(xyz,2) = max(sym_box(xyz,2), nucl_coord_sym(i,xyz)) - enddo - enddo - sym_box(:,1) = sym_box(:,1) - 2.d0 - sym_box(:,2) = sym_box(:,2) + 2.d0 -END_PROVIDER - -subroutine generate_sym_coord(n_sym_points,result) - implicit none - integer, intent(in) :: n_sym_points - double precision, intent(out) :: result(3,n_sym_points) - BEGIN_DOC - ! xyz coordinates of points to check the symmetry, drawn uniformly in the molecular box. - END_DOC - integer :: i, iop - - double precision, external :: halton_ranf - do i=1,n_sym_points,n_irrep - result(1,i) = sym_box(1,1) + halton_ranf(1) * (sym_box(1,2)-sym_box(1,1)) - result(2,i) = sym_box(1,1) + halton_ranf(2) * (sym_box(2,2)-sym_box(2,1)) - result(3,i) = sym_box(1,1) + halton_ranf(3) * (sym_box(3,2)-sym_box(3,1)) - do iop=2,n_irrep - if (iop-1+i > n_sym_points) exit - call dgemm('N','N',3,1,3,1.d0,sym_transformation_matrices(1,1,iop), & - size(sym_transformation_matrices,1),& - result(1,i),size(result,1),0.d0,result(1,i+iop-1),size(result,1)) - enddo - enddo - -end - - -subroutine compute_sym_ao_values(sym_points, n_sym_points, result) - implicit none - BEGIN_DOC - ! Values of the AO symmetry functions - END_DOC - integer, intent(in) :: n_sym_points - double precision, intent(in) :: sym_points(3,n_sym_points) - double precision, intent(out) :: result(n_sym_points, ao_num) - integer :: i, j - double precision :: point(3) - double precision :: x, y, z - double precision :: x2, y2, z2 - integer :: k - - result (:,:) = 0.d0 - do j=1,ao_num - do i=1,n_sym_points - call point_to_input_orientation(sym_points(:,i), point) - x = point(1) - nucl_coord_transp(1,ao_nucl(j)) - y = point(2) - nucl_coord_transp(2,ao_nucl(j)) - z = point(3) - nucl_coord_transp(3,ao_nucl(j)) - x2 = x*x + y*y + z*z - result(i,j) = 0.d0 - do k=1,ao_prim_num(j) - result(i,j) += ao_coef_normalized_ordered_transp(k,j)*exp(-ao_expo_ordered_transp(k,j)*x2) - enddo - x = x**ao_power(j,1) - y = y**ao_power(j,2) - z = z**ao_power(j,3) - result(i,j) = x*y*z*result(i,j) - enddo - enddo - -end - -subroutine compute_sym_mo_values(sym_points, n_sym_points, result) - implicit none - BEGIN_DOC - ! Values of the MO symmetry functions - END_DOC - integer, intent(in) :: n_sym_points - double precision, intent(in) :: sym_points(3,n_sym_points) - double precision, intent(out) :: result(n_sym_points, mo_tot_num) - - double precision, allocatable :: tmp(:,:) - allocate(tmp(n_sym_points,ao_num)) - call compute_sym_ao_values(sym_points,n_sym_points,tmp) - call dgemm('N','N',n_sym_points,mo_tot_num,ao_num, & - 1.d0, tmp,size(tmp,1), mo_coef, size(mo_coef,1), & - 0.d0, result,size(result,1)) - deallocate(tmp) -end - - -subroutine compute_sym_det_values(sym_points, n_sym_points, result) - use bitmasks - implicit none - BEGIN_DOC - ! Values of the determinant symmetry functions - END_DOC - integer, intent(in) :: n_sym_points - double precision, intent(in) :: sym_points(3,n_sym_points) - double precision, intent(out) :: result(n_sym_points, N_det) - - integer :: list(N_int*bit_kind_size,2) - integer :: n_elements(2) - - integer :: i, j, imo - - double precision, allocatable :: tmp(:,:) - - allocate(tmp(n_sym_points,mo_tot_num)) - call compute_sym_mo_values(sym_points, n_sym_points, tmp) - - result = 1.d0 - do i=1,N_det - call bitstring_to_list_ab(psi_det(1,1,i), list, n_elements, N_int) - do j=1,n_elements(1) - imo = list(j,1) - result(:,i) *= tmp(:,imo) - enddo - do j=1,n_elements(2) - imo = list(j,2) - result(:,i) *= tmp(:,imo) - enddo - enddo - - deallocate(tmp) -end diff --git a/plugins/Symmetry/find_sym.irp.f b/plugins/Symmetry/find_sym.irp.f deleted file mode 100644 index d440279e..00000000 --- a/plugins/Symmetry/find_sym.irp.f +++ /dev/null @@ -1,348 +0,0 @@ -BEGIN_PROVIDER [ logical, molecule_is_linear ] - implicit none - BEGIN_DOC - ! True if the molecule is linear - END_DOC - molecule_is_linear = (minval(inertia_tensor_eigenvalues) < 1.d-5) -END_PROVIDER - - -BEGIN_PROVIDER [ integer, sym_rotation_axis, (3) ] - implicit none - BEGIN_DOC - ! Order of the rotation axis - END_DOC - include 'constants.include.F' - - integer :: i,j,k - double precision :: point(3), point2(3) - logical :: found - double precision, external :: u_dot_u - integer :: iorder, iaxis - - do iaxis=1,3 - do iorder=12,2,-1 - sym_rotation_axis(iaxis) = iorder - do i=1,nucl_num - found = .False. - call sym_apply_rotation(dble(iorder),iaxis,nucl_coord_sym_transp(1,i),point) - do j=1,nucl_num - if (nucl_charge(i) /= nucl_charge(j)) cycle - point2(:) = nucl_coord_sym_transp(:,j) - point(:) - if (u_dot_u(point2,3) < 1.d-5) then - found = .True. - exit - endif - enddo - if (.not.found) then - sym_rotation_axis(iaxis) = 1 - exit - endif - enddo - if (sym_rotation_axis(iaxis) /= 1) then - exit - endif - enddo - enddo - -END_PROVIDER - - BEGIN_PROVIDER [ integer, molecule_principal_axis ] -&BEGIN_PROVIDER [ integer, molecule_secondary_axis ] -&BEGIN_PROVIDER [ integer, molecule_ternary_axis ] -&BEGIN_PROVIDER [ logical, molecule_has_secondary_c2_rotation ] - implicit none - BEGIN_DOC -! Which axis is the Z axis - END_DOC - molecule_principal_axis = maxloc(sym_rotation_axis,1) - if (molecule_principal_axis == 1) then - if (sym_rotation_axis(2) > sym_rotation_axis(3)) then - molecule_secondary_axis = 2 - molecule_ternary_axis = 3 - else - molecule_secondary_axis = 3 - molecule_ternary_axis = 2 - endif - else if (molecule_principal_axis == 2) then - if (sym_rotation_axis(1) > sym_rotation_axis(3)) then - molecule_secondary_axis = 1 - molecule_ternary_axis = 3 - else - molecule_secondary_axis = 3 - molecule_ternary_axis = 1 - endif - else if (molecule_principal_axis == 3) then - if (sym_rotation_axis(1) > sym_rotation_axis(2)) then - molecule_secondary_axis = 1 - molecule_ternary_axis = 2 - else - molecule_secondary_axis = 2 - molecule_ternary_axis = 1 - endif - endif - - if (molecule_principal_axis == 1) then - molecule_has_secondary_c2_rotation = (sym_rotation_axis(2)==2) .or. (sym_rotation_axis(3)==2) - else if (molecule_principal_axis == 2) then - molecule_has_secondary_c2_rotation = (sym_rotation_axis(1)==2) .or. (sym_rotation_axis(3)==2) - else if (molecule_principal_axis == 3) then - molecule_has_secondary_c2_rotation = (sym_rotation_axis(1)==2) .or. (sym_rotation_axis(2)==2) - endif - - if (molecule_has_secondary_c2_rotation) then - integer :: swap - if ( (sym_rotation_axis(molecule_secondary_axis) /= 2).and. & - (sym_rotation_axis(molecule_ternary_axis) == 2) ) then - swap = molecule_secondary_axis - molecule_secondary_axis = molecule_ternary_axis - molecule_ternary_axis = swap - endif - endif - -END_PROVIDER - - - -BEGIN_PROVIDER [ logical, molecule_has_improper_rotation ] - implicit none - BEGIN_DOC - ! Order of the rotation axis - END_DOC - include 'constants.include.F' - - integer :: i,j,k - double precision :: point(3), point2(3) - logical :: found - double precision, external :: u_dot_u - integer :: iorder, iaxis - iaxis=molecule_principal_axis - iorder = 2*sym_rotation_axis(iaxis) - molecule_has_improper_rotation = .True. - do i=1,nucl_num - found = .False. - call sym_apply_improper_rotation(dble(iorder),iaxis,nucl_coord_sym_transp(1,i),point) - do j=1,nucl_num - if (nucl_charge(i) /= nucl_charge(j)) cycle - point2(:) = nucl_coord_sym_transp(:,j) - point(:) - if (u_dot_u(point2,3) < 1.d-5) then - found = .True. - exit - endif - enddo - if (.not.found) then - molecule_has_improper_rotation = .False. - exit - endif - enddo - -END_PROVIDER - -BEGIN_PROVIDER [ logical, molecule_has_center_of_inversion ] - implicit none - BEGIN_DOC - ! If true, there is a center of inversion in the WF - END_DOC - molecule_has_center_of_inversion = .True. - integer :: i,j,k - double precision :: point(3) - logical :: found - double precision, external :: u_dot_u - do i=1,nucl_num - found = .False. - do j=1,nucl_num - if (nucl_charge(i) /= nucl_charge(j)) cycle - point(:) = nucl_coord_sym_transp(:,i) + nucl_coord_sym_transp(:,j) - if (u_dot_u(point,3) < 1.d-5) then - found = .True. - exit - endif - enddo - if (.not.found) then - molecule_has_center_of_inversion = .False. - exit - endif - enddo - -END_PROVIDER - - -BEGIN_PROVIDER [ logical, molecule_has_sigma_plane, (3) ] - implicit none - BEGIN_DOC - ! If true, there is a symmetry plane perpendicular to the main axis - END_DOC - integer :: i,j,k - double precision :: point(3), point2(3) - logical :: found - double precision, external :: u_dot_u - integer :: iaxis - do iaxis=1,3 - molecule_has_sigma_plane(iaxis) = .True. - do i=1,nucl_num - found = .False. - point(:) = nucl_coord_sym_transp(:,i) - point(iaxis) = -point(iaxis) - do j=1,nucl_num - if (nucl_charge(i) /= nucl_charge(j)) cycle - point2(:) = nucl_coord_sym_transp(:,j) - point(:) - if (u_dot_u(point2,3) < 1.d-5) then - found = .True. - exit - endif - enddo - if (.not.found) then - molecule_has_sigma_plane(iaxis) = .False. - exit - endif - enddo - enddo - -END_PROVIDER - -BEGIN_PROVIDER [ character*16, point_group ] - implicit none - BEGIN_DOC -! Point group of the molecule - END_DOC - - character*2, save :: i_to_a(24) = (/ '1 ', '2 ', '3 ', '4 ', '5 ', '6 ', '7 ', '8 ', '9 ', & - '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', & - '21', '22', '23', '24' /) - point_group = 'C1' - if (molecule_is_linear) then - if (molecule_has_center_of_inversion) then - point_group = 'Dinfh' - else - point_group = 'Cinfv' - endif - else - if (maxval(sym_rotation_axis) == 1) then - if (molecule_has_sigma_plane(1).or.molecule_has_sigma_plane(2).or.& - molecule_has_sigma_plane(3) ) then - point_group = 'Cs' - else - if (molecule_has_center_of_inversion) then - point_group = 'Ci' - endif - endif - else - if (molecule_has_secondary_c2_rotation) then - if (molecule_has_sigma_plane(molecule_principal_axis)) then - point_group = 'D'//trim(i_to_a(sym_rotation_axis(molecule_principal_axis)))//'h' - else - if (molecule_has_sigma_plane(molecule_secondary_axis)) then - point_group = 'D'//trim(i_to_a(sym_rotation_axis(molecule_principal_axis)))//'d' - else - if (molecule_has_sigma_plane(molecule_ternary_axis)) then - point_group = 'D'//trim(i_to_a(sym_rotation_axis(molecule_principal_axis)))//'d' - else - if ( (sym_rotation_axis(1) == 2).and. & - (sym_rotation_axis(2) == 2).and. & - (sym_rotation_axis(3) == 2).and. & - (inertia_tensor_eigenvalues(1) == inertia_tensor_eigenvalues(2)).and. & - (inertia_tensor_eigenvalues(1) == inertia_tensor_eigenvalues(3)) ) then - point_group = 'Td' - else - point_group = 'D'//trim(i_to_a(sym_rotation_axis(molecule_principal_axis))) - endif - endif - endif - endif - else - if (molecule_has_sigma_plane(molecule_principal_axis)) then - point_group = 'C'//trim(i_to_a(sym_rotation_axis(molecule_principal_axis)))//'h' - else - if (molecule_has_sigma_plane(molecule_secondary_axis)) then - point_group = 'C'//trim(i_to_a(sym_rotation_axis(molecule_principal_axis)))//'v' - else - if (molecule_has_sigma_plane(molecule_ternary_axis)) then - point_group = 'C'//trim(i_to_a(sym_rotation_axis(molecule_principal_axis)))//'v' - else - if (molecule_has_improper_rotation) then - point_group = 'S'//trim(i_to_a(2*sym_rotation_axis(molecule_principal_axis))) - else - point_group = 'C'//trim(i_to_a(sym_rotation_axis(molecule_principal_axis))) - endif - endif - endif - endif - endif - endif - endif -END_PROVIDER - - - -BEGIN_PROVIDER [ integer, n_irrep ] - implicit none - BEGIN_DOC - ! Number of Irreducible representations - END_DOC - integer :: iunit, n, i - character*(256) :: qproot, buffer - integer, external :: getUnitAndOpen - call getenv('QP_ROOT',qproot) - iunit = getUnitAndOpen(trim(qproot)//'/data/Symmetry/'//trim(point_group),'r') - read(iunit,*) ! 1st line - read(iunit,*) buffer, n_irrep - close(iunit) -END_PROVIDER - - BEGIN_PROVIDER [ character*8, sym_irrep, (n_irrep) ] -&BEGIN_PROVIDER [ character*8, sym_operation, (n_irrep) ] -&BEGIN_PROVIDER [ double precision, character_table, (n_irrep,n_irrep) ] - implicit none - BEGIN_DOC - ! Irreducible representation labels, labels of symmetry operations and - ! Character table : columns are sym operations and lines are Irreps - END_DOC - integer :: iunit, n, i - character*(256) :: qproot, buffer - integer, external :: getUnitAndOpen - call getenv('QP_ROOT',qproot) - iunit = getUnitAndOpen(trim(qproot)//'/data/Symmetry/'//trim(point_group),'r') - buffer = '' - read(iunit,*) ! 1st line - read(iunit,*) buffer, n - read(iunit,*) ! empty line - read(iunit,*) ! Irred Operation - do i=1,n - read(iunit,*) buffer, sym_irrep(i), sym_operation(i) - enddo - read(iunit,*) ! empty line - read(iunit,*) ! Table - read(iunit,*) ! 1 2 3 ... - do i=1,n - read(iunit,*) buffer, character_table(i,1:n) - enddo - close(iunit) -END_PROVIDER - - -BEGIN_PROVIDER [ integer, mo_sym, (mo_tot_num) ] - implicit none - BEGIN_DOC - ! Symmetry operations applied on MOs - END_DOC - - double precision, allocatable :: sym_points(:,:), ref_points(:,:) - double precision, allocatable :: val(:,:,:) - integer :: iangle, n_sym_points - double precision :: angle - integer :: iop, imo, ipoint, l, i - double precision :: sym_operations_on_mos(mo_tot_num) - logical :: possible_irrep(n_irrep,mo_tot_num) - - do imo=1,mo_tot_num - print *, 'MO ', imo - do i=1,n_irrep - if (possible_irrep(i,imo)) then - print *, sym_irrep(i) - endif - enddo - print *, '' - enddo - -END_PROVIDER - diff --git a/plugins/Symmetry/nuclei.irp.f b/plugins/Symmetry/nuclei.irp.f deleted file mode 100644 index 405b529a..00000000 --- a/plugins/Symmetry/nuclei.irp.f +++ /dev/null @@ -1,122 +0,0 @@ -subroutine point_to_standard_orientation(point_in,point_out) - implicit none - double precision, intent(in) :: point_in(3) - double precision, intent(out) :: point_out(3) - BEGIN_DOC - ! Returns the coordinates of a point in the standard orientation - END_DOC - double precision :: point_tmp(3) - - point_tmp(1) = point_in(1) - center_of_mass(1) - point_tmp(2) = point_in(2) - center_of_mass(2) - point_tmp(3) = point_in(3) - center_of_mass(3) - - point_out(1) = point_tmp(1)*inertia_tensor_eigenvectors(1,1) + & - point_tmp(2)*inertia_tensor_eigenvectors(2,1) + & - point_tmp(3)*inertia_tensor_eigenvectors(3,1) - - point_out(2) = point_tmp(1)*inertia_tensor_eigenvectors(1,2) + & - point_tmp(2)*inertia_tensor_eigenvectors(2,2) + & - point_tmp(3)*inertia_tensor_eigenvectors(3,2) - - point_out(3) = point_tmp(1)*inertia_tensor_eigenvectors(1,3) + & - point_tmp(2)*inertia_tensor_eigenvectors(2,3) + & - point_tmp(3)*inertia_tensor_eigenvectors(3,3) - -end - -subroutine point_to_input_orientation(point_in,point_out) - implicit none - double precision, intent(in) :: point_in(3) - double precision, intent(out) :: point_out(3) - BEGIN_DOC - ! Returns the coordinates of a point in the input orientation - END_DOC - double precision :: point_tmp(3) - - point_tmp(1) = point_in(1)*inertia_tensor_eigenvectors(1,1) + & - point_in(2)*inertia_tensor_eigenvectors(1,2) + & - point_in(3)*inertia_tensor_eigenvectors(1,3) - - point_tmp(2) = point_in(1)*inertia_tensor_eigenvectors(2,1) + & - point_in(2)*inertia_tensor_eigenvectors(2,2) + & - point_in(3)*inertia_tensor_eigenvectors(2,3) - - point_tmp(3) = point_in(1)*inertia_tensor_eigenvectors(3,1) + & - point_in(2)*inertia_tensor_eigenvectors(3,2) + & - point_in(3)*inertia_tensor_eigenvectors(3,3) - - point_out(1) = point_tmp(1) + center_of_mass(1) - point_out(2) = point_tmp(2) + center_of_mass(2) - point_out(3) = point_tmp(3) + center_of_mass(3) - -end - -BEGIN_PROVIDER [ double precision, nucl_coord_sym, (nucl_num,3) ] - implicit none - - BEGIN_DOC - ! Nuclear coordinates in standard orientation - END_DOC - - if (mpi_master) then - integer :: i - do i=1,nucl_num - call point_to_standard_orientation(nucl_coord(i,:), nucl_coord_sym(i,:)) - enddo - - character*(64), parameter :: f = '(A16, 4(1X,F12.6))' - character*(64), parameter :: ft= '(A16, 4(1X,A12 ))' - double precision, parameter :: a0= 0.529177249d0 - - call write_time(6) - write(6,'(A)') '' - write(6,'(A)') 'Nuclear Coordinates in standard orientation (Angstroms)' - write(6,'(A)') '=======================================================' - write(6,'(A)') '' - write(6,ft) & - '================','============','============','============','============' - write(6,*) & - ' Atom Charge X Y Z ' - write(6,ft) & - '================','============','============','============','============' - do i=1,nucl_num - write(6,f) nucl_label(i), nucl_charge(i), & - nucl_coord_sym(i,1)*a0, & - nucl_coord_sym(i,2)*a0, & - nucl_coord_sym(i,3)*a0 - enddo - write(6,ft) & - '================','============','============','============','============' - write(6,'(A)') '' - - endif - - IRP_IF MPI - include 'mpif.h' - integer :: ierr - call MPI_BCAST( nucl_coord_sym, 3*nucl_num, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - stop 'Unable to read nucl_coord_sym with MPI' - endif - IRP_ENDIF - -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, nucl_coord_sym_transp, (3,nucl_num) ] - implicit none - BEGIN_DOC - ! Transposed array of nucl_coord - END_DOC - integer :: i, k - nucl_coord_sym_transp = 0.d0 - - do i=1,nucl_num - nucl_coord_sym_transp(1,i) = nucl_coord_sym(i,1) - nucl_coord_sym_transp(2,i) = nucl_coord_sym(i,2) - nucl_coord_sym_transp(3,i) = nucl_coord_sym(i,3) - enddo -END_PROVIDER - - diff --git a/plugins/Symmetry/sym_operation.irp.f b/plugins/Symmetry/sym_operation.irp.f deleted file mode 100644 index ccf72ec3..00000000 --- a/plugins/Symmetry/sym_operation.irp.f +++ /dev/null @@ -1,70 +0,0 @@ -subroutine sym_apply_inversion(point_in, point_out) - implicit none - double precision, intent(in) :: point_in(3) - double precision, intent(out) :: point_out(3) - point_out(:) = -point_in(:) -end - -subroutine sym_apply_reflexion(iaxis,point_in,point_out) - implicit none - integer, intent(in) :: iaxis - double precision, intent(in) :: point_in(3) - double precision, intent(out) :: point_out(3) - point_out(:) = point_in(:) - point_out(iaxis) = -point_in(iaxis) - -end - -subroutine sym_apply_diagonal_reflexion(angle,iaxis,point_in,point_out) - implicit none - integer, intent(in) :: iaxis - double precision, intent(in) :: point_in(3), angle - double precision, intent(out) :: point_out(3) - double precision :: point_tmp1(3), point_tmp2(3) - integer :: iaxis2 - iaxis2 = mod(iaxis,3)+1 -! iaxis2 = mod(iaxis2,3)+1 - call sym_apply_rotation(-angle,iaxis,point_in,point_tmp1) - call sym_apply_reflexion(iaxis2,point_tmp1,point_tmp2) - call sym_apply_rotation(angle,iaxis,point_tmp2,point_out) -end - -subroutine sym_apply_rotation(angle,iaxis,point_in,point_out) - implicit none - double precision, intent(in) :: angle - integer, intent(in) :: iaxis - double precision, intent(in) :: point_in(3) - double precision, intent(out) :: point_out(3) - double precision :: theta, sin_t, cos_t - double precision, parameter :: pi = dacos(-1.d0) - theta = 2.d0*pi/angle - sin_t = dsin(theta) - cos_t = dcos(theta) - if (iaxis==1) then - point_out(1) = point_in(1) - point_out(2) = point_in(2)*cos_t - point_in(3)*sin_t - point_out(3) = point_in(2)*sin_t + point_in(3)*cos_t - else if (iaxis==2) then - point_out(1) = point_in(1)*cos_t - point_in(3)*sin_t - point_out(2) = point_in(2) - point_out(3) = point_in(1)*sin_t + point_in(3)*cos_t - endif - if (iaxis==3) then - point_out(1) = point_in(1)*cos_t - point_in(2)*sin_t - point_out(2) = point_in(1)*sin_t + point_in(2)*cos_t - point_out(3) = point_in(3) - endif -end - -subroutine sym_apply_improper_rotation(angle,iaxis,point_in,point_out) - implicit none - double precision, intent(in) :: angle - integer, intent(in) :: iaxis - double precision, intent(in) :: point_in(3) - double precision, intent(out) :: point_out(3) - double precision :: point_tmp(3) - call sym_apply_rotation(angle,iaxis,point_in,point_tmp) - call sym_apply_reflexion(iaxis,point_tmp,point_out) -end - - diff --git a/plugins/analyze_wf/NEEDED_CHILDREN_MODULES b/plugins/analyze_wf/NEEDED_CHILDREN_MODULES deleted file mode 100644 index aae89501..00000000 --- a/plugins/analyze_wf/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -Determinants diff --git a/plugins/analyze_wf/README.rst b/plugins/analyze_wf/README.rst deleted file mode 100644 index 179e407d..00000000 --- a/plugins/analyze_wf/README.rst +++ /dev/null @@ -1,12 +0,0 @@ -========== -analyze_wf -========== - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. diff --git a/plugins/analyze_wf/analyze_wf.irp.f b/plugins/analyze_wf/analyze_wf.irp.f deleted file mode 100644 index d8ede09a..00000000 --- a/plugins/analyze_wf/analyze_wf.irp.f +++ /dev/null @@ -1,82 +0,0 @@ -program analyze_wf - implicit none - BEGIN_DOC -! Wave function analyzis - END_DOC - PROVIDE mo_tot_num psi_det psi_coef - read_wf = .True. - SOFT_TOUCH read_wf - call run() -end - -subroutine run - implicit none - integer :: istate, i - integer :: class(0:mo_tot_num,5) - double precision :: occupation(mo_tot_num) - - write(*,'(A)') 'Energy of 1st determinant' - write(*,'(A)') '=========================' - write(*,'(A)') '' - write(*,*) 'Total', ref_bitmask_energy + nuclear_repulsion - write(*,*) 'Mono-electronic', mono_elec_ref_bitmask_energy - write(*,*) 'Kinetic', kinetic_ref_bitmask_energy - write(*,*) 'Electron-nucleus', nucl_elec_ref_bitmask_energy - write(*,*) 'Two-electron', bi_elec_ref_bitmask_energy - write(*,'(A)') '' - write(*,'(A)') '' - - write(*,'(A)') 'MO Occupation' - write(*,'(A)') '=============' - write(*,'(A)') '' - do istate=1,N_states - write(*,'(A)') '' - write(*,'(A,I3)'), 'State ', istate - write(*,'(A)') '---------------' - write(*,'(A)') '' - call get_occupation_from_dets(istate,occupation) - write (*,'(A)') '======== ================' - class = 0 - do i=1,mo_tot_num - write (*,'(I8,X,F16.10)') i, occupation(i) - if (occupation(i) > 1.999d0) then - class(0,1) += 1 - class( class(0,1), 1) = i - else if (occupation(i) > 1.97d0) then - class(0,2) += 1 - class( class(0,2), 2) = i - else if (occupation(i) < 0.001d0) then - class(0,5) += 1 - class( class(0,5), 5) = i - else if (occupation(i) < 0.03d0) then - class(0,4) += 1 - class( class(0,4), 4) = i - else - class(0,3) += 1 - class( class(0,3), 3) = i - endif - enddo - write (*,'(A)') '======== ================' - write (*,'(A)') '' - - write (*,'(A)') 'Suggested classes' - write (*,'(A)') '-----------------' - write (*,'(A)') '' - write (*,'(A)') 'Core :' - write (*,*) (class(i,1), ',', i=1,class(0,1)) - write (*,*) '' - write (*,'(A)') 'Inactive :' - write (*,*) (class(i,2), ',', i=1,class(0,2)) - write (*,'(A)') '' - write (*,'(A)') 'Active :' - write (*,*) (class(i,3), ',', i=1,class(0,3)) - write (*,'(A)') '' - write (*,'(A)') 'Virtual :' - write (*,*) (class(i,4), ',', i=1,class(0,4)) - write (*,'(A)') '' - write (*,'(A)') 'Deleted :' - write (*,*) (class(i,5), ',', i=1,class(0,5)) - write (*,'(A)') '' - enddo - -end diff --git a/plugins/analyze_wf/attachment.irp.f b/plugins/analyze_wf/attachment.irp.f deleted file mode 100644 index d086aa21..00000000 --- a/plugins/analyze_wf/attachment.irp.f +++ /dev/null @@ -1,64 +0,0 @@ - BEGIN_PROVIDER [ double precision, one_body_dm_mo_detachment, (mo_tot_num,mo_tot_num,2:N_states) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_mo_attachment, (mo_tot_num,mo_tot_num,2:N_states) ] - implicit none - BEGIN_DOC - ! Detachment and attachment density matrices in MO basis - END_DOC - integer :: i,j, k, istate - double precision :: km(mo_tot_num), kp(mo_tot_num) - - one_body_dm_mo_detachment = 0.d0 - one_body_dm_mo_attachment = 0.d0 - - do istate=2,N_states - - km(:) = 0.d0 - kp(:) = 0.d0 - do i=1,mo_tot_num - if (one_body_dm_mo_diff_eigvalues(i,istate) < 0) then - km(i) = -one_body_dm_mo_diff_eigvalues(i,istate) - else - kp(i) = one_body_dm_mo_diff_eigvalues(i,istate) - endif - enddo - - ! Attachment - do k=1,mo_tot_num - do j=1,mo_tot_num - do i=1,mo_tot_num - one_body_dm_mo_detachment(i,j,istate) = one_body_dm_mo_detachment(i,j,istate) + & - one_body_dm_mo_diff_eigvectors(i,k,istate)*km(k)* & - one_body_dm_mo_diff_eigvectors(j,k,istate) - one_body_dm_mo_attachment(i,j,istate) = one_body_dm_mo_attachment(i,j,istate) + & - one_body_dm_mo_diff_eigvectors(i,k,istate)*kp(k)* & - one_body_dm_mo_diff_eigvectors(j,k,istate) - enddo - enddo - enddo - - enddo - -END_PROVIDER - - BEGIN_PROVIDER [ double precision, one_body_dm_ao_detachment, (ao_num,ao_num,2:N_states) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_ao_attachment, (ao_num,ao_num,2:N_states) ] - implicit none - BEGIN_DOC - ! Detachment and attachment density matrices in AO basis - END_DOC - integer :: istate - do istate=2,N_states - call mo_to_ao_no_overlap( & - one_body_dm_mo_attachment(1,1,istate), & - size(one_body_dm_mo_attachment,1), & - one_body_dm_ao_attachment(1,1,istate), & - size(one_body_dm_ao_attachment,1) ) - call mo_to_ao_no_overlap( & - one_body_dm_mo_detachment(1,1,istate), & - size(one_body_dm_mo_detachment,1), & - one_body_dm_ao_detachment(1,1,istate), & - size(one_body_dm_ao_detachment,1) ) - enddo - -END_PROVIDER - diff --git a/plugins/analyze_wf/dump_nto.irp.f b/plugins/analyze_wf/dump_nto.irp.f deleted file mode 100644 index 8d19c3eb..00000000 --- a/plugins/analyze_wf/dump_nto.irp.f +++ /dev/null @@ -1,19 +0,0 @@ -program dump_nto - implicit none - integer :: i,j, istate - - print *, 'Phi_S' - do i=2,N_states - print *, i, Phi_S(i) - enddo - - do istate=2,N_states - do j=1,mo_tot_num - print *, 'MO: ', j, 'State:', istate, 'Eig:', one_body_dm_mo_diff_eigvalues(j,istate) - do i=1,ao_num - print *, i, transition_natorb(i,j,istate) - enddo - enddo - enddo - -end diff --git a/plugins/analyze_wf/dump_one_body_mos.irp.f b/plugins/analyze_wf/dump_one_body_mos.irp.f deleted file mode 100644 index 7ab841ef..00000000 --- a/plugins/analyze_wf/dump_one_body_mos.irp.f +++ /dev/null @@ -1,38 +0,0 @@ -program dump_one_body_mos - implicit none - BEGIN_DOC -! Output density matrices of all the states - END_DOC - read_wf = .True. - TOUCH read_wf - call run() -end - -subroutine run - implicit none - integer :: istate - integer, parameter :: iunit = 66 - character*(64) :: filename, fmt - integer :: i,j,k - - write(fmt,'(''('',I4.4,''(X,E20.14))'')') mo_tot_num - do istate=1,N_states - write(filename,'(''state.'',I2.2)') istate - open(unit=iunit, form='formatted', file=filename) - write(iunit,*) mo_tot_num - do j=1,mo_tot_num - write(iunit,fmt) one_body_dm_mo_alpha(1:mo_tot_num,j,istate) + one_body_dm_mo_beta(1:mo_tot_num,j,istate) - enddo - enddo - - - call run2() -end -subroutine run2 - integer :: i,j, istate - print *, 'Phi_S' - do i=2,N_states - print *, i, Phi_S(i) - enddo -end - diff --git a/plugins/analyze_wf/occupation.irp.f b/plugins/analyze_wf/occupation.irp.f deleted file mode 100644 index 0962247e..00000000 --- a/plugins/analyze_wf/occupation.irp.f +++ /dev/null @@ -1,30 +0,0 @@ -subroutine get_occupation_from_dets(istate,occupation) - implicit none - double precision, intent(out) :: occupation(mo_tot_num) - integer, intent(in) :: istate - BEGIN_DOC - ! Returns the average occupation of the MOs - END_DOC - integer :: i,j, ispin - integer :: list(N_int*bit_kind_size,2) - integer :: n_elements(2) - double precision :: c, norm_2 - ASSERT (istate > 0) - ASSERT (istate <= N_states) - - occupation = 0.d0 - double precision, external :: u_dot_u - - norm_2 = 1.d0/u_dot_u(psi_coef(1,istate),N_det) - - do i=1,N_det - c = psi_coef(i,istate)*psi_coef(i,istate)*norm_2 - call bitstring_to_list_ab(psi_det(1,1,i), list, n_elements, N_int) - do ispin=1,2 - do j=1,n_elements(ispin) - ASSERT ( list(j,ispin) < mo_tot_num ) - occupation( list(j,ispin) ) += c - enddo - enddo - enddo -end diff --git a/plugins/analyze_wf/phi_s.irp.f b/plugins/analyze_wf/phi_s.irp.f deleted file mode 100644 index 12bdb970..00000000 --- a/plugins/analyze_wf/phi_s.irp.f +++ /dev/null @@ -1,128 +0,0 @@ - BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff_eigvalues, (mo_tot_num, 2:N_states) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff_eigvectors, (mo_tot_num, mo_tot_num, 2:N_states) ] - implicit none - BEGIN_DOC - ! Eigenvalues and eigenvectors of one_body_dm_mo_diff - END_DOC - integer :: i,j,istate - integer :: liwork, lwork, n, info - integer, allocatable :: iwork(:) - double precision, allocatable :: work(:) - - - one_body_dm_mo_diff_eigvectors(1:mo_tot_num, 1:mo_tot_num, 2:N_states) =& - one_body_dm_mo_diff(1:mo_tot_num, 1:mo_tot_num, 2:N_states) - - n = mo_tot_num - lwork = 1+6*n + 2*n*n - liwork = 3 + 5*n - - allocate(work(lwork), iwork(liwork)) - - lwork=-1 - liwork=-1 - istate=2 - - call dsyevd( 'V', 'U', mo_tot_num, & - one_body_dm_mo_diff_eigvectors(1,1,istate), & - size(one_body_dm_mo_diff_eigvectors,1), & - one_body_dm_mo_diff_eigvalues(1,istate), & - work, lwork, iwork, liwork, info) - - - if (info /= 0) then - print *, irp_here//' DSYEVD failed : ', info - stop 1 - endif - lwork = int(work(1)) - liwork = iwork(1) - deallocate(iwork,work) - - allocate(work(lwork), iwork(liwork)) - - do istate=2,N_states - call dsyevd( 'V', 'U', mo_tot_num, & - one_body_dm_mo_diff_eigvectors(1,1,istate), & - size(one_body_dm_mo_diff_eigvectors,1), & - one_body_dm_mo_diff_eigvalues(1,istate), & - work, lwork, iwork, liwork, info) - - if (info /= 0) then - print *, irp_here//' DSYEVD failed : ', info - stop 1 - endif - - enddo - - deallocate(iwork,work) - -END_PROVIDER - -BEGIN_PROVIDER [ double precision, transition_natorb, (ao_num,mo_tot_num,2:N_states) ] - implicit none - BEGIN_DOC - ! Natural transition molecular orbitals - END_DOC - - integer :: istate - - do istate=2,N_states - call dgemm('N','N',ao_num,mo_tot_num,mo_tot_num, 1.d0, & - mo_coef, size(mo_coef,1), & - one_body_dm_mo_diff_eigvectors(1,1,istate), & - size(one_body_dm_mo_diff_eigvectors,1), 0.d0, & - transition_natorb(1,1,istate), size(transition_natorb,1)) - enddo -END_PROVIDER - - -BEGIN_PROVIDER [ double precision, phi_s, (2:N_states) ] - implicit none - BEGIN_DOC - ! - END_DOC - - integer :: i,istate - double precision, allocatable :: T(:,:), A(:,:), D(:,:) - double precision :: trace, norm - allocate(T(ao_num,ao_num), A(ao_num,ao_num), D(ao_num,ao_num)) - - do istate=2,N_states - - call dgemm('N','N',ao_num,ao_num,ao_num,1.d0, & - S_half, size(S_half,1), & - one_body_dm_ao_attachment(1,1,istate), size(one_body_dm_ao_attachment,1), 0.d0,& - T, size(T,1)) - call dgemm('N','N',ao_num,ao_num,ao_num,1.d0, & - T, size(T,1), & - S_half, size(S_half,1), 0.d0, & - A, size(A,1)) -! - call dgemm('N','N',ao_num,ao_num,ao_num,1.d0, & - S_half, size(S_half,1), & - one_body_dm_ao_detachment(1,1,istate), size(one_body_dm_ao_detachment,1), 0.d0,& - T, size(T,1)) - call dgemm('N','N',ao_num,ao_num,ao_num,1.d0, & - T, size(T,1), & - S_half, size(S_half,1), 0.d0, & - D, size(D,1)) - - trace = 0.d0 - do i=1,ao_num - trace = trace + A(i,i) - enddo - norm = 0.d0 - do i=1,ao_num - norm = norm + D(i,i) - enddo - norm = 0.5d0*(norm + trace) - - trace = 0.d0 - do i=1,mo_tot_num - trace = trace + dsqrt(A(i,i)*D(i,i)) - enddo - phi_s(istate) = trace/norm - enddo - -END_PROVIDER - diff --git a/plugins/All_singles/EZFIO.cfg b/plugins/eginer/All_singles/EZFIO.cfg similarity index 100% rename from plugins/All_singles/EZFIO.cfg rename to plugins/eginer/All_singles/EZFIO.cfg diff --git a/plugins/All_singles/H_apply.irp.f b/plugins/eginer/All_singles/H_apply.irp.f similarity index 100% rename from plugins/All_singles/H_apply.irp.f rename to plugins/eginer/All_singles/H_apply.irp.f diff --git a/plugins/All_singles/NEEDED_CHILDREN_MODULES b/plugins/eginer/All_singles/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/All_singles/NEEDED_CHILDREN_MODULES rename to plugins/eginer/All_singles/NEEDED_CHILDREN_MODULES diff --git a/plugins/All_singles/README.rst b/plugins/eginer/All_singles/README.rst similarity index 100% rename from plugins/All_singles/README.rst rename to plugins/eginer/All_singles/README.rst diff --git a/plugins/All_singles/all_1h_1p.irp.f b/plugins/eginer/All_singles/all_1h_1p.irp.f similarity index 100% rename from plugins/All_singles/all_1h_1p.irp.f rename to plugins/eginer/All_singles/all_1h_1p.irp.f diff --git a/plugins/All_singles/all_1h_1p_singles.irp.f b/plugins/eginer/All_singles/all_1h_1p_singles.irp.f similarity index 100% rename from plugins/All_singles/all_1h_1p_singles.irp.f rename to plugins/eginer/All_singles/all_1h_1p_singles.irp.f diff --git a/plugins/All_singles/all_singles.irp.f b/plugins/eginer/All_singles/all_singles.irp.f similarity index 100% rename from plugins/All_singles/all_singles.irp.f rename to plugins/eginer/All_singles/all_singles.irp.f diff --git a/plugins/CISD/EZFIO.cfg b/plugins/eginer/CASSD/EZFIO.cfg similarity index 100% rename from plugins/CISD/EZFIO.cfg rename to plugins/eginer/CASSD/EZFIO.cfg diff --git a/plugins/CISD/H_apply.irp.f b/plugins/eginer/CASSD/H_apply.irp.f similarity index 100% rename from plugins/CISD/H_apply.irp.f rename to plugins/eginer/CASSD/H_apply.irp.f diff --git a/plugins/eginer/CASSD/NEEDED_CHILDREN_MODULES b/plugins/eginer/CASSD/NEEDED_CHILDREN_MODULES new file mode 100644 index 00000000..ee3737a3 --- /dev/null +++ b/plugins/eginer/CASSD/NEEDED_CHILDREN_MODULES @@ -0,0 +1 @@ +Generators_CAS DavidsonUndressed diff --git a/plugins/CISD/README.rst b/plugins/eginer/CASSD/README.rst similarity index 100% rename from plugins/CISD/README.rst rename to plugins/eginer/CASSD/README.rst diff --git a/plugins/CISD/cisd_lapack.irp.f b/plugins/eginer/CASSD/cassd.irp.f similarity index 56% rename from plugins/CISD/cisd_lapack.irp.f rename to plugins/eginer/CASSD/cassd.irp.f index 374dc9c2..e85f0940 100644 --- a/plugins/CISD/cisd_lapack.irp.f +++ b/plugins/eginer/CASSD/cassd.irp.f @@ -1,16 +1,22 @@ -program cisd +program cis + implicit none + read_wf = .False. + SOFT_TOUCH read_wf + call run +end + +subroutine run implicit none integer :: i - diag_algorithm = "Lapack" - touch diag_algorithm - print *, 'HF = ', HF_energy - print *, 'N_states = ', N_states call H_apply_cisd print *, 'N_det = ', N_det do i = 1,N_states print *, 'energy = ',CI_energy(i) print *, 'E_corr = ',CI_electronic_energy(i) - ref_bitmask_energy enddo + psi_coef = ci_eigenvectors + SOFT_TOUCH psi_coef + call save_wavefunction end diff --git a/plugins/CID/H_apply.irp.f b/plugins/eginer/CID/H_apply.irp.f similarity index 100% rename from plugins/CID/H_apply.irp.f rename to plugins/eginer/CID/H_apply.irp.f diff --git a/plugins/CID/NEEDED_CHILDREN_MODULES b/plugins/eginer/CID/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/CID/NEEDED_CHILDREN_MODULES rename to plugins/eginer/CID/NEEDED_CHILDREN_MODULES diff --git a/plugins/CID/README.rst b/plugins/eginer/CID/README.rst similarity index 100% rename from plugins/CID/README.rst rename to plugins/eginer/CID/README.rst diff --git a/plugins/CID/cid.irp.f b/plugins/eginer/CID/cid.irp.f similarity index 100% rename from plugins/CID/cid.irp.f rename to plugins/eginer/CID/cid.irp.f diff --git a/plugins/CID/cid_lapack.irp.f b/plugins/eginer/CID/cid_lapack.irp.f similarity index 100% rename from plugins/CID/cid_lapack.irp.f rename to plugins/eginer/CID/cid_lapack.irp.f diff --git a/plugins/CID_SC2_selected/H_apply.irp.f b/plugins/eginer/CID_SC2_selected/H_apply.irp.f similarity index 100% rename from plugins/CID_SC2_selected/H_apply.irp.f rename to plugins/eginer/CID_SC2_selected/H_apply.irp.f diff --git a/plugins/CID_SC2_selected/NEEDED_CHILDREN_MODULES b/plugins/eginer/CID_SC2_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/CID_SC2_selected/NEEDED_CHILDREN_MODULES rename to plugins/eginer/CID_SC2_selected/NEEDED_CHILDREN_MODULES diff --git a/plugins/CID_SC2_selected/README.rst b/plugins/eginer/CID_SC2_selected/README.rst similarity index 100% rename from plugins/CID_SC2_selected/README.rst rename to plugins/eginer/CID_SC2_selected/README.rst diff --git a/plugins/CID_SC2_selected/cid_sc2_selection.irp.f b/plugins/eginer/CID_SC2_selected/cid_sc2_selection.irp.f similarity index 100% rename from plugins/CID_SC2_selected/cid_sc2_selection.irp.f rename to plugins/eginer/CID_SC2_selected/cid_sc2_selection.irp.f diff --git a/plugins/CID_selected/H_apply.irp.f b/plugins/eginer/CID_selected/H_apply.irp.f similarity index 100% rename from plugins/CID_selected/H_apply.irp.f rename to plugins/eginer/CID_selected/H_apply.irp.f diff --git a/plugins/CID_selected/NEEDED_CHILDREN_MODULES b/plugins/eginer/CID_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/CID_selected/NEEDED_CHILDREN_MODULES rename to plugins/eginer/CID_selected/NEEDED_CHILDREN_MODULES diff --git a/plugins/CID_selected/README.rst b/plugins/eginer/CID_selected/README.rst similarity index 100% rename from plugins/CID_selected/README.rst rename to plugins/eginer/CID_selected/README.rst diff --git a/plugins/CID_selected/cid_selected.irp.f b/plugins/eginer/CID_selected/cid_selected.irp.f similarity index 100% rename from plugins/CID_selected/cid_selected.irp.f rename to plugins/eginer/CID_selected/cid_selected.irp.f diff --git a/plugins/eginer/CISD_SC2/.gitignore b/plugins/eginer/CISD_SC2/.gitignore new file mode 100644 index 00000000..64c656fc --- /dev/null +++ b/plugins/eginer/CISD_SC2/.gitignore @@ -0,0 +1,33 @@ +# Automatically created by $QP_ROOT/scripts/module/module_handler.py +.ninja_deps +.ninja_log +AO_Basis +Bitmask +Davidson +Determinants +Electrons +Ezfio_files +FourIdx +Hartree_Fock +IRPF90_man +IRPF90_temp +Integrals_Bielec +Integrals_Monoelec +MOGuess +MO_Basis +MPI +Makefile +Makefile.depend +Nuclei +Pseudo +Selectors_Utils +Selectors_full +SingleRefMethod +Utils +ZMQ +cisd +cisd_lapack +ezfio_interface.irp.f +irpf90.make +irpf90_entities +tags \ No newline at end of file diff --git a/plugins/eginer/CISD_SC2/EZFIO.cfg b/plugins/eginer/CISD_SC2/EZFIO.cfg new file mode 100644 index 00000000..dc3ee61d --- /dev/null +++ b/plugins/eginer/CISD_SC2/EZFIO.cfg @@ -0,0 +1,10 @@ +[energy] +type: double precision +doc: Variational CISD energy +interface: ezfio + +[energy_pt2] +type: double precision +doc: Estimated CISD energy (including PT2) +interface: ezfio + diff --git a/plugins/eginer/CISD_SC2/H_apply.irp.f b/plugins/eginer/CISD_SC2/H_apply.irp.f new file mode 100644 index 00000000..8e565c8f --- /dev/null +++ b/plugins/eginer/CISD_SC2/H_apply.irp.f @@ -0,0 +1,11 @@ +! Generates subroutine H_apply_cisd +! ---------------------------------- + +BEGIN_SHELL [ /usr/bin/env python2 ] +from generate_h_apply import H_apply +H = H_apply("cisd",do_double_exc=True) +print H +H = H_apply("cis",do_double_exc=False) +print H +END_SHELL + diff --git a/plugins/CIS/NEEDED_CHILDREN_MODULES b/plugins/eginer/CISD_SC2/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/CIS/NEEDED_CHILDREN_MODULES rename to plugins/eginer/CISD_SC2/NEEDED_CHILDREN_MODULES diff --git a/plugins/MP2/README.rst b/plugins/eginer/CISD_SC2/README.rst similarity index 54% rename from plugins/MP2/README.rst rename to plugins/eginer/CISD_SC2/README.rst index 98b3140e..af772201 100644 --- a/plugins/MP2/README.rst +++ b/plugins/eginer/CISD_SC2/README.rst @@ -1,32 +1,13 @@ -========== -MP2 Module -========== +CISD +==== -Documentation -============= +This is a test directory which builds a CISD by setting the follwoing rules: -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. +* The only generator determinant is the Hartee-Fock (single-reference method) +* All generated determinants are included in the wave function (no perturbative + selection) -`h_apply_mp2 `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_mp2_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_mp2_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`mp2 `_ - Undocumented +These rules are set in the ``H_apply.irp.f`` file. Needed Modules ============== @@ -36,10 +17,31 @@ Needed Modules .. image:: tree_dependency.png -* `Perturbation `_ * `Selectors_full `_ * `SingleRefMethod `_ +Documentation +============= + +.. Do not edit this section. It was auto-generated from the +.. by the `update_README.py` script. + +`h_apply_cisd `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_cisd_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + Needed Modules ============== .. Do not edit this section It was auto-generated @@ -48,7 +50,6 @@ Needed Modules .. image:: tree_dependency.png -* `Perturbation `_ * `Selectors_full `_ * `SingleRefMethod `_ @@ -58,60 +59,27 @@ Documentation .. by the `update_README.py` script. -h_apply_mp2 +h_apply_cisd Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. -h_apply_mp2_diexc +h_apply_cisd_diexc Undocumented -h_apply_mp2_diexcorg +h_apply_cisd_diexcorg Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. -h_apply_mp2_diexcp +h_apply_cisd_diexcp Undocumented -h_apply_mp2_monoexc +h_apply_cisd_monoexc Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. - -h_apply_mp2_selection - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_mp2_selection_diexc - Undocumented - - -h_apply_mp2_selection_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_mp2_selection_diexcp - Undocumented - - -h_apply_mp2_selection_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`mp2 `_ - Undocumented - - -`mp2_wf `_ - Save the MP2 wave function - diff --git a/plugins/eginer/CISD_SC2/SC2.irp.f b/plugins/eginer/CISD_SC2/SC2.irp.f new file mode 100644 index 00000000..2a3674b5 --- /dev/null +++ b/plugins/eginer/CISD_SC2/SC2.irp.f @@ -0,0 +1,216 @@ +subroutine CISD_SC2(dets_in,u_in,energies,diag_H_elements,dim_in,sze,N_st,Nint,convergence) + use bitmasks + implicit none + BEGIN_DOC + ! CISD+SC2 method :: take off all the disconnected terms of a CISD (selected or not) + ! + ! dets_in : bitmasks corresponding to determinants + ! + ! u_in : guess coefficients on the various states. Overwritten + ! on exit + ! + ! dim_in : leftmost dimension of u_in + ! + ! sze : Number of determinants + ! + ! N_st : Number of eigenstates + ! + ! Initial guess vectors are not necessarily orthonormal + END_DOC + integer, intent(in) :: dim_in, sze, N_st, Nint + integer(bit_kind), intent(in) :: dets_in(Nint,2,sze) + double precision, intent(inout) :: u_in(dim_in,N_st) + double precision, intent(out) :: energies(N_st) + double precision, intent(out) :: diag_H_elements(dim_in) + double precision, intent(in) :: convergence + ASSERT (N_st > 0) + ASSERT (sze > 0) + ASSERT (Nint > 0) + ASSERT (Nint == N_int) + integer :: iter + integer :: i,j,k,l,m + logical :: converged + double precision :: overlap(N_st,N_st) + double precision :: u_dot_v, u_dot_u + + integer :: degree,N_double,index_hf + double precision :: hij_elec, e_corr_double,e_corr,diag_h_mat_elem,inv_c0 + double precision :: e_corr_double_before,accu,cpu_2,cpu_1 + integer,allocatable :: degree_exc(:), index_double(:) + integer :: i_ok + double precision,allocatable :: e_corr_array(:),H_jj_ref(:),H_jj_dressed(:),hij_double(:) + integer(bit_kind), allocatable :: doubles(:,:,:) + + + allocate (doubles(Nint,2,sze),e_corr_array(sze),H_jj_ref(sze),H_jj_dressed(sze),& + index_double(sze), degree_exc(sze), hij_double(sze)) + call write_time(6) + write(6,'(A)') '' + write(6,'(A)') 'CISD SC2' + write(6,'(A)') '========' + !$OMP PARALLEL DEFAULT(NONE) & + !$OMP SHARED(sze,N_st, & + !$OMP H_jj_ref,Nint,dets_in,u_in) & + !$OMP PRIVATE(i) + + !$OMP DO SCHEDULE(guided) + do i=1,sze + H_jj_ref(i) = diag_h_mat_elem(dets_in(1,1,i),Nint) + enddo + !$OMP END DO NOWAIT + !$OMP END PARALLEL + + N_double = 0 + e_corr = 0.d0 + e_corr_double = 0.d0 + do i = 1, sze + call get_excitation_degree(ref_bitmask,dets_in(1,1,i),degree,Nint) + degree_exc(i) = degree+1 + if(degree==0)then + index_hf=i + else if (degree == 2)then + N_double += 1 + index_double(N_double) = i + doubles(:,:,N_double) = dets_in(:,:,i) + call i_H_j(ref_bitmask,dets_in(1,1,i),Nint,hij_elec) + hij_double(N_double) = hij_elec + e_corr_array(N_double) = u_in(i,1)* hij_elec + e_corr_double += e_corr_array(N_double) + e_corr += e_corr_array(N_double) + else if (degree == 1)then + call i_H_j(ref_bitmask,dets_in(1,1,i),Nint,hij_elec) + e_corr += u_in(i,1)* hij_elec + endif + enddo + inv_c0 = 1.d0/u_in(index_hf,1) + do i = 1, N_double + e_corr_array(i) = e_corr_array(i) * inv_c0 + enddo + e_corr = e_corr * inv_c0 + e_corr_double = e_corr_double * inv_c0 + converged = .False. + e_corr_double_before = e_corr_double + iter = 0 + do while (.not.converged) + iter +=1 + !$OMP PARALLEL DEFAULT(NONE) & + !$OMP PRIVATE(i,j,degree,accu) & + !$OMP SHARED(H_jj_dressed,sze,H_jj_ref,index_hf,N_int,N_double,& + !$OMP dets_in,doubles,degree_exc,e_corr_array,e_corr_double) + !$OMP DO SCHEDULE(STATIC) + do i=1,sze + H_jj_dressed(i) = H_jj_ref(i) + if (i==index_hf)cycle + accu = -e_corr_double + select case (N_int) + case (1) + do j=1,N_double + degree = & + popcnt(xor( dets_in(1,1,i),doubles(1,1,j))) + & + popcnt(xor( dets_in(1,2,i),doubles(1,2,j))) + + if (degree<=ishft(degree_exc(i),1)) then + accu += e_corr_array(j) + endif + enddo + case (2) + do j=1,N_double + degree = & + popcnt(xor( dets_in(1,1,i),doubles(1,1,j))) + & + popcnt(xor( dets_in(1,2,i),doubles(1,2,j))) + & + popcnt(xor( dets_in(2,1,i),doubles(2,1,j))) + & + popcnt(xor( dets_in(2,2,i),doubles(2,2,j))) + + if (degree<=ishft(degree_exc(i),1)) then + accu += e_corr_array(j) + endif + enddo + case (3) + do j=1,N_double + degree = & + popcnt(xor( dets_in(1,1,i),doubles(1,1,j))) + & + popcnt(xor( dets_in(1,2,i),doubles(1,2,j))) + & + popcnt(xor( dets_in(2,1,i),doubles(2,1,j))) + & + popcnt(xor( dets_in(2,2,i),doubles(2,2,j))) + & + popcnt(xor( dets_in(3,1,i),doubles(3,1,j))) + & + popcnt(xor( dets_in(3,2,i),doubles(3,2,j))) + + if (degree<=ishft(degree_exc(i),1)) then + accu += e_corr_array(j) + endif + enddo + case default + do j=1,N_double + call get_excitation_degree(dets_in(1,1,i),doubles(1,1,j),degree,N_int) + if (degree<=degree_exc(i)) then + accu += e_corr_array(j) + endif + enddo + end select + H_jj_dressed(i) -= accu + enddo + !$OMP END DO + !$OMP END PARALLEL + + if(sze<=N_det_max_jacobi)then + double precision, allocatable :: eigenvectors(:,:), eigenvalues(:),H_matrix_tmp(:,:) + allocate (H_matrix_tmp(size(H_matrix_all_dets,1),sze),eigenvalues(sze),eigenvectors(size(H_matrix_all_dets,1),sze)) + do j=1,sze + do i=1,sze + H_matrix_tmp(i,j) = H_matrix_all_dets(i,j) + enddo + enddo + do i = 1,sze + H_matrix_tmp(i,i) = H_jj_dressed(i) + enddo + call lapack_diag(eigenvalues,eigenvectors, & + H_matrix_tmp,size(H_matrix_all_dets,1),sze) + do j=1,min(N_states_diag,sze) + do i=1,sze + u_in(i,j) = eigenvectors(i,j) + enddo + energies(j) = eigenvalues(j) + enddo + deallocate (H_matrix_tmp, eigenvalues, eigenvectors) + else + call davidson_diag_hjj(dets_in,u_in,H_jj_dressed,energies,dim_in,sze,N_st,N_states_diag,Nint,6) + endif + + e_corr_double = 0.d0 + inv_c0 = 1.d0/u_in(index_hf,1) + do i = 1, N_double + e_corr_array(i) = u_in(index_double(i),1)*inv_c0 * hij_double(i) + e_corr_double += e_corr_array(i) + enddo + write(6,'(A,I3)') 'SC2 Iteration ', iter + write(6,'(A)') '------------------' + write(6,'(A)') '' + write(6,'(A)') '===== ================' + write(6,'(A)') 'State Energy ' + write(6,'(A)') '===== ================' + do i=1,N_st + write(6,'(I5,1X,F16.10)') i, energies(i)+nuclear_repulsion + enddo + write(6,'(A)') '===== ================' + write(6,'(A)') '' + call write_double(6,(e_corr_double - e_corr_double_before),& + 'Delta(E_corr)') + converged = dabs(e_corr_double - e_corr_double_before) < convergence + converged = converged + if (converged) then + do i = 1, dim_in + diag_H_elements(i) = H_jj_dressed(i) - H_jj_ref(i) + enddo + exit + endif + e_corr_double_before = e_corr_double + + enddo + + call write_time(6) + deallocate (doubles,e_corr_array,H_jj_ref,H_jj_dressed, & + index_double, degree_exc, hij_double) + +end + + diff --git a/plugins/CISD_SC2_selected/EZFIO.cfg b/plugins/eginer/CISD_SC2_selected/EZFIO.cfg similarity index 100% rename from plugins/CISD_SC2_selected/EZFIO.cfg rename to plugins/eginer/CISD_SC2_selected/EZFIO.cfg diff --git a/plugins/CISD_SC2_selected/H_apply.irp.f b/plugins/eginer/CISD_SC2_selected/H_apply.irp.f similarity index 100% rename from plugins/CISD_SC2_selected/H_apply.irp.f rename to plugins/eginer/CISD_SC2_selected/H_apply.irp.f diff --git a/plugins/CISD_SC2_selected/NEEDED_CHILDREN_MODULES b/plugins/eginer/CISD_SC2_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/CISD_SC2_selected/NEEDED_CHILDREN_MODULES rename to plugins/eginer/CISD_SC2_selected/NEEDED_CHILDREN_MODULES diff --git a/plugins/CISD_SC2_selected/README.rst b/plugins/eginer/CISD_SC2_selected/README.rst similarity index 100% rename from plugins/CISD_SC2_selected/README.rst rename to plugins/eginer/CISD_SC2_selected/README.rst diff --git a/plugins/CISD_SC2_selected/cisd_sc2_selection.irp.f b/plugins/eginer/CISD_SC2_selected/cisd_sc2_selection.irp.f similarity index 100% rename from plugins/CISD_SC2_selected/cisd_sc2_selection.irp.f rename to plugins/eginer/CISD_SC2_selected/cisd_sc2_selection.irp.f diff --git a/plugins/CISD_selected/EZFIO.cfg b/plugins/eginer/CISD_selected/EZFIO.cfg similarity index 100% rename from plugins/CISD_selected/EZFIO.cfg rename to plugins/eginer/CISD_selected/EZFIO.cfg diff --git a/plugins/CISD_selected/H_apply.irp.f b/plugins/eginer/CISD_selected/H_apply.irp.f similarity index 100% rename from plugins/CISD_selected/H_apply.irp.f rename to plugins/eginer/CISD_selected/H_apply.irp.f diff --git a/plugins/CISD_selected/NEEDED_CHILDREN_MODULES b/plugins/eginer/CISD_selected/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/CISD_selected/NEEDED_CHILDREN_MODULES rename to plugins/eginer/CISD_selected/NEEDED_CHILDREN_MODULES diff --git a/plugins/CISD_selected/README.rst b/plugins/eginer/CISD_selected/README.rst similarity index 100% rename from plugins/CISD_selected/README.rst rename to plugins/eginer/CISD_selected/README.rst diff --git a/plugins/CISD_selected/cisd_selected.irp.f b/plugins/eginer/CISD_selected/cisd_selected.irp.f similarity index 100% rename from plugins/CISD_selected/cisd_selected.irp.f rename to plugins/eginer/CISD_selected/cisd_selected.irp.f diff --git a/plugins/DFT_Utils/EZFIO.cfg b/plugins/eginer/DFT_Utils/EZFIO.cfg similarity index 100% rename from plugins/DFT_Utils/EZFIO.cfg rename to plugins/eginer/DFT_Utils/EZFIO.cfg diff --git a/plugins/DFT_Utils/NEEDED_CHILDREN_MODULES b/plugins/eginer/DFT_Utils/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/DFT_Utils/NEEDED_CHILDREN_MODULES rename to plugins/eginer/DFT_Utils/NEEDED_CHILDREN_MODULES diff --git a/plugins/DFT_Utils/grid_density.irp.f b/plugins/eginer/DFT_Utils/grid_density.irp.f similarity index 100% rename from plugins/DFT_Utils/grid_density.irp.f rename to plugins/eginer/DFT_Utils/grid_density.irp.f diff --git a/plugins/DFT_Utils/integration_3d.irp.f b/plugins/eginer/DFT_Utils/integration_3d.irp.f similarity index 100% rename from plugins/DFT_Utils/integration_3d.irp.f rename to plugins/eginer/DFT_Utils/integration_3d.irp.f diff --git a/plugins/DFT_Utils/integration_radial.irp.f b/plugins/eginer/DFT_Utils/integration_radial.irp.f similarity index 100% rename from plugins/DFT_Utils/integration_radial.irp.f rename to plugins/eginer/DFT_Utils/integration_radial.irp.f diff --git a/plugins/DFT_Utils/routines_roland.irp.f b/plugins/eginer/DFT_Utils/routines_roland.irp.f similarity index 100% rename from plugins/DFT_Utils/routines_roland.irp.f rename to plugins/eginer/DFT_Utils/routines_roland.irp.f diff --git a/plugins/DFT_Utils/test_integration_3d_density.irp.f b/plugins/eginer/DFT_Utils/test_integration_3d_density.irp.f similarity index 100% rename from plugins/DFT_Utils/test_integration_3d_density.irp.f rename to plugins/eginer/DFT_Utils/test_integration_3d_density.irp.f diff --git a/plugins/Dressed_Ref_Hamiltonian/Dressed_Ref_Hamiltonian.main.irp.f b/plugins/eginer/Dressed_Ref_Hamiltonian/Dressed_Ref_Hamiltonian.main.irp.f similarity index 100% rename from plugins/Dressed_Ref_Hamiltonian/Dressed_Ref_Hamiltonian.main.irp.f rename to plugins/eginer/Dressed_Ref_Hamiltonian/Dressed_Ref_Hamiltonian.main.irp.f diff --git a/plugins/Dressed_Ref_Hamiltonian/NEEDED_CHILDREN_MODULES b/plugins/eginer/Dressed_Ref_Hamiltonian/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Dressed_Ref_Hamiltonian/NEEDED_CHILDREN_MODULES rename to plugins/eginer/Dressed_Ref_Hamiltonian/NEEDED_CHILDREN_MODULES diff --git a/plugins/Dressed_Ref_Hamiltonian/README.rst b/plugins/eginer/Dressed_Ref_Hamiltonian/README.rst similarity index 100% rename from plugins/Dressed_Ref_Hamiltonian/README.rst rename to plugins/eginer/Dressed_Ref_Hamiltonian/README.rst diff --git a/plugins/Dressed_Ref_Hamiltonian/dressed_eigenvectors.irp.f b/plugins/eginer/Dressed_Ref_Hamiltonian/dressed_eigenvectors.irp.f similarity index 100% rename from plugins/Dressed_Ref_Hamiltonian/dressed_eigenvectors.irp.f rename to plugins/eginer/Dressed_Ref_Hamiltonian/dressed_eigenvectors.irp.f diff --git a/plugins/Dressed_Ref_Hamiltonian/dressed_hamiltonian.irp.f b/plugins/eginer/Dressed_Ref_Hamiltonian/dressed_hamiltonian.irp.f similarity index 100% rename from plugins/Dressed_Ref_Hamiltonian/dressed_hamiltonian.irp.f rename to plugins/eginer/Dressed_Ref_Hamiltonian/dressed_hamiltonian.irp.f diff --git a/plugins/Dressed_Ref_Hamiltonian/print_CAS_effective_Hamiltonian.irp.f b/plugins/eginer/Dressed_Ref_Hamiltonian/print_CAS_effective_Hamiltonian.irp.f similarity index 100% rename from plugins/Dressed_Ref_Hamiltonian/print_CAS_effective_Hamiltonian.irp.f rename to plugins/eginer/Dressed_Ref_Hamiltonian/print_CAS_effective_Hamiltonian.irp.f diff --git a/plugins/FOBOCI/EZFIO.cfg b/plugins/eginer/FOBOCI/EZFIO.cfg similarity index 100% rename from plugins/FOBOCI/EZFIO.cfg rename to plugins/eginer/FOBOCI/EZFIO.cfg diff --git a/plugins/FOBOCI/H_apply.irp.f b/plugins/eginer/FOBOCI/H_apply.irp.f similarity index 100% rename from plugins/FOBOCI/H_apply.irp.f rename to plugins/eginer/FOBOCI/H_apply.irp.f diff --git a/plugins/FOBOCI/H_apply_dressed_autonom.irp.f b/plugins/eginer/FOBOCI/H_apply_dressed_autonom.irp.f similarity index 100% rename from plugins/FOBOCI/H_apply_dressed_autonom.irp.f rename to plugins/eginer/FOBOCI/H_apply_dressed_autonom.irp.f diff --git a/plugins/FOBOCI/NEEDED_CHILDREN_MODULES b/plugins/eginer/FOBOCI/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/FOBOCI/NEEDED_CHILDREN_MODULES rename to plugins/eginer/FOBOCI/NEEDED_CHILDREN_MODULES diff --git a/plugins/FOBOCI/README.rst b/plugins/eginer/FOBOCI/README.rst similarity index 100% rename from plugins/FOBOCI/README.rst rename to plugins/eginer/FOBOCI/README.rst diff --git a/plugins/FOBOCI/SC2_1h1p.irp.f b/plugins/eginer/FOBOCI/SC2_1h1p.irp.f similarity index 100% rename from plugins/FOBOCI/SC2_1h1p.irp.f rename to plugins/eginer/FOBOCI/SC2_1h1p.irp.f diff --git a/plugins/FOBOCI/all_singles.irp.f b/plugins/eginer/FOBOCI/all_singles.irp.f similarity index 100% rename from plugins/FOBOCI/all_singles.irp.f rename to plugins/eginer/FOBOCI/all_singles.irp.f diff --git a/plugins/FOBOCI/all_singles_split.irp.f b/plugins/eginer/FOBOCI/all_singles_split.irp.f similarity index 100% rename from plugins/FOBOCI/all_singles_split.irp.f rename to plugins/eginer/FOBOCI/all_singles_split.irp.f diff --git a/plugins/FOBOCI/collect_all_lmct.irp.f b/plugins/eginer/FOBOCI/collect_all_lmct.irp.f similarity index 100% rename from plugins/FOBOCI/collect_all_lmct.irp.f rename to plugins/eginer/FOBOCI/collect_all_lmct.irp.f diff --git a/plugins/FOBOCI/corr_energy_2h2p.irp.f b/plugins/eginer/FOBOCI/corr_energy_2h2p.irp.f similarity index 100% rename from plugins/FOBOCI/corr_energy_2h2p.irp.f rename to plugins/eginer/FOBOCI/corr_energy_2h2p.irp.f diff --git a/plugins/FOBOCI/create_1h_or_1p.irp.f b/plugins/eginer/FOBOCI/create_1h_or_1p.irp.f similarity index 100% rename from plugins/FOBOCI/create_1h_or_1p.irp.f rename to plugins/eginer/FOBOCI/create_1h_or_1p.irp.f diff --git a/plugins/FOBOCI/density_matrix.irp.f b/plugins/eginer/FOBOCI/density_matrix.irp.f similarity index 100% rename from plugins/FOBOCI/density_matrix.irp.f rename to plugins/eginer/FOBOCI/density_matrix.irp.f diff --git a/plugins/FOBOCI/diag_fock_inactiv_virt.irp.f b/plugins/eginer/FOBOCI/diag_fock_inactiv_virt.irp.f similarity index 100% rename from plugins/FOBOCI/diag_fock_inactiv_virt.irp.f rename to plugins/eginer/FOBOCI/diag_fock_inactiv_virt.irp.f diff --git a/plugins/FOBOCI/dress_simple.irp.f b/plugins/eginer/FOBOCI/dress_simple.irp.f similarity index 100% rename from plugins/FOBOCI/dress_simple.irp.f rename to plugins/eginer/FOBOCI/dress_simple.irp.f diff --git a/plugins/FOBOCI/fobo_coupled_ci.irp.f b/plugins/eginer/FOBOCI/fobo_coupled_ci.irp.f similarity index 100% rename from plugins/FOBOCI/fobo_coupled_ci.irp.f rename to plugins/eginer/FOBOCI/fobo_coupled_ci.irp.f diff --git a/plugins/FOBOCI/fobo_diff_dm.irp.f b/plugins/eginer/FOBOCI/fobo_diff_dm.irp.f similarity index 100% rename from plugins/FOBOCI/fobo_diff_dm.irp.f rename to plugins/eginer/FOBOCI/fobo_diff_dm.irp.f diff --git a/plugins/FOBOCI/fobo_scf.irp.f b/plugins/eginer/FOBOCI/fobo_scf.irp.f similarity index 100% rename from plugins/FOBOCI/fobo_scf.irp.f rename to plugins/eginer/FOBOCI/fobo_scf.irp.f diff --git a/plugins/FOBOCI/foboci_lmct_mlct_threshold_old.irp.f b/plugins/eginer/FOBOCI/foboci_lmct_mlct_threshold_old.irp.f similarity index 100% rename from plugins/FOBOCI/foboci_lmct_mlct_threshold_old.irp.f rename to plugins/eginer/FOBOCI/foboci_lmct_mlct_threshold_old.irp.f diff --git a/plugins/FOBOCI/foboci_reunion.irp.f b/plugins/eginer/FOBOCI/foboci_reunion.irp.f similarity index 100% rename from plugins/FOBOCI/foboci_reunion.irp.f rename to plugins/eginer/FOBOCI/foboci_reunion.irp.f diff --git a/plugins/FOBOCI/generators_restart_save.irp.f b/plugins/eginer/FOBOCI/generators_restart_save.irp.f similarity index 100% rename from plugins/FOBOCI/generators_restart_save.irp.f rename to plugins/eginer/FOBOCI/generators_restart_save.irp.f diff --git a/plugins/FOBOCI/modify_generators.irp.f b/plugins/eginer/FOBOCI/modify_generators.irp.f similarity index 100% rename from plugins/FOBOCI/modify_generators.irp.f rename to plugins/eginer/FOBOCI/modify_generators.irp.f diff --git a/plugins/FOBOCI/new_approach.irp.f b/plugins/eginer/FOBOCI/new_approach.irp.f similarity index 100% rename from plugins/FOBOCI/new_approach.irp.f rename to plugins/eginer/FOBOCI/new_approach.irp.f diff --git a/plugins/FOBOCI/new_new_approach.irp.f b/plugins/eginer/FOBOCI/new_new_approach.irp.f similarity index 100% rename from plugins/FOBOCI/new_new_approach.irp.f rename to plugins/eginer/FOBOCI/new_new_approach.irp.f diff --git a/plugins/FOBOCI/routine_new_approach.irp.f b/plugins/eginer/FOBOCI/routine_new_approach.irp.f similarity index 100% rename from plugins/FOBOCI/routine_new_approach.irp.f rename to plugins/eginer/FOBOCI/routine_new_approach.irp.f diff --git a/plugins/FOBOCI/routines_dressing.irp.f b/plugins/eginer/FOBOCI/routines_dressing.irp.f similarity index 100% rename from plugins/FOBOCI/routines_dressing.irp.f rename to plugins/eginer/FOBOCI/routines_dressing.irp.f diff --git a/plugins/FOBOCI/routines_foboci.irp.f b/plugins/eginer/FOBOCI/routines_foboci.irp.f similarity index 100% rename from plugins/FOBOCI/routines_foboci.irp.f rename to plugins/eginer/FOBOCI/routines_foboci.irp.f diff --git a/plugins/FOBOCI/save_fock_diag_inactiv_virt.irp.f b/plugins/eginer/FOBOCI/save_fock_diag_inactiv_virt.irp.f similarity index 100% rename from plugins/FOBOCI/save_fock_diag_inactiv_virt.irp.f rename to plugins/eginer/FOBOCI/save_fock_diag_inactiv_virt.irp.f diff --git a/plugins/Full_CI/EZFIO.cfg b/plugins/eginer/Full_CI/EZFIO.cfg similarity index 100% rename from plugins/Full_CI/EZFIO.cfg rename to plugins/eginer/Full_CI/EZFIO.cfg diff --git a/plugins/Full_CI/H_apply.irp.f b/plugins/eginer/Full_CI/H_apply.irp.f similarity index 100% rename from plugins/Full_CI/H_apply.irp.f rename to plugins/eginer/Full_CI/H_apply.irp.f diff --git a/plugins/Full_CI/NEEDED_CHILDREN_MODULES b/plugins/eginer/Full_CI/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Full_CI/NEEDED_CHILDREN_MODULES rename to plugins/eginer/Full_CI/NEEDED_CHILDREN_MODULES diff --git a/plugins/Full_CI/README.rst b/plugins/eginer/Full_CI/README.rst similarity index 100% rename from plugins/Full_CI/README.rst rename to plugins/eginer/Full_CI/README.rst diff --git a/plugins/eginer/Full_CI/e_curve.irp.f b/plugins/eginer/Full_CI/e_curve.irp.f new file mode 100644 index 00000000..babf5ee2 --- /dev/null +++ b/plugins/eginer/Full_CI/e_curve.irp.f @@ -0,0 +1,37 @@ +program e_curve + implicit none + integer :: i,j,k + double precision :: norm, E, hij, num, ci, cj + if (.not.read_wf) then + stop 'Please set read_wf to true' + endif + num = 0.d0 + norm = 0.d0 + do k=1,N_det +! do i=1,k-1 +! ci = psi_coef_sorted(i,1) +! do j=1,i-1 +! call i_h_j(psi_det_sorted(1,1,i), psi_det_sorted(1,1,j), N_int, hij) +! cj = psi_coef_sorted(j,1) +! num = num + 2.d0*ci*cj * hij +! enddo +! call i_h_j(psi_det_sorted(1,1,i), psi_det_sorted(1,1,i), N_int, hij) +! num = num + ci*ci * hij +! norm = norm + ci*ci +! enddo + i=k + ci = psi_coef_sorted(i,1) + do j=1,i-1 + call i_h_j(psi_det_sorted(1,1,i), psi_det_sorted(1,1,j), N_int, hij) + cj = psi_coef_sorted(j,1) + num = num + 2.d0*ci*cj * hij + enddo + call i_h_j(psi_det_sorted(1,1,i), psi_det_sorted(1,1,i), N_int, hij) + num = num + ci*ci * hij + norm = norm + ci*ci + E = num / norm + nuclear_repulsion + print *, k, E, real(num), real(norm) + enddo + +end + diff --git a/plugins/eginer/Full_CI/exc_degree.irp.f b/plugins/eginer/Full_CI/exc_degree.irp.f new file mode 100644 index 00000000..a02fc967 --- /dev/null +++ b/plugins/eginer/Full_CI/exc_degree.irp.f @@ -0,0 +1,61 @@ +program full_ci + use bitmasks + implicit none + integer :: i,k + integer :: tab(0:100) + integer :: tab_ab(2,0:100) + integer :: degree, degree_max, degree_max_ab + double precision :: av_deg, av_deg_ab, norm(0:2,0:100) + + if (N_int > 1) then + stop 'Works only for N_int=1' + endif + + tab = 0 + tab_ab = 0 + degree_max = -1 + degree_max_ab = -1 + av_deg = 0.d0 + av_deg_ab = 0.d0 + norm = 0.d0 + + do i=1,N_det + call get_excitation_degree(psi_det_sorted(1,1,1), psi_det_sorted(1,1,i), degree, N_int) + tab(degree) += 1 + degree_max = max(degree_max,degree) + av_deg += dble(degree) + norm(0,degree) += psi_coef_sorted(i,1)*psi_coef_sorted(i,1) + enddo + av_deg = av_deg/dble(N_det) + + do i=1,n_det_alpha_unique + degree = popcnt(xor( psi_det_sorted(1,1,1), psi_det_alpha_unique(1,i)) )/2 + degree_max_ab = max(degree_max_ab,degree) + av_deg_ab += dble(degree) + tab_ab(1,degree) += 1 + norm(1,degree) += det_alpha_norm(i) + enddo + do i=1,n_det_beta_unique + degree = popcnt(xor( psi_det_sorted(1,2,1), psi_det_beta_unique(1,i)) )/2 + degree_max_ab = max(degree_max_ab,degree) + av_deg_ab += dble(degree) + tab_ab(2,degree) += 1 + norm(2,degree) += det_beta_norm(i) + enddo + av_deg_ab = av_deg_ab/dble(n_det_alpha_unique+n_det_beta_unique) + + print *, '' + print *, 'Exc Det_a x Det_b Norm' + do i=0,degree_max + print '(I2,2X,I5,2X,G16.8)', i, tab(i), norm(0,i) + enddo + print *, '' + print *, 'Exc Det_a Norm Det_b Norm' + do i=0,degree_max_ab + print '(I2,2(2X,I5,2X,G16.8))', i, tab_ab(1,i), norm(1,i), tab_ab(2,i), norm(2,i) + enddo + print *, '' + print *, 'Average excitation degree :', av_deg + print *, 'Average excitation degree (spin) :', av_deg_ab + +end diff --git a/plugins/Full_CI/full_ci.irp.f b/plugins/eginer/Full_CI/full_ci.irp.f similarity index 100% rename from plugins/Full_CI/full_ci.irp.f rename to plugins/eginer/Full_CI/full_ci.irp.f diff --git a/plugins/eginer/Full_CI/full_ci_no_selection.irp.f b/plugins/eginer/Full_CI/full_ci_no_selection.irp.f new file mode 100644 index 00000000..878dcff9 --- /dev/null +++ b/plugins/eginer/Full_CI/full_ci_no_selection.irp.f @@ -0,0 +1,92 @@ +program full_ci + implicit none + integer :: i,k + + + double precision, allocatable :: pt2(:), norm_pert(:), H_pert_diag(:) + integer :: N_st, degree + N_st = N_states + allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st)) + character*(64) :: perturbation + + pt2 = 1.d0 + diag_algorithm = "Lapack" + if (N_det > N_det_max) then + call diagonalize_CI + call save_wavefunction + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + N_det = N_det_max + soft_touch N_det psi_det psi_coef + call diagonalize_CI + call save_wavefunction + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print *, 'PT2 = ', pt2 + print *, 'E = ', CI_energy + print *, 'E+PT2 = ', CI_energy+pt2 + print *, '-----' + endif + double precision :: i_H_psi_array(N_states),diag_H_mat_elem,h,i_O1_psi_array(N_states) + double precision :: E_CI_before(N_states) + if(read_wf)then + call i_H_psi(psi_det(1,1,N_det),psi_det,psi_coef,N_int,N_det,psi_det_size,N_states,i_H_psi_array) + h = diag_H_mat_elem(psi_det(1,1,N_det),N_int) + selection_criterion = dabs(psi_coef(N_det,1) * (i_H_psi_array(1) - h * psi_coef(N_det,1))) * 0.1d0 + soft_touch selection_criterion + endif + + + integer :: n_det_before + print*,'Beginning the selection ...' + E_CI_before = CI_energy + do while (N_det < N_det_max.and.maxval(abs(pt2(1:N_st))) > pt2_max) + n_det_before = N_det + call H_apply_FCI_no_selection(pt2, norm_pert, H_pert_diag, N_st) + + PROVIDE psi_coef + PROVIDE psi_det + PROVIDE psi_det_sorted + + if (N_det > N_det_max) then + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + N_det = N_det_max + soft_touch N_det psi_det psi_coef + endif + call diagonalize_CI + call save_wavefunction + if(n_det_before == N_det)then + selection_criterion = selection_criterion * 0.5d0 + endif + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print *, 'PT2 = ', pt2 + print *, 'E = ', CI_energy + print *, 'E+PT2 = ', E_CI_before+pt2 + print *, '-----' + E_CI_before = CI_energy + call ezfio_set_full_ci_energy(CI_energy) + enddo + N_det = min(N_det_max,N_det) + touch N_det psi_det psi_coef + call diagonalize_CI + if(do_pt2)then + print*,'Last iteration only to compute the PT2' +! print*,'The thres' + threshold_selectors = 1.d0 + threshold_generators = 0.999d0 + call H_apply_FCI_PT2(pt2, norm_pert, H_pert_diag, N_st) + + print *, 'Final step' + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print *, 'PT2 = ', pt2 + print *, 'E = ', CI_energy + print *, 'E+PT2 = ', CI_energy+pt2 + print *, '-----' + call ezfio_set_full_ci_energy_pt2(CI_energy+pt2) + endif + call save_wavefunction + deallocate(pt2,norm_pert) +end diff --git a/plugins/eginer/Full_CI/out b/plugins/eginer/Full_CI/out new file mode 100644 index 00000000..6c2d8ecc --- /dev/null +++ b/plugins/eginer/Full_CI/out @@ -0,0 +1,493 @@ +[1/2] /home/scemama/quantum_package/scripts/compilation/qp_create_ninja.py update +[2/2] Compile only Full_CI +[2/4] Generating Png representation of the Tree Dependencies of Full_CI +[2/4] Running IRPF90 for Full_CI +[4/4] Create all the binaries from Full_CI +[1/17] F : sort.irp.F90 -> Utils/sort +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:92.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:94.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:95.11: + + integer*8 :: i, k, j, l, i0 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:240.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:242.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:243.11: + + integer*8 :: i, k, j, l, i0 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:388.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:390.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:391.11: + + integer*8 :: i, k, j, l, i0 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:457.11: + + integer*8,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:459.11: + + integer*8 :: xtmp ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:481.11: + + integer*8,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:484.11: + + integer*8 :: xtemp ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:536.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:537.11: + + integer*8,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:538.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:539.11: + + integer*8 :: i, k, j, l, i0 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:540.11: + + integer*8 :: xtemp ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:593.11: + + integer*8,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:605.11: + + integer*2,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:607.11: + + integer*2 :: xtmp ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:629.11: + + integer*2,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:632.11: + + integer*2 :: xtemp ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:684.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:685.11: + + integer*2,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:686.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:687.11: + + integer*8 :: i, k, j, l, i0 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:688.11: + + integer*2 :: xtemp ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:741.11: + + integer*2,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:804.11: + + integer*8 :: x(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:805.11: + + integer*8,allocatable :: xtmp(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:821.11: + + integer*2 :: x(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:822.11: + + integer*2,allocatable :: xtmp(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:837.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:839.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:841.11: + + integer*8 :: i, i0, j, jmax ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:861.11: + + integer*8 :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:864.11: + + integer*8 :: iorder(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:865.11: + + integer*8 :: i ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:878.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:880.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:882.11: + + integer*8 :: i, i0, j, jmax ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:902.11: + + integer*8 :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:905.11: + + integer*8 :: iorder(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:906.11: + + integer*8 :: i ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:919.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:921.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:923.11: + + integer*8 :: i, i0, j, jmax ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:943.11: + + integer*8 :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:946.11: + + integer*8 :: iorder(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:947.11: + + integer*8 :: i ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:960.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:961.11: + + integer*8,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:962.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:963.11: + + integer*8 :: xtmp ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:964.11: + + integer*8 :: i, i0, j, jmax ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:984.11: + + integer*8 :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:985.11: + + integer*8 :: x(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:986.11: + + integer*8, allocatable :: xtmp(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:987.11: + + integer*8 :: iorder(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:988.11: + + integer*8 :: i ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1001.11: + + integer*8,intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1002.11: + + integer*2,intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1003.11: + + integer*8,intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1004.11: + + integer*2 :: xtmp ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1005.11: + + integer*8 :: i, i0, j, jmax ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1025.11: + + integer*8 :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1026.11: + + integer*2 :: x(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1027.11: + + integer*2, allocatable :: xtmp(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1028.11: + + integer*8 :: iorder(*) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1029.11: + + integer*8 :: i ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1165.11: + + integer*8, intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1168.11: + + integer*8, allocatable :: x2(:), x1(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1169.11: + + integer*8 :: i4 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1173.11: + + integer*8, parameter :: zero=0_8 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1174.11: + + integer*8 :: mask ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1286.11: + + integer*2, intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1289.11: + + integer*2, allocatable :: x2(:), x1(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1290.11: + + integer*2 :: i4 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1294.11: + + integer*2, parameter :: zero=0 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1295.11: + + integer*2 :: mask ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*2 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1405.11: + + integer*8, intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1406.11: + + integer*8, intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1412.11: + + integer*8, allocatable :: iorder1(:),iorder2(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1413.11: + + integer*8 :: i0, i1, i2, i3, i ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1526.11: + + integer*8, intent(in) :: isize ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1527.11: + + integer*8, intent(inout) :: iorder(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1528.11: + + integer*8, intent(inout) :: x(isize) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1531.11: + + integer*8, allocatable :: x2(:), x1(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1532.11: + + integer*8 :: i4 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1533.11: + + integer*8, allocatable :: iorder1(:),iorder2(:) ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1534.11: + + integer*8 :: i0, i1, i2, i3, i ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1536.11: + + integer*8, parameter :: zero=0_8 ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +/home/scemama/quantum_package/plugins/Full_CI/IRPF90_temp/Utils/sort.irp.F90:1537.11: + + integer*8 :: mask ! Utils/sort.i + 1 +Warning: Nonstandard type declaration INTEGER*8 at (1) +[2/17] F : irp_touches.irp.F90 -> irp_touches.irp.o +[10/17] F : e_curve.irp.F90 -> e_curve.irp.o +[10/17] F : micro_pt2.irp.F90 -> micro_pt2.irp.o +[10/17] F : exc_degree.irp.F90 -> exc_degree.irp.o +[10/17] Link: irpf90.a +[13/17] F : var_pt2_ratio.irp.F90 -> var_pt2_ratio.irp.o +[14/17] F : target_pt2.irp.F90 -> target_pt2.irp.o +[15/17] F : full_ci.irp.F90 -> full_ci.irp.o +[16/17] F : full_ci_no_skip.irp.F90 -> full_ci_no_skip.irp.o +[17/17] Link: e_curve +[17/17] Link: exc_degree +[17/17] Link: micro_pt2 +[17/17] Link: var_pt2_ratio +[17/17] Link: full_ci +[17/17] Link: target_pt2 +[17/17] Link: full_ci_no_skip +[4/4] update_README Full_CI diff --git a/plugins/Full_CI/target_pt2.irp.f b/plugins/eginer/Full_CI/target_pt2.irp.f similarity index 100% rename from plugins/Full_CI/target_pt2.irp.f rename to plugins/eginer/Full_CI/target_pt2.irp.f diff --git a/plugins/Full_CI/var_pt2_ratio.irp.f b/plugins/eginer/Full_CI/var_pt2_ratio.irp.f similarity index 100% rename from plugins/Full_CI/var_pt2_ratio.irp.f rename to plugins/eginer/Full_CI/var_pt2_ratio.irp.f diff --git a/plugins/Generators_restart/ASSUMPTIONS.rst b/plugins/eginer/Generators_restart/ASSUMPTIONS.rst similarity index 100% rename from plugins/Generators_restart/ASSUMPTIONS.rst rename to plugins/eginer/Generators_restart/ASSUMPTIONS.rst diff --git a/plugins/Generators_CAS/NEEDED_CHILDREN_MODULES b/plugins/eginer/Generators_restart/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Generators_CAS/NEEDED_CHILDREN_MODULES rename to plugins/eginer/Generators_restart/NEEDED_CHILDREN_MODULES diff --git a/plugins/Generators_restart/README.rst b/plugins/eginer/Generators_restart/README.rst similarity index 100% rename from plugins/Generators_restart/README.rst rename to plugins/eginer/Generators_restart/README.rst diff --git a/plugins/Generators_restart/generators.irp.f b/plugins/eginer/Generators_restart/generators.irp.f similarity index 100% rename from plugins/Generators_restart/generators.irp.f rename to plugins/eginer/Generators_restart/generators.irp.f diff --git a/plugins/eginer/MRPT/EZFIO.cfg b/plugins/eginer/MRPT/EZFIO.cfg new file mode 100644 index 00000000..f3edf7ec --- /dev/null +++ b/plugins/eginer/MRPT/EZFIO.cfg @@ -0,0 +1,7 @@ +[save_dressed_wf] +type: logical +doc: If true, save the dressed eigenvectors +interface: ezfio,provider,ocaml +default: False + + diff --git a/plugins/MRPT/NEEDED_CHILDREN_MODULES b/plugins/eginer/MRPT/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/MRPT/NEEDED_CHILDREN_MODULES rename to plugins/eginer/MRPT/NEEDED_CHILDREN_MODULES diff --git a/plugins/MRPT/README.rst b/plugins/eginer/MRPT/README.rst similarity index 100% rename from plugins/MRPT/README.rst rename to plugins/eginer/MRPT/README.rst diff --git a/plugins/MRPT/jm_mrpt2.irp.f b/plugins/eginer/MRPT/jm_mrpt2.irp.f similarity index 100% rename from plugins/MRPT/jm_mrpt2.irp.f rename to plugins/eginer/MRPT/jm_mrpt2.irp.f diff --git a/plugins/MRPT/print_1h2p.irp.f b/plugins/eginer/MRPT/print_1h2p.irp.f similarity index 100% rename from plugins/MRPT/print_1h2p.irp.f rename to plugins/eginer/MRPT/print_1h2p.irp.f diff --git a/plugins/MRPT_Utils/EZFIO.cfg b/plugins/eginer/MRPT_Utils/EZFIO.cfg similarity index 100% rename from plugins/MRPT_Utils/EZFIO.cfg rename to plugins/eginer/MRPT_Utils/EZFIO.cfg diff --git a/plugins/MRPT_Utils/H_apply.irp.f b/plugins/eginer/MRPT_Utils/H_apply.irp.f similarity index 100% rename from plugins/MRPT_Utils/H_apply.irp.f rename to plugins/eginer/MRPT_Utils/H_apply.irp.f diff --git a/plugins/MRPT_Utils/NEEDED_CHILDREN_MODULES b/plugins/eginer/MRPT_Utils/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/MRPT_Utils/NEEDED_CHILDREN_MODULES rename to plugins/eginer/MRPT_Utils/NEEDED_CHILDREN_MODULES diff --git a/plugins/MRPT_Utils/README.rst b/plugins/eginer/MRPT_Utils/README.rst similarity index 100% rename from plugins/MRPT_Utils/README.rst rename to plugins/eginer/MRPT_Utils/README.rst diff --git a/plugins/MRPT_Utils/density_matrix_based.irp.f b/plugins/eginer/MRPT_Utils/density_matrix_based.irp.f similarity index 100% rename from plugins/MRPT_Utils/density_matrix_based.irp.f rename to plugins/eginer/MRPT_Utils/density_matrix_based.irp.f diff --git a/plugins/MRPT_Utils/energies_cas.irp.f b/plugins/eginer/MRPT_Utils/energies_cas.irp.f similarity index 100% rename from plugins/MRPT_Utils/energies_cas.irp.f rename to plugins/eginer/MRPT_Utils/energies_cas.irp.f diff --git a/plugins/MRPT_Utils/excitations_cas.irp.f b/plugins/eginer/MRPT_Utils/excitations_cas.irp.f similarity index 100% rename from plugins/MRPT_Utils/excitations_cas.irp.f rename to plugins/eginer/MRPT_Utils/excitations_cas.irp.f diff --git a/plugins/MRPT_Utils/fock_like_operators.irp.f b/plugins/eginer/MRPT_Utils/fock_like_operators.irp.f similarity index 100% rename from plugins/MRPT_Utils/fock_like_operators.irp.f rename to plugins/eginer/MRPT_Utils/fock_like_operators.irp.f diff --git a/plugins/MRPT_Utils/give_2h2p.irp.f b/plugins/eginer/MRPT_Utils/give_2h2p.irp.f similarity index 100% rename from plugins/MRPT_Utils/give_2h2p.irp.f rename to plugins/eginer/MRPT_Utils/give_2h2p.irp.f diff --git a/plugins/MRPT_Utils/mrpt_dress.irp.f b/plugins/eginer/MRPT_Utils/mrpt_dress.irp.f similarity index 100% rename from plugins/MRPT_Utils/mrpt_dress.irp.f rename to plugins/eginer/MRPT_Utils/mrpt_dress.irp.f diff --git a/plugins/MRPT_Utils/mrpt_utils.irp.f b/plugins/eginer/MRPT_Utils/mrpt_utils.irp.f similarity index 100% rename from plugins/MRPT_Utils/mrpt_utils.irp.f rename to plugins/eginer/MRPT_Utils/mrpt_utils.irp.f diff --git a/plugins/MRPT_Utils/new_way.irp.f b/plugins/eginer/MRPT_Utils/new_way.irp.f similarity index 100% rename from plugins/MRPT_Utils/new_way.irp.f rename to plugins/eginer/MRPT_Utils/new_way.irp.f diff --git a/plugins/MRPT_Utils/new_way_second_order_coef.irp.f b/plugins/eginer/MRPT_Utils/new_way_second_order_coef.irp.f similarity index 100% rename from plugins/MRPT_Utils/new_way_second_order_coef.irp.f rename to plugins/eginer/MRPT_Utils/new_way_second_order_coef.irp.f diff --git a/plugins/MRPT_Utils/psi_active_prov.irp.f b/plugins/eginer/MRPT_Utils/psi_active_prov.irp.f similarity index 100% rename from plugins/MRPT_Utils/psi_active_prov.irp.f rename to plugins/eginer/MRPT_Utils/psi_active_prov.irp.f diff --git a/plugins/MRPT_Utils/second_order_new.irp.f b/plugins/eginer/MRPT_Utils/second_order_new.irp.f similarity index 100% rename from plugins/MRPT_Utils/second_order_new.irp.f rename to plugins/eginer/MRPT_Utils/second_order_new.irp.f diff --git a/plugins/MRPT_Utils/second_order_new_2p.irp.f b/plugins/eginer/MRPT_Utils/second_order_new_2p.irp.f similarity index 100% rename from plugins/MRPT_Utils/second_order_new_2p.irp.f rename to plugins/eginer/MRPT_Utils/second_order_new_2p.irp.f diff --git a/plugins/MRPT_Utils/set_as_holes_and_particles.irp.f b/plugins/eginer/MRPT_Utils/set_as_holes_and_particles.irp.f similarity index 100% rename from plugins/MRPT_Utils/set_as_holes_and_particles.irp.f rename to plugins/eginer/MRPT_Utils/set_as_holes_and_particles.irp.f diff --git a/plugins/MRPT_Utils/utils_bitmask.irp.f b/plugins/eginer/MRPT_Utils/utils_bitmask.irp.f similarity index 100% rename from plugins/MRPT_Utils/utils_bitmask.irp.f rename to plugins/eginer/MRPT_Utils/utils_bitmask.irp.f diff --git a/plugins/MR_wf_analysis/analyze_one_det_connections.irp.f b/plugins/eginer/MR_wf_analysis/analyze_one_det_connections.irp.f similarity index 100% rename from plugins/MR_wf_analysis/analyze_one_det_connections.irp.f rename to plugins/eginer/MR_wf_analysis/analyze_one_det_connections.irp.f diff --git a/plugins/MR_wf_analysis/analyze_sr_wf.irp.f b/plugins/eginer/MR_wf_analysis/analyze_sr_wf.irp.f similarity index 100% rename from plugins/MR_wf_analysis/analyze_sr_wf.irp.f rename to plugins/eginer/MR_wf_analysis/analyze_sr_wf.irp.f diff --git a/plugins/OVB/NEEDED_CHILDREN_MODULES b/plugins/eginer/OVB/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/OVB/NEEDED_CHILDREN_MODULES rename to plugins/eginer/OVB/NEEDED_CHILDREN_MODULES diff --git a/plugins/OVB/README.rst b/plugins/eginer/OVB/README.rst similarity index 100% rename from plugins/OVB/README.rst rename to plugins/eginer/OVB/README.rst diff --git a/plugins/OVB/ovb_components.irp.f b/plugins/eginer/OVB/ovb_components.irp.f similarity index 100% rename from plugins/OVB/ovb_components.irp.f rename to plugins/eginer/OVB/ovb_components.irp.f diff --git a/plugins/OVB/print_ovb.irp.f b/plugins/eginer/OVB/print_ovb.irp.f similarity index 100% rename from plugins/OVB/print_ovb.irp.f rename to plugins/eginer/OVB/print_ovb.irp.f diff --git a/plugins/OVB_effective_Hamiltonian/NEEDED_CHILDREN_MODULES b/plugins/eginer/OVB_effective_Hamiltonian/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/OVB_effective_Hamiltonian/NEEDED_CHILDREN_MODULES rename to plugins/eginer/OVB_effective_Hamiltonian/NEEDED_CHILDREN_MODULES diff --git a/plugins/OVB_effective_Hamiltonian/OVB_effective_H.irp.f b/plugins/eginer/OVB_effective_Hamiltonian/OVB_effective_H.irp.f similarity index 100% rename from plugins/OVB_effective_Hamiltonian/OVB_effective_H.irp.f rename to plugins/eginer/OVB_effective_Hamiltonian/OVB_effective_H.irp.f diff --git a/plugins/OVB_effective_Hamiltonian/README.rst b/plugins/eginer/OVB_effective_Hamiltonian/README.rst similarity index 100% rename from plugins/OVB_effective_Hamiltonian/README.rst rename to plugins/eginer/OVB_effective_Hamiltonian/README.rst diff --git a/plugins/OVB_effective_Hamiltonian/print_OVB_effective_H_diagonalized.irp.f b/plugins/eginer/OVB_effective_Hamiltonian/print_OVB_effective_H_diagonalized.irp.f similarity index 100% rename from plugins/OVB_effective_Hamiltonian/print_OVB_effective_H_diagonalized.irp.f rename to plugins/eginer/OVB_effective_Hamiltonian/print_OVB_effective_H_diagonalized.irp.f diff --git a/plugins/OVB_effective_Hamiltonian/save_wf_only_ionic_and_1p_amplitudes.irp.f b/plugins/eginer/OVB_effective_Hamiltonian/save_wf_only_ionic_and_1p_amplitudes.irp.f similarity index 100% rename from plugins/OVB_effective_Hamiltonian/save_wf_only_ionic_and_1p_amplitudes.irp.f rename to plugins/eginer/OVB_effective_Hamiltonian/save_wf_only_ionic_and_1p_amplitudes.irp.f diff --git a/plugins/OVB_effective_Hamiltonian/save_wf_only_neutral_and_1p_amplitudes.irp.f b/plugins/eginer/OVB_effective_Hamiltonian/save_wf_only_neutral_and_1p_amplitudes.irp.f similarity index 100% rename from plugins/OVB_effective_Hamiltonian/save_wf_only_neutral_and_1p_amplitudes.irp.f rename to plugins/eginer/OVB_effective_Hamiltonian/save_wf_only_neutral_and_1p_amplitudes.irp.f diff --git a/plugins/Generators_restart/NEEDED_CHILDREN_MODULES b/plugins/eginer/Orbital_Entanglement/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Generators_restart/NEEDED_CHILDREN_MODULES rename to plugins/eginer/Orbital_Entanglement/NEEDED_CHILDREN_MODULES diff --git a/plugins/Orbital_Entanglement/Orbital_Entanglement.irp.f b/plugins/eginer/Orbital_Entanglement/Orbital_Entanglement.irp.f similarity index 100% rename from plugins/Orbital_Entanglement/Orbital_Entanglement.irp.f rename to plugins/eginer/Orbital_Entanglement/Orbital_Entanglement.irp.f diff --git a/plugins/Orbital_Entanglement/README.rst b/plugins/eginer/Orbital_Entanglement/README.rst similarity index 100% rename from plugins/Orbital_Entanglement/README.rst rename to plugins/eginer/Orbital_Entanglement/README.rst diff --git a/plugins/Orbital_Entanglement/print_entanglement.irp.f b/plugins/eginer/Orbital_Entanglement/print_entanglement.irp.f similarity index 100% rename from plugins/Orbital_Entanglement/print_entanglement.irp.f rename to plugins/eginer/Orbital_Entanglement/print_entanglement.irp.f diff --git a/plugins/Properties/EZFIO.cfg b/plugins/eginer/Properties/EZFIO.cfg similarity index 100% rename from plugins/Properties/EZFIO.cfg rename to plugins/eginer/Properties/EZFIO.cfg diff --git a/plugins/Properties/NEEDED_CHILDREN_MODULES b/plugins/eginer/Properties/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Properties/NEEDED_CHILDREN_MODULES rename to plugins/eginer/Properties/NEEDED_CHILDREN_MODULES diff --git a/plugins/Properties/README.rst b/plugins/eginer/Properties/README.rst similarity index 100% rename from plugins/Properties/README.rst rename to plugins/eginer/Properties/README.rst diff --git a/plugins/Properties/average.irp.f b/plugins/eginer/Properties/average.irp.f similarity index 100% rename from plugins/Properties/average.irp.f rename to plugins/eginer/Properties/average.irp.f diff --git a/plugins/Properties/delta_rho.irp.f b/plugins/eginer/Properties/delta_rho.irp.f similarity index 100% rename from plugins/Properties/delta_rho.irp.f rename to plugins/eginer/Properties/delta_rho.irp.f diff --git a/plugins/eginer/Properties/dipole_moment.irp.f b/plugins/eginer/Properties/dipole_moment.irp.f new file mode 100644 index 00000000..1fbcb1c6 --- /dev/null +++ b/plugins/eginer/Properties/dipole_moment.irp.f @@ -0,0 +1,73 @@ +! This subroutine makes Properties depend on DavidsonDressed. As Perturbation needs properties (???) +! everything is mixed up. This routine should be put somewhere else, in its own module maybe.... + + + + +!subroutine pt2_dipole_moment_z(det_pert,c_pert,e_2_pert,H_pert_diag,Nint,ndet,n_st,minilist,idx_minilist,N_minilist) +! use bitmasks +! implicit none +! integer, intent(in) :: Nint,ndet,n_st +! integer(bit_kind), intent(in) :: det_pert(Nint,2) +! double precision , intent(out) :: c_pert(n_st),e_2_pert(n_st),H_pert_diag(N_st) +! double precision :: i_O1_psi_array(N_st) +! double precision :: i_H_psi_array(N_st) +! +! integer, intent(in) :: N_minilist +! integer, intent(in) :: idx_minilist(0:N_det_selectors) +! integer(bit_kind), intent(in) :: minilist(Nint,2,N_det_selectors) +! +! BEGIN_DOC +! ! compute the perturbative contribution to the dipole moment of one determinant +! ! +! ! for the various n_st states, at various level of theory. +! ! +! ! c_pert(i) = /( - ) +! ! +! ! e_2_pert(i) = c_pert(i) * +! ! +! ! H_pert_diag(i) = c_pert(i)^2 * +! ! +! ! To get the contribution of the first order : +! ! +! ! = sum(over i) e_2_pert(i) +! ! +! ! To get the contribution of the diagonal elements of the second order : +! ! +! ! [ + + sum(over i) H_pert_diag(i) ] / [1. + sum(over i) c_pert(i) **2] +! ! +! END_DOC +! +! integer :: i,j +! double precision :: diag_H_mat_elem +! integer :: exc(0:2,2,2) +! integer :: degree +! double precision :: phase,delta_e,h,oii,diag_o1_mat_elem +! integer :: h1,h2,p1,p2,s1,s2 +! ASSERT (Nint == N_int) +! ASSERT (Nint > 0) +! +! +! call i_O1_psi(mo_dipole_z,det_pert,psi_selectors,psi_selectors_coef,Nint,N_det_selectors,psi_selectors_size,N_st,i_O1_psi_array) +! call i_H_psi_minilist(det_pert,minilist,idx_minilist,N_minilist,psi_selectors_coef,Nint,N_minilist,psi_selectors_size,N_st,i_H_psi_array) +! +! h = diag_H_mat_elem(det_pert,Nint) +! oii = diag_O1_mat_elem(mo_dipole_z,det_pert,N_int) +! +! +! do i =1,N_st +! if(CI_electronic_energy(i)>h.and.CI_electronic_energy(i).ne.0.d0)then +! c_pert(i) = -1.d0 +! e_2_pert(i) = selection_criterion*selection_criterion_factor*2.d0 +! else if (dabs(CI_electronic_energy(i) - h) > 1.d-6) then +! c_pert(i) = i_H_psi_array(i) / (CI_electronic_energy(i) - h) +! e_2_pert(i) = c_pert(i) * (i_O1_psi_array(i)+i_O1_psi_array(i) ) +! H_pert_diag(i) = e_2_pert(i) + c_pert(i) * c_pert(i) * oii +! else +! c_pert(i) = -1.d0 +! e_2_pert(i) = -dabs(i_H_psi_array(i)) +! H_pert_diag(i) = c_pert(i) * i_O1_psi_array(i) +! endif +! enddo +!end + diff --git a/plugins/Properties/give_mos_at_r.irp.f b/plugins/eginer/Properties/give_mos_at_r.irp.f similarity index 100% rename from plugins/Properties/give_mos_at_r.irp.f rename to plugins/eginer/Properties/give_mos_at_r.irp.f diff --git a/plugins/Properties/hyperfine_constants.irp.f b/plugins/eginer/Properties/hyperfine_constants.irp.f similarity index 100% rename from plugins/Properties/hyperfine_constants.irp.f rename to plugins/eginer/Properties/hyperfine_constants.irp.f diff --git a/plugins/Properties/iunit_two_bod.irp.f b/plugins/eginer/Properties/iunit_two_bod.irp.f similarity index 100% rename from plugins/Properties/iunit_two_bod.irp.f rename to plugins/eginer/Properties/iunit_two_bod.irp.f diff --git a/plugins/Properties/mulliken.irp.f b/plugins/eginer/Properties/mulliken.irp.f similarity index 100% rename from plugins/Properties/mulliken.irp.f rename to plugins/eginer/Properties/mulliken.irp.f diff --git a/plugins/Properties/print_hcc.irp.f b/plugins/eginer/Properties/print_hcc.irp.f similarity index 100% rename from plugins/Properties/print_hcc.irp.f rename to plugins/eginer/Properties/print_hcc.irp.f diff --git a/plugins/Properties/print_mulliken.irp.f b/plugins/eginer/Properties/print_mulliken.irp.f similarity index 100% rename from plugins/Properties/print_mulliken.irp.f rename to plugins/eginer/Properties/print_mulliken.irp.f diff --git a/plugins/Properties/print_spin_density.irp.f b/plugins/eginer/Properties/print_spin_density.irp.f similarity index 100% rename from plugins/Properties/print_spin_density.irp.f rename to plugins/eginer/Properties/print_spin_density.irp.f diff --git a/plugins/Properties/properties.irp.f b/plugins/eginer/Properties/properties.irp.f similarity index 100% rename from plugins/Properties/properties.irp.f rename to plugins/eginer/Properties/properties.irp.f diff --git a/plugins/Properties/provide_deltarho.irp.f b/plugins/eginer/Properties/provide_deltarho.irp.f similarity index 100% rename from plugins/Properties/provide_deltarho.irp.f rename to plugins/eginer/Properties/provide_deltarho.irp.f diff --git a/plugins/Properties/routines_test.irp.f b/plugins/eginer/Properties/routines_test.irp.f similarity index 100% rename from plugins/Properties/routines_test.irp.f rename to plugins/eginer/Properties/routines_test.irp.f diff --git a/plugins/Properties/slater_rules_mono_electronic.irp.f b/plugins/eginer/Properties/slater_rules_mono_electronic.irp.f similarity index 100% rename from plugins/Properties/slater_rules_mono_electronic.irp.f rename to plugins/eginer/Properties/slater_rules_mono_electronic.irp.f diff --git a/plugins/Properties/test_two_body_dm.irp.f b/plugins/eginer/Properties/test_two_body_dm.irp.f similarity index 100% rename from plugins/Properties/test_two_body_dm.irp.f rename to plugins/eginer/Properties/test_two_body_dm.irp.f diff --git a/plugins/eginer/README.md b/plugins/eginer/README.md new file mode 100644 index 00000000..6936430a --- /dev/null +++ b/plugins/eginer/README.md @@ -0,0 +1,5 @@ +Please create a new repository on github/gitlab for your plugins. For example, see http://gitlab.com/scemama/qp_plugins and put your QP programs there. + +Some useless files might remain in the directories. Please check and create nice README files. + + diff --git a/plugins/loc_cele/NEEDED_CHILDREN_MODULES b/plugins/eginer/loc_cele/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/loc_cele/NEEDED_CHILDREN_MODULES rename to plugins/eginer/loc_cele/NEEDED_CHILDREN_MODULES diff --git a/plugins/loc_cele/README.rst b/plugins/eginer/loc_cele/README.rst similarity index 100% rename from plugins/loc_cele/README.rst rename to plugins/eginer/loc_cele/README.rst diff --git a/plugins/loc_cele/loc.f b/plugins/eginer/loc_cele/loc.f similarity index 100% rename from plugins/loc_cele/loc.f rename to plugins/eginer/loc_cele/loc.f diff --git a/plugins/loc_cele/loc_cele.irp.f b/plugins/eginer/loc_cele/loc_cele.irp.f similarity index 100% rename from plugins/loc_cele/loc_cele.irp.f rename to plugins/eginer/loc_cele/loc_cele.irp.f diff --git a/plugins/loc_cele/loc_exchange_int.irp.f b/plugins/eginer/loc_cele/loc_exchange_int.irp.f similarity index 100% rename from plugins/loc_cele/loc_exchange_int.irp.f rename to plugins/eginer/loc_cele/loc_exchange_int.irp.f diff --git a/plugins/loc_cele/loc_exchange_int_act.irp.f b/plugins/eginer/loc_cele/loc_exchange_int_act.irp.f similarity index 100% rename from plugins/loc_cele/loc_exchange_int_act.irp.f rename to plugins/eginer/loc_cele/loc_exchange_int_act.irp.f diff --git a/plugins/loc_cele/loc_exchange_int_inact.irp.f b/plugins/eginer/loc_cele/loc_exchange_int_inact.irp.f similarity index 100% rename from plugins/loc_cele/loc_exchange_int_inact.irp.f rename to plugins/eginer/loc_cele/loc_exchange_int_inact.irp.f diff --git a/plugins/loc_cele/loc_exchange_int_virt.irp.f b/plugins/eginer/loc_cele/loc_exchange_int_virt.irp.f similarity index 100% rename from plugins/loc_cele/loc_exchange_int_virt.irp.f rename to plugins/eginer/loc_cele/loc_exchange_int_virt.irp.f diff --git a/plugins/garniron/README.md b/plugins/garniron/README.md new file mode 100644 index 00000000..6936430a --- /dev/null +++ b/plugins/garniron/README.md @@ -0,0 +1,5 @@ +Please create a new repository on github/gitlab for your plugins. For example, see http://gitlab.com/scemama/qp_plugins and put your QP programs there. + +Some useless files might remain in the directories. Please check and create nice README files. + + diff --git a/plugins/mrcepa0/EZFIO.cfg b/plugins/garniron/mrcepa0/EZFIO.cfg similarity index 100% rename from plugins/mrcepa0/EZFIO.cfg rename to plugins/garniron/mrcepa0/EZFIO.cfg diff --git a/plugins/mrcepa0/NEEDED_CHILDREN_MODULES b/plugins/garniron/mrcepa0/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/mrcepa0/NEEDED_CHILDREN_MODULES rename to plugins/garniron/mrcepa0/NEEDED_CHILDREN_MODULES diff --git a/plugins/mrcepa0/README.rst b/plugins/garniron/mrcepa0/README.rst similarity index 100% rename from plugins/mrcepa0/README.rst rename to plugins/garniron/mrcepa0/README.rst diff --git a/plugins/mrcepa0/dress_types.f90 b/plugins/garniron/mrcepa0/dress_types.f90 similarity index 100% rename from plugins/mrcepa0/dress_types.f90 rename to plugins/garniron/mrcepa0/dress_types.f90 diff --git a/plugins/mrcepa0/dressing.irp.f b/plugins/garniron/mrcepa0/dressing.irp.f similarity index 100% rename from plugins/mrcepa0/dressing.irp.f rename to plugins/garniron/mrcepa0/dressing.irp.f diff --git a/plugins/mrcepa0/dressing_slave.irp.f b/plugins/garniron/mrcepa0/dressing_slave.irp.f similarity index 100% rename from plugins/mrcepa0/dressing_slave.irp.f rename to plugins/garniron/mrcepa0/dressing_slave.irp.f diff --git a/plugins/mrcepa0/dressing_vector.irp.f b/plugins/garniron/mrcepa0/dressing_vector.irp.f similarity index 100% rename from plugins/mrcepa0/dressing_vector.irp.f rename to plugins/garniron/mrcepa0/dressing_vector.irp.f diff --git a/plugins/mrcepa0/energy.irp.f b/plugins/garniron/mrcepa0/energy.irp.f similarity index 100% rename from plugins/mrcepa0/energy.irp.f rename to plugins/garniron/mrcepa0/energy.irp.f diff --git a/plugins/garniron/mrcepa0/mrcc_old.irp.f b/plugins/garniron/mrcepa0/mrcc_old.irp.f new file mode 100644 index 00000000..7be35b87 --- /dev/null +++ b/plugins/garniron/mrcepa0/mrcc_old.irp.f @@ -0,0 +1,27 @@ +program mrsc2sub + implicit none + double precision, allocatable :: energy(:) + allocate (energy(N_states)) + + !mrmode : 1=mrcepa0, 2=mrsc2 add, 3=mrcc + mrmode = 3 + + read_wf = .True. + SOFT_TOUCH read_wf + call set_generators_bitmasks_as_holes_and_particles + if (.True.) then + integer :: i,j + do j=1,N_states + do i=1,N_det + psi_coef(i,j) = CI_eigenvectors(i,j) + enddo + enddo + SOFT_TOUCH psi_coef + endif + call run(N_states,energy) + if(do_pt2)then + call run_pt2(N_states,energy) + endif + deallocate(energy) +end + diff --git a/plugins/mrcepa0/mrcc_slave.irp.f b/plugins/garniron/mrcepa0/mrcc_slave.irp.f similarity index 100% rename from plugins/mrcepa0/mrcc_slave.irp.f rename to plugins/garniron/mrcepa0/mrcc_slave.irp.f diff --git a/plugins/mrcepa0/mrcc_stoch_routines.irp.f b/plugins/garniron/mrcepa0/mrcc_stoch_routines.irp.f similarity index 100% rename from plugins/mrcepa0/mrcc_stoch_routines.irp.f rename to plugins/garniron/mrcepa0/mrcc_stoch_routines.irp.f diff --git a/plugins/mrcepa0/mrcc_zmq.irp.f b/plugins/garniron/mrcepa0/mrcc_zmq.irp.f similarity index 100% rename from plugins/mrcepa0/mrcc_zmq.irp.f rename to plugins/garniron/mrcepa0/mrcc_zmq.irp.f diff --git a/plugins/mrcepa0/mrcepa0.irp.f b/plugins/garniron/mrcepa0/mrcepa0.irp.f similarity index 100% rename from plugins/mrcepa0/mrcepa0.irp.f rename to plugins/garniron/mrcepa0/mrcepa0.irp.f diff --git a/plugins/mrcepa0/mrcepa0_general.irp.f b/plugins/garniron/mrcepa0/mrcepa0_general.irp.f similarity index 100% rename from plugins/mrcepa0/mrcepa0_general.irp.f rename to plugins/garniron/mrcepa0/mrcepa0_general.irp.f diff --git a/plugins/mrcepa0/mrsc2.irp.f b/plugins/garniron/mrcepa0/mrsc2.irp.f similarity index 100% rename from plugins/mrcepa0/mrsc2.irp.f rename to plugins/garniron/mrcepa0/mrsc2.irp.f diff --git a/plugins/mrcepa0/run_mrcc_slave.irp.f b/plugins/garniron/mrcepa0/run_mrcc_slave.irp.f similarity index 100% rename from plugins/mrcepa0/run_mrcc_slave.irp.f rename to plugins/garniron/mrcepa0/run_mrcc_slave.irp.f diff --git a/plugins/mrcepa0/save_mrcc_wavefunction.irp.f b/plugins/garniron/mrcepa0/save_mrcc_wavefunction.irp.f similarity index 100% rename from plugins/mrcepa0/save_mrcc_wavefunction.irp.f rename to plugins/garniron/mrcepa0/save_mrcc_wavefunction.irp.f diff --git a/plugins/loc_cele/tree_dependency.png b/plugins/loc_cele/tree_dependency.png deleted file mode 100644 index 9ab804fd..00000000 Binary files a/plugins/loc_cele/tree_dependency.png and /dev/null differ diff --git a/plugins/NOFT/EZFIO.cfg b/plugins/loos/NOFT/EZFIO.cfg similarity index 100% rename from plugins/NOFT/EZFIO.cfg rename to plugins/loos/NOFT/EZFIO.cfg diff --git a/plugins/NOFT/NEEDED_CHILDREN_MODULES b/plugins/loos/NOFT/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/NOFT/NEEDED_CHILDREN_MODULES rename to plugins/loos/NOFT/NEEDED_CHILDREN_MODULES diff --git a/plugins/NOFT/NOFT.irp.f b/plugins/loos/NOFT/NOFT.irp.f similarity index 100% rename from plugins/NOFT/NOFT.irp.f rename to plugins/loos/NOFT/NOFT.irp.f diff --git a/plugins/NOFT/NOFT_JKLfunc.irp.f b/plugins/loos/NOFT/NOFT_JKLfunc.irp.f similarity index 100% rename from plugins/NOFT/NOFT_JKLfunc.irp.f rename to plugins/loos/NOFT/NOFT_JKLfunc.irp.f diff --git a/plugins/NOFT/NOFT_JKfunc.irp.f b/plugins/loos/NOFT/NOFT_JKfunc.irp.f similarity index 100% rename from plugins/NOFT/NOFT_JKfunc.irp.f rename to plugins/loos/NOFT/NOFT_JKfunc.irp.f diff --git a/plugins/NOFT/NOFT_PT2.irp.f b/plugins/loos/NOFT/NOFT_PT2.irp.f similarity index 100% rename from plugins/NOFT/NOFT_PT2.irp.f rename to plugins/loos/NOFT/NOFT_PT2.irp.f diff --git a/plugins/NOFT/NOFT_core.irp.f b/plugins/loos/NOFT/NOFT_core.irp.f similarity index 100% rename from plugins/NOFT/NOFT_core.irp.f rename to plugins/loos/NOFT/NOFT_core.irp.f diff --git a/plugins/NOFT/README.rst b/plugins/loos/NOFT/README.rst similarity index 100% rename from plugins/NOFT/README.rst rename to plugins/loos/NOFT/README.rst diff --git a/plugins/NOFT/ezfio_interface.irp.f b/plugins/loos/NOFT/ezfio_interface.irp.f similarity index 100% rename from plugins/NOFT/ezfio_interface.irp.f rename to plugins/loos/NOFT/ezfio_interface.irp.f diff --git a/plugins/loos/README.md b/plugins/loos/README.md new file mode 100644 index 00000000..6936430a --- /dev/null +++ b/plugins/loos/README.md @@ -0,0 +1,5 @@ +Please create a new repository on github/gitlab for your plugins. For example, see http://gitlab.com/scemama/qp_plugins and put your QP programs there. + +Some useless files might remain in the directories. Please check and create nice README files. + + diff --git a/plugins/mrcc/EZFIO.cfg b/plugins/mrcc/EZFIO.cfg deleted file mode 100644 index a1d5ecb7..00000000 --- a/plugins/mrcc/EZFIO.cfg +++ /dev/null @@ -1,45 +0,0 @@ -[lambda_type] -type: Positive_int -doc: lambda type -interface: ezfio,provider,ocaml -default: 0 - -[energy] -type: double precision -doc: Calculated energy -interface: ezfio - -[energy_pt2] -type: double precision -doc: Calculated energy with PT2 contribution -interface: ezfio - -[perturbative_triples] -type: logical -doc: Compute perturbative contribution of the Triples -interface: ezfio,provider,ocaml -default: true - -[energy] -type: double precision -doc: Calculated energy -interface: ezfio - -[thresh_dressed_ci] -type: Threshold -doc: Threshold on the convergence of the dressed CI energy -interface: ezfio,provider,ocaml -default: 1.e-5 - -[n_it_max_dressed_ci] -type: Strictly_positive_int -doc: Maximum number of dressed CI iterations -interface: ezfio,provider,ocaml -default: 30 - -[dress_relative_error] -type: Normalized_float -doc: Stop stochastic dressing when the relative error is smaller than PT2_relative_error -interface: ezfio,provider,ocaml -default: 0.01 - diff --git a/plugins/mrcc/NEEDED_CHILDREN_MODULES b/plugins/mrcc/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 58522c6a..00000000 --- a/plugins/mrcc/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -dress_zmq DavidsonDressed Selectors_full Perturbation Selectors_full Generators_full Psiref_CAS MRCC_Utils ZMQ diff --git a/plugins/mrcc/README.rst b/plugins/mrcc/README.rst deleted file mode 100644 index edefab0e..00000000 --- a/plugins/mrcc/README.rst +++ /dev/null @@ -1,220 +0,0 @@ -==== -MRCC -==== - -Multi-Reference coupled cluser module: - - -A simple approach to the state-specific MR-CC using the intermediate Hamiltonian formalism -Emmanuel Giner , Grégoire David , Anthony Scemama and Jean Paul Malrieu (2016), in: J. Chem. Phys., 144:6(064101) - -Alternative definition of excitation amplitudes in multi-reference state-specific coupled cluster -Yann Garniron , Emmanuel Giner , Jean Paul Malrieu and Anthony Scemama (2017), in: The Journal of Chemical Physics, 146:15(154107) - -Using this module requires to have a selected CAS-SD wave function. - - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -.. image:: tree_dependency.png - -* `Perturbation `_ -* `Selectors_full `_ -* `Generators_full `_ -* `Psiref_CAS `_ -* `MRCC_Utils `_ -* `ZMQ `_ - -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -`active_sorb `_ - Undocumented - - -`blokmwen `_ - Undocumented - - -`cepa0_shortcut `_ - Undocumented - - -`child_num `_ - Undocumented - - -`delta_cas `_ - Undocumented - - -`delta_ii `_ - Undocumented - - -`delta_ii_mrcc `_ - Undocumented - - -`delta_ii_old `_ - Undocumented - - -`delta_ij `_ - Undocumented - - -`delta_ij_mrcc `_ - Undocumented - - -`delta_ij_old `_ - Undocumented - - -`delta_mrcepa0_ii `_ - Undocumented - - -`delta_mrcepa0_ij `_ - Undocumented - - -`delta_sub_ii `_ - Undocumented - - -`delta_sub_ij `_ - Undocumented - - -`det_cepa0 `_ - Undocumented - - -`det_cepa0_active `_ - Undocumented - - -`det_cepa0_idx `_ - Undocumented - - -`det_ref_active `_ - Undocumented - - -`filter_tq `_ - Undocumented - - -`filter_tq_micro `_ - Undocumented - - -`gethp `_ - Undocumented - - -`h_ `_ - Undocumented - - -`hp `_ - Undocumented - - -`isincassd `_ - Undocumented - - -`lambda_type `_ - lambda type - - -`linked `_ - Undocumented - - -`mrcc_part_dress `_ - Undocumented - - -`mrcepa0 `_ - Undocumented - - -`mrsc2 `_ - Undocumented - - -`mrsc2_dressing_collector `_ - Collects results from the AO integral calculation - - -`mrsc2_dressing_slave `_ - Task for parallel MR-SC2 - - -`mrsc2_dressing_slave_inproc `_ - Task for parallel MR-SC2 - - -`mrsc2_dressing_slave_tcp `_ - Task for parallel MR-SC2 - - -`mrsc2sub `_ - Undocumented - - -`n_it_max_dressed_ci `_ - Maximum number of dressed CI iterations - - -`nlink `_ - Undocumented - - -`print_cas_coefs `_ - Undocumented - - -`pull_mrsc2_results `_ - Push integrals in the push socket - - -`push_mrsc2_results `_ - Push integrals in the push socket - - -`run `_ - Undocumented - - -`run_pt2 `_ - Undocumented - - -`run_pt2_old `_ - Undocumented - - -`searchance `_ - Undocumented - - -`set_det_bit `_ - Undocumented - - -`thresh_dressed_ci `_ - Threshold on the convergence of the dressed CI energy - diff --git a/plugins/mrcc/mrcc.irp.f b/plugins/mrcc/mrcc.irp.f deleted file mode 100644 index cf6a8f0c..00000000 --- a/plugins/mrcc/mrcc.irp.f +++ /dev/null @@ -1,89 +0,0 @@ -program shifted_bk - implicit none - BEGIN_DOC -! TODO - END_DOC - !print *, "neu verzion" - - PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique - PROVIDE psi_bilinear_matrix_rows psi_det_sorted_gen_order psi_bilinear_matrix_order - PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns - PROVIDE psi_bilinear_matrix_transp_order - - read_wf = .True. - SOFT_TOUCH read_wf - call set_generators_bitmasks_as_holes_and_particles - if (.True.) then - integer :: i,j - do j=1,N_states - do i=1,N_det - psi_coef(i,j) = CI_eigenvectors(i,j) - enddo - enddo - TOUCH psi_coef - endif - - call dress_zmq() - if (.true.) then - call ezfio_set_mrcc_energy(ci_energy_dressed(1)) - endif - if (do_pt2) then - call run_pt2(N_states, ci_energy_dressed) - endif -end - - -subroutine run_pt2(N_st,energy) - implicit none - integer :: i,j,k - integer, intent(in) :: N_st - double precision, intent(in) :: energy(N_st) - double precision :: pt2(N_st) - double precision :: norm_pert(N_st),H_pert_diag(N_st) - - pt2 = 0d0 - !if(lambda_mrcc_pt2(0) == 0) return - - print*,'Last iteration only to compute the PT2' - - N_det_generators = N_det_cas - N_det_selectors = N_det_non_ref - - do i=1,N_det_generators - do k=1,N_int - psi_det_generators(k,1,i) = psi_ref(k,1,i) - psi_det_generators(k,2,i) = psi_ref(k,2,i) - enddo - do k=1,N_st - psi_coef_generators(i,k) = psi_ref_coef(i,k) - enddo - enddo - do i=1,N_det - do k=1,N_int - psi_selectors(k,1,i) = psi_det_sorted(k,1,i) - psi_selectors(k,2,i) = psi_det_sorted(k,2,i) - enddo - do k=1,N_st - psi_selectors_coef(i,k) = psi_coef_sorted(i,k) - enddo - enddo - - SOFT_TOUCH N_det_selectors psi_selectors_coef psi_selectors N_det_generators psi_det_generators psi_coef_generators ci_eigenvectors_dressed ci_eigenvectors_s2_dressed ci_electronic_energy_dressed - SOFT_TOUCH psi_ref_coef_diagonalized psi_ref_energy_diagonalized - - call H_apply_mrcepa_PT2(pt2, norm_pert, H_pert_diag, N_st) - -! call ezfio_set_full_ci_energy_pt2(energy+pt2) - - print *, 'Final step' - print *, 'N_det = ', N_det - print *, 'N_states = ', N_states - print *, 'PT2 = ', pt2 - print *, 'E = ', energy - print *, 'E+PT2 = ', energy+pt2 - print *, '-----' - - call ezfio_set_mrcc_energy_pt2(energy(1)+pt2(1)) - -end - diff --git a/plugins/mrcc/mrcc_routines.irp.f b/plugins/mrcc/mrcc_routines.irp.f deleted file mode 100644 index cd605405..00000000 --- a/plugins/mrcc/mrcc_routines.irp.f +++ /dev/null @@ -1,447 +0,0 @@ -use bitmasks - -subroutine generator_start(i_gen, iproc, interesting) - implicit none - integer, intent(in) :: i_gen, iproc - logical, intent(inout) :: interesting - integer :: i - logical, external :: deteq - PROVIDE dij - interesting = .true. -! do i=1,N_det_ref -! if(deteq(psi_det_generators(1,1,i_gen), psi_ref(1,1,i), N_int)) then -! interesting = .false. -! exit -! end if -! end do -end subroutine - - BEGIN_PROVIDER [ double precision, hij_cache_, (N_det,Nproc) ] -&BEGIN_PROVIDER [ double precision, sij_cache_, (N_det,Nproc) ] -&BEGIN_PROVIDER [ double precision, dIa_hla_, (N_states,N_det,Nproc) ] -&BEGIN_PROVIDER [ double precision, dIa_sla_, (N_states,N_det,Nproc) ] -&BEGIN_PROVIDER [ integer(bit_kind), sorted_mini, (N_int,2,N_det,Nproc) ] -&BEGIN_PROVIDER [ integer, excs_ , (0:2,2,2,N_det,Nproc) ] -&BEGIN_PROVIDER [ integer, idx_buf , (N_det, Nproc) ] -&BEGIN_PROVIDER [ double precision, phases_, (N_det, Nproc) ] -BEGIN_DOC - ! temporay arrays for dress_with_alpha_buffer. Avoids reallocation. -END_DOC -END_PROVIDER - - - BEGIN_PROVIDER [ integer(bit_kind), psi_ref_detsorted, (N_int,2,N_det_ref) ] -&BEGIN_PROVIDER [ integer, psi_ref_detsorted_idx, (N_det_ref) ] - implicit none - - psi_ref_detsorted = psi_ref(:,:,:N_det_ref) - call sort_det(psi_ref_detsorted, psi_ref_detsorted_idx, N_det_ref, n_int) - -END_PROVIDER - - -subroutine dress_with_alpha_buffer(Nstates, Ndet,Nint,delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc) - use bitmasks - implicit none - BEGIN_DOC - !delta_ij_loc(:,:,1) : dressing column for H - !delta_ij_loc(:,:,2) : dressing column for S2 - !i_gen : generator index in psi_det_generators - !minilist : indices of determinants connected to alpha ( in psi_det ) - !n_minilist : size of minilist - !alpha : alpha determinant - END_DOC - integer, intent(in) :: Nint, Ndet, Nstates, n_minilist, iproc, i_gen - integer(bit_kind), intent(in) :: alpha(Nint,2), det_minilist(Nint, 2, n_minilist) - integer,intent(in) :: minilist(n_minilist) - integer(bit_kind) :: dettmp(Nint,2), tmp - double precision, intent(inout) :: delta_ij_loc(Nstates,N_det,2) - double precision :: hij, sij - double precision, external :: diag_H_mat_elem_fock - double precision :: c_alpha(N_states) - double precision :: hdress, sdress - integer :: i, l_sd, j, k, i_I, s, ni - logical :: ok - double precision :: phase, phase2 - integer :: degree, exc(0:2,2,2) - integer(8), save :: diamond = 0 - -! call dress_with_alpha_buffer_old(Nstates, Ndet,Nint,delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc) -! return - - - if(n_minilist == 1) return - !check if not linked to reference - do i=1,n_minilist - if(idx_non_ref_rev(minilist(i)) == 0) then - return - end if - end do - - sorted_mini(:,:,:n_minilist,iproc) = det_minilist(:,:,:) - call sort_det(sorted_mini(1,1,1,iproc), idx_buf(1,iproc), n_minilist, nint) - - c_alpha = 0d0 - - do i=1,n_minilist - !call get_excitation_degree(alpha, psi_ref(1,1,i_I), degree, nint) - !if(degree > 4) cycle - do s=1,2 - do ni=1,nint - dettmp(ni,s) = alpha(ni,s)-sorted_mini(ni,s,i,iproc) - end do - end do - i_I=1 - j=i+1 - - diamondloop : do while(i_I <= N_det_ref .and. j <= n_minilist) - - do s=1,2 - do ni=nint,1,-1 - if(sorted_mini(ni,s,j,iproc) - psi_ref_detsorted(ni,s,i_I) > dettmp(ni,s)) then - i_I += 1 - cycle diamondloop - else if(sorted_mini(ni,s,j,iproc) - psi_ref_detsorted(ni,s,i_I) < dettmp(ni,s)) then - j += 1 - cycle diamondloop - end if - end do - end do - - !check potential diamond found - - do s=1,2 - do ni=1,nint - tmp = ieor(sorted_mini(ni,s,i,iproc), sorted_mini(ni,s,j,iproc)) - tmp = ieor(tmp, psi_ref_detsorted(ni,s,i_I)) - tmp = ieor(tmp, alpha(ni,s)) - if(tmp /= 0_8) then - !print *, "fake diamond spotted" - !i_I += 1 - j += 1 - cycle diamondloop - end if - end do - end do - !diamond += 1 - !if(mod(diamond,100000) == 1) print *, "diam", diamond - !diamond found - if(det_minilist(1,1,idx_buf(j,iproc)) /= sorted_mini(1,1,j,iproc)) stop "STOOPE" - call get_excitation(psi_ref_detsorted(1,1,i_I),det_minilist(1,1,idx_buf(j,iproc)),exc,degree,phase,Nint) - call get_excitation(alpha,det_minilist(1,1,idx_buf(i,iproc)),exc,degree,phase2,Nint) - - do s=1,Nstates - c_alpha(s) += psi_ref_coef(psi_ref_detsorted_idx(i_I), s) * dij(psi_ref_detsorted_idx(i_I), idx_non_ref_rev(minilist(idx_buf(i,iproc))), s) & - * dij(psi_ref_detsorted_idx(i_I), idx_non_ref_rev(minilist(idx_buf(j,iproc))), s) * phase * phase2 - end do - !i_I += 1 - j += 1 - end do diamondloop - end do - - if(maxval(c_alpha) == 0d0 .and. minval(c_alpha) == 0d0) return - - do i=1,n_minilist - call i_h_j_s2(alpha,det_minilist(1,1,i),N_int,hij, sij) - do s=1,Nstates - hdress = c_alpha(s) * hij - sdress = c_alpha(s) * sij - delta_ij_loc(s, minilist(i), 1) += hdress - delta_ij_loc(s, minilist(i), 2) += sdress - end do - end do -end subroutine - - - -subroutine dress_with_alpha_buffer_neu(Nstates,Ndet,Nint,delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc) - use bitmasks - implicit none - BEGIN_DOC - !delta_ij_loc(:,:,1) : dressing column for H - !delta_ij_loc(:,:,2) : dressing column for S2 - !i_gen : generator index in psi_det_generators - !minilist : indices of determinants connected to alpha ( in psi_det ) - !n_minilist : size of minilist - !alpha : alpha determinant - END_DOC - integer, intent(in) :: Nint, Ndet, Nstates, n_minilist, iproc, i_gen - integer(bit_kind), intent(in) :: alpha(Nint,2), det_minilist(Nint, 2, n_minilist) - integer,intent(in) :: minilist(n_minilist) - integer(bit_kind) :: dettmp(Nint,2) - double precision, intent(inout) :: delta_ij_loc(Nstates,N_det,2) - double precision :: hij, sij - double precision, external :: diag_H_mat_elem_fock - double precision :: c_alpha(N_states) - double precision :: hdress, sdress - integer :: i, l_sd, j, k, i_I, s, ni - logical :: ok - double precision :: phase, phase2 - integer :: degree, exc(0:2,2,2) - integer(8), save :: diamond = 0 - if(n_minilist == 1) return - !check if not linked to reference - do i=1,n_minilist - if(idx_non_ref_rev(minilist(i)) == 0) then - return - end if - end do - - c_alpha = 0d0 - - do i_I=1,N_det_ref - call get_excitation_degree(alpha, psi_ref(1,1,i_I), degree, nint) - if(degree > 4) cycle - - do i=1,n_minilist - diamondloop : do j=i+1,n_minilist - do s=1,2 - do ni=1,nint - dettmp(ni,s) = ieor(det_minilist(ni,s,i), det_minilist(ni,s,j)) - dettmp(ni,s) = ieor(dettmp(ni,s), psi_ref(ni,s,i_I)) - dettmp(ni,s) = ieor(dettmp(ni,s), alpha(ni,s)) - if(dettmp(ni,s) /= 0_8) cycle diamondloop - end do - end do - !diamond found - diamond += 1 -! if(mod(diamond,10000) == 1) print *, "diam", diamond - - call get_excitation(psi_ref(1,1,i_I),det_minilist(1,1,j),exc,degree,phase,Nint) - call get_excitation(alpha,det_minilist(1,1,i),exc,degree,phase2,Nint) - - do s=1,Nstates - c_alpha(s) += psi_ref_coef(i_I, s) * dij(i_I, idx_non_ref_rev(minilist(i)), s) & - * dij(i_I, idx_non_ref_rev(minilist(j)), s) * phase * phase2 - end do - end do diamondloop - end do - end do - - if(maxval(c_alpha) == 0d0 .and. minval(c_alpha) == 0d0) return - - do i=1,n_minilist - call i_h_j_s2(alpha,det_minilist(1,1,i),N_int,hij, sij) - do s=1,Nstates - hdress = c_alpha(s) * hij - sdress = c_alpha(s) * sij - delta_ij_loc(s, minilist(i), 1) += hdress - delta_ij_loc(s, minilist(i), 2) += sdress - end do - end do -end subroutine - - - -subroutine dress_with_alpha_buffer_old(Nstates,Ndet,Nint,delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc) - use bitmasks - implicit none - BEGIN_DOC - !delta_ij_loc(:,:,1) : dressing column for H - !delta_ij_loc(:,:,2) : dressing column for S2 - !minilist : indices of determinants connected to alpha ( in psi_det_sorted ) - !n_minilist : size of minilist - !alpha : alpha determinant - END_DOC - integer(bit_kind), intent(in) :: alpha(Nint,2), det_minilist(Nint, 2, n_minilist) - integer,intent(in) :: minilist(n_minilist), n_minilist, iproc, i_gen, Nstates, Ndet, Nint - double precision, intent(inout) :: delta_ij_loc(Nstates,Ndet,2) - - - integer :: i,j,k,l,m - integer :: degree1, degree2, degree - - double precision :: hIk, hla, hIl, sla, dIk(Nstates), dka(Nstates), dIa(Nstates), hka - double precision :: phase, phase2 - integer :: exc(0:2,2,2) - integer :: h1,h2,p1,p2,s1,s2 - integer(bit_kind) :: tmp_det(Nint,2), ctrl - integer :: i_state, k_sd, l_sd, m_sd, ll_sd, i_I - double precision :: Delta_E_inv(Nstates) - double precision :: sdress, hdress - logical :: ok, ok2 - integer :: canbediamond - - PROVIDE mo_class dij N_int N_states elec_num n_act_orb - - if(n_minilist == 1) return - - do i=1,n_minilist - if(idx_non_ref_rev(minilist(i)) == 0) return - end do - - if (perturbative_triples) then - PROVIDE one_anhil fock_virt_total fock_core_inactive_total one_creat - endif - - canbediamond = 0 - do l_sd=1,n_minilist - call get_excitation(det_minilist(1,1,l_sd),alpha,exc,degree1,phase,Nint) - call decode_exc(exc,degree1,h1,p1,h2,p2,s1,s2) - - ok = (mo_class(h1)(1:1) == 'A' .or. mo_class(h1)(1:1) == 'I') .and. & - (mo_class(p1)(1:1) == 'A' .or. mo_class(p1)(1:1) == 'V') - if(ok .and. degree1 == 2) then - ok = (mo_class(h2)(1:1) == 'A' .or. mo_class(h2)(1:1) == 'I') .and. & - (mo_class(p2)(1:1) == 'A' .or. mo_class(p2)(1:1) == 'V') - end if - - if(ok) then - canbediamond += 1 - excs_(:,:,:,l_sd,iproc) = exc(:,:,:) - phases_(l_sd, iproc) = phase - else - phases_(l_sd, iproc) = 0d0 - end if - call i_h_j_s2(alpha,det_minilist(1,1,l_sd),Nint,hij_cache_(l_sd,iproc), sij_cache_(l_sd,iproc)) - enddo - if(canbediamond <= 1) return - - do i_I=1,N_det_ref - call get_excitation_degree(alpha,psi_ref(1,1,i_I),degree1,Nint) - if (degree1 > 4) then - cycle - endif - - do i_state=1,Nstates - dIa(i_state) = 0.d0 - enddo - - do k_sd=1,n_minilist - if(phases_(k_sd,iproc) == 0d0) cycle - call get_excitation_degree(psi_ref(1,1,i_I),det_minilist(1,1,k_sd),degree,Nint) - if (degree > 2) then - cycle - endif - - phase = phases_(k_sd, iproc) - exc(:,:,:) = excs_(:,:,:,k_sd,iproc) - degree2 = exc(0,1,1) + exc(0,1,2) - call apply_excitation(psi_ref(1,1,i_I), exc, tmp_det, ok, Nint) - if((.not. ok) .and. (.not. perturbative_triples)) cycle - - do i_state=1,Nstates - dka(i_state) = 0.d0 - enddo - - ok2 = .false. - !do i_state=1,Nstates - ! !if(dka(i_state) == 0) cycle - ! dIk(i_state) = dij(i_I, idx_non_ref_rev(minilist(k_sd)), i_state) - ! if(dIk(i_state) /= 0d0) then - ! ok2 = .true. - ! endif - !enddo - !if(.not. ok2) cycle - - if (ok) then - phase2 = 0d0 - do l_sd=k_sd+1,n_minilist - if(phases_(l_sd, iproc) == 0d0) cycle - call get_excitation_degree(tmp_det,det_minilist(1,1,l_sd),degree,Nint) - if (degree == 0) then - do i_state=1,Nstates - dIk(i_state) = dij(i_I, idx_non_ref_rev(minilist(k_sd)), i_state) - if(dIk(i_state) /= 0d0) then - if(phase2 == 0d0) call get_excitation(psi_ref(1,1,i_I),det_minilist(1,1,l_sd),exc,degree,phase2,Nint) - dka(i_state) = dij(i_I, idx_non_ref_rev(minilist(l_sd)), i_state) * phase * phase2 - end if - end do - - exit - - endif - enddo - else if (perturbative_triples) then - hka = hij_cache_(k_sd,iproc) - if (dabs(hka) > 1.d-12) then - call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),alpha,Delta_E_inv) - - do i_state=1,Nstates - ASSERT (Delta_E_inv(i_state) < 0.d0) - dka(i_state) = hka / Delta_E_inv(i_state) - enddo - endif - endif - - - if (perturbative_triples.and. (degree2 == 1) ) then - if (ok) then - call i_h_j(psi_ref(1,1,i_I),tmp_det,Nint,hka) - else - hka = 0.d0 - endif - hka = hij_cache_(k_sd,iproc) - hka - if (dabs(hka) > 1.d-12) then - call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),alpha,Delta_E_inv) - do i_state=1,Nstates - ASSERT (Delta_E_inv(i_state) < 0.d0) - dka(i_state) = hka / Delta_E_inv(i_state) - enddo - endif - endif - do i_state=1,Nstates - dIa(i_state) = dIa(i_state) + dIk(i_state) * dka(i_state) - enddo - enddo - - ok2 = .false. - do i_state=1,Nstates - if(dIa(i_state) /= 0d0) ok2 = .true. - enddo - if(.not. ok2) cycle - - do l_sd=1,n_minilist - k_sd = minilist(l_sd) - hla = hij_cache_(l_sd,iproc) - sla = sij_cache_(l_sd,iproc) - do i_state=1,Nstates - hdress = dIa(i_state) * hla * psi_ref_coef(i_I,i_state) - sdress = dIa(i_state) * sla * psi_ref_coef(i_I,i_state) - !!!$OMP ATOMIC - delta_ij_loc(i_state,k_sd,1) += hdress - !!!$OMP ATOMIC - delta_ij_loc(i_state,k_sd,2) += sdress - enddo - enddo - enddo -end subroutine - - - - - -!! TESTS MINILIST -subroutine test_minilist(minilist, n_minilist, alpha) - use bitmasks - implicit none - integer, intent(in) :: n_minilist - integer(bit_kind),intent(in) :: alpha(N_int, 2) - integer, intent(in) :: minilist(n_minilist) - integer :: a, i, deg - integer :: refc(N_det), testc(N_det) - - refc = 0 - testc = 0 - do i=1,N_det - call get_excitation_degree(psi_det(1,1,i), alpha, deg, N_int) - if(deg <= 2) refc(i) = refc(i) + 1 - end do - do i=1,n_minilist - call get_excitation_degree(psi_det(1,1,minilist(i)), alpha, deg, N_int) - if(deg <= 2) then - testc(minilist(i)) += 1 - else - stop "NON LINKED IN MINILIST" - end if - end do - - do i=1,N_det - if(refc(i) /= testc(i)) then - print *, "MINILIST FAIL ", sum(refc), sum(testc), n_minilist - exit - end if - end do -end subroutine - - diff --git a/plugins/mrcc/mrcc_slave.irp.f b/plugins/mrcc/mrcc_slave.irp.f deleted file mode 100644 index 5e559402..00000000 --- a/plugins/mrcc/mrcc_slave.irp.f +++ /dev/null @@ -1,170 +0,0 @@ -program shifted_bk_slave - implicit none - BEGIN_DOC -! Helper program to compute the dress in distributed mode. - END_DOC - - read_wf = .False. - distributed_davidson = .False. - SOFT_TOUCH read_wf distributed_davidson - call provide_all - call switch_qp_run_to_master - call run_w -end - -subroutine provide_all - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context N_states_diag - PROVIDE dress_e0_denominator mo_tot_num N_int ci_energy mpi_master zmq_state zmq_context - PROVIDE psi_det psi_coef threshold_generators threshold_selectors state_average_weight - PROVIDE N_det_selectors dress_stoch_istate N_det -end - -subroutine run_w - use f77_zmq - - implicit none - IRP_IF MPI - include 'mpif.h' - IRP_ENDIF - - integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket - integer(ZMQ_PTR) :: zmq_to_qp_run_socket - double precision :: energy(N_states) - character*(64) :: states(3) - character*(64) :: old_state - integer :: rc, i, ierr - double precision :: t0, t1 - - integer, external :: zmq_get_dvector, zmq_get_N_det_generators - integer, external :: zmq_get_ivector - integer, external :: zmq_get_psi, zmq_get_N_det_selectors, zmq_get_int - integer, external :: zmq_get_N_states_diag - - zmq_context = f77_zmq_ctx_new () - states(1) = 'selection' - states(2) = 'davidson' - states(3) = 'dress' - old_state = 'Waiting' - - zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() - - PROVIDE psi_det psi_coef threshold_generators threshold_selectors state_average_weight mpi_master - PROVIDE zmq_state N_det_selectors dress_stoch_istate N_det dress_e0_denominator - PROVIDE N_det_generators N_states N_states_diag - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - IRP_ENDIF - do - - if (mpi_master) then - call wait_for_states(states,zmq_state,size(states)) - if (zmq_state(1:64) == old_state(1:64)) then - call sleep(1) - cycle - else - old_state(1:64) = zmq_state(1:64) - endif - print *, trim(zmq_state) - endif - - IRP_IF MPI_DEBUG - print *, irp_here, mpi_rank - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - IRP_ENDIF - IRP_IF MPI - call MPI_BCAST (zmq_state, 128, MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in broadcast of zmq_state' - endif - IRP_ENDIF - - if(zmq_state(1:7) == 'Stopped') then - exit - endif - - - if (zmq_state(1:8) == 'davidson') then - - ! Davidson - ! -------- - - call wall_time(t0) - if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle - if (zmq_get_N_states_diag(zmq_to_qp_run_socket,1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states_diag) == -1) cycle - - call wall_time(t1) - if (mpi_master) then - call write_double(6,(t1-t0),'Broadcast time') - endif - - call omp_set_nested(.True.) - call davidson_slave_tcp(0) - call omp_set_nested(.False.) - print *, 'Davidson done' - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in barrier' - endif - IRP_ENDIF - print *, 'All Davidson done' - - else if (zmq_state(1:5) == 'dress') then - - ! Dress - ! --- - - call wall_time(t0) - if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle - - if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle - - if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle - - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_generators',threshold_generators,1) == -1) cycle - - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_selectors',threshold_selectors,1) == -1) cycle - - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle - - if (zmq_get_int(zmq_to_qp_run_socket,1,'dress_stoch_istate',dress_stoch_istate) == -1) cycle - - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'state_average_weight',state_average_weight,N_states) == -1) cycle - - psi_energy(1:N_states) = energy(1:N_states) - TOUCH psi_energy state_average_weight dress_stoch_istate threshold_selectors threshold_generators - if (mpi_master) then - print *, 'N_det', N_det - print *, 'N_det_generators', N_det_generators - print *, 'N_det_selectors', N_det_selectors - print *, 'psi_energy', psi_energy - print *, 'dress_stoch_istate', dress_stoch_istate - print *, 'state_average_weight', state_average_weight - endif - - call wall_time(t1) - call write_double(6,(t1-t0),'Broadcast time') - - call dress_slave_tcp(0, energy) - - - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in barrier' - endif - IRP_ENDIF - print *, 'All dress done' - - endif - - end do - IRP_IF MPI - call MPI_finalize(ierr) - IRP_ENDIF -end - - - - diff --git a/plugins/mrcepa0/tree_dependency.png b/plugins/mrcepa0/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/read_integral/tree_dependency.png b/plugins/read_integral/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/shiftedbk/EZFIO.cfg b/plugins/shiftedbk/EZFIO.cfg deleted file mode 100644 index 77e97cf7..00000000 --- a/plugins/shiftedbk/EZFIO.cfg +++ /dev/null @@ -1,34 +0,0 @@ -[energy] -type: double precision -doc: Calculated energy -interface: ezfio - -[energy_pt2] -type: double precision -doc: Calculated energy with pt2 contribution -interface: ezfio - -[thresh_dressed_ci] -type: Threshold -doc: Threshold on the convergence of the dressed CI energy -interface: ezfio,provider,ocaml -default: 1.e-5 - -[n_it_max_dressed_ci] -type: Strictly_positive_int -doc: Maximum number of dressed CI iterations -interface: ezfio,provider,ocaml -default: 30 - -[h0_type] -type: Perturbation -doc: Type of zeroth-order Hamiltonian [ EN | Barycentric ] -interface: ezfio,provider,ocaml -default: EN - -[dress_relative_error] -type: Normalized_float -doc: Stop stochastic dressing when the relative error is smaller than PT2_relative_error -interface: ezfio,provider,ocaml -default: 0.01 - diff --git a/plugins/shiftedbk/NEEDED_CHILDREN_MODULES b/plugins/shiftedbk/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 4f09bfc8..00000000 --- a/plugins/shiftedbk/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -dress_zmq DavidsonDressed Selectors_full Generators_full diff --git a/plugins/shiftedbk/README.rst b/plugins/shiftedbk/README.rst deleted file mode 100644 index d2fa5135..00000000 --- a/plugins/shiftedbk/README.rst +++ /dev/null @@ -1,12 +0,0 @@ -========= -shiftedbk -========= - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. diff --git a/plugins/shiftedbk/shifted_bk.irp.f b/plugins/shiftedbk/shifted_bk.irp.f deleted file mode 100644 index b6d0eab3..00000000 --- a/plugins/shiftedbk/shifted_bk.irp.f +++ /dev/null @@ -1,17 +0,0 @@ -program shifted_bk - implicit none - BEGIN_DOC -! TODO - END_DOC - - PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique - PROVIDE psi_bilinear_matrix_rows psi_det_sorted_gen_order psi_bilinear_matrix_order - PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns - PROVIDE psi_bilinear_matrix_transp_order - PROVIDE psi_energy - - - !call diagonalize_CI() - call dress_zmq() -end - diff --git a/plugins/shiftedbk/shifted_bk_routines.irp.f b/plugins/shiftedbk/shifted_bk_routines.irp.f deleted file mode 100644 index 7271a76e..00000000 --- a/plugins/shiftedbk/shifted_bk_routines.irp.f +++ /dev/null @@ -1,88 +0,0 @@ - BEGIN_PROVIDER [ double precision, fock_diag_tmp_, (2,mo_tot_num+1,Nproc) ] -&BEGIN_PROVIDER [ double precision, a_h_i, (N_det, Nproc) ] -&BEGIN_PROVIDER [ double precision, a_s2_i, (N_det, Nproc) ] - implicit none - integer :: i - - fock_diag_tmp_(:,:,:) = 0.d0 - a_h_i = 0d0 - a_s2_i = 0d0 -END_PROVIDER - - -subroutine generator_start(i_gen, iproc, interesting) - implicit none - integer, intent(in) :: i_gen, iproc - logical, intent(inout) :: interesting - integer :: i - interesting = .true. - call build_fock_tmp(fock_diag_tmp_(1,1,iproc),psi_det_generators(1,1,i_gen),N_int) -end subroutine - - -subroutine dress_with_alpha_buffer(Nstates,Ndet,Nint,delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc) - use bitmasks - implicit none - BEGIN_DOC - !delta_ij_loc(:,:,1) : dressing column for H - !delta_ij_loc(:,:,2) : dressing column for S2 - !i_gen : generator index in psi_det_generators - !minilist : indices of determinants connected to alpha ( in psi_det ) - !n_minilist : size of minilist - !alpha : alpha determinant - END_DOC - integer, intent(in) :: Nint, Ndet, Nstates, n_minilist, iproc, i_gen - integer(bit_kind), intent(in) :: alpha(Nint,2), det_minilist(Nint, 2, n_minilist) - integer,intent(in) :: minilist(n_minilist) - double precision, intent(inout) :: delta_ij_loc(Nstates,N_det,2) - double precision :: hij, sij - double precision, external :: diag_H_mat_elem_fock - double precision :: haa, contrib, c_alpha(N_states) - double precision :: de, a_h_psi(N_states) - double precision :: hdress, sdress - integer :: i, l_sd - - - haa = diag_H_mat_elem_fock(psi_det_generators(1,1,i_gen),alpha,fock_diag_tmp_(1,1,iproc),N_int) - - a_h_psi = 0d0 - - - do l_sd=1,n_minilist - call i_h_j_s2(alpha,det_minilist(1,1,l_sd),N_int,hij, sij) - a_h_i(l_sd, iproc) = hij - a_s2_i(l_sd, iproc) = sij - do i=1,Nstates - a_h_psi(i) += hij * psi_coef(minilist(l_sd), i) - end do - end do - - contrib = 0d0 - - do i=1,Nstates - de = dress_E0_denominator(i) - haa - if(DABS(de) < 1D-5) cycle - - c_alpha(i) = a_h_psi(i) / de - contrib = min(contrib, c_alpha(i) * a_h_psi(i)) - - do l_sd=1,n_minilist - hdress = c_alpha(i) * a_h_i(l_sd, iproc) - sdress = c_alpha(i) * a_s2_i(l_sd, iproc) - delta_ij_loc(i, minilist(l_sd), 1) += hdress - delta_ij_loc(i, minilist(l_sd), 2) += sdress - end do - end do - -end subroutine - - -BEGIN_PROVIDER [ logical, initialize_E0_denominator ] - implicit none - BEGIN_DOC - ! If true, initialize pt2_E0_denominator - END_DOC - initialize_E0_denominator = .True. -END_PROVIDER - - diff --git a/plugins/shiftedbk/shifted_bk_slave.irp.f b/plugins/shiftedbk/shifted_bk_slave.irp.f deleted file mode 100644 index c012e279..00000000 --- a/plugins/shiftedbk/shifted_bk_slave.irp.f +++ /dev/null @@ -1,178 +0,0 @@ -program shifted_bk_slave - implicit none - BEGIN_DOC -! Helper program to compute the dress in distributed mode. - END_DOC - - read_wf = .False. - distributed_davidson = .False. - SOFT_TOUCH read_wf distributed_davidson - call provide_all - call switch_qp_run_to_master - call run_w -end - -subroutine provide_all - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context N_states_diag - PROVIDE dress_e0_denominator mo_tot_num N_int ci_energy mpi_master zmq_state zmq_context - PROVIDE psi_det psi_coef threshold_generators threshold_selectors state_average_weight - PROVIDE N_det_selectors dress_stoch_istate N_det -end - -subroutine run_w - use f77_zmq - - implicit none - IRP_IF MPI - include 'mpif.h' - IRP_ENDIF - - integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket - integer(ZMQ_PTR) :: zmq_to_qp_run_socket - double precision :: energy(N_states) - character*(64) :: states(3) - character*(64) :: old_state - integer :: rc, i, ierr - double precision :: t0, t1 - - integer, external :: zmq_get_dvector, zmq_get_N_det_generators - integer, external :: zmq_get_ivector - integer, external :: zmq_get_psi, zmq_get_N_det_selectors, zmq_get_int - integer, external :: zmq_get_N_states_diag - - zmq_context = f77_zmq_ctx_new () - states(1) = 'selection' - states(2) = 'davidson' - states(3) = 'dress' - old_state = 'Waiting' - - zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() - - PROVIDE psi_det psi_coef threshold_generators threshold_selectors state_average_weight mpi_master - PROVIDE zmq_state N_det_selectors dress_stoch_istate N_det dress_e0_denominator - PROVIDE N_det_generators N_states N_states_diag psi_energy - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - IRP_ENDIF - do - - if (mpi_master) then - call wait_for_states(states,zmq_state,size(states)) - if (zmq_state(1:64) == old_state(1:64)) then - call sleep(1) - cycle - else - old_state(1:64) = zmq_state(1:64) - endif - print *, trim(zmq_state) - endif - - IRP_IF MPI_DEBUG - print *, irp_here, mpi_rank - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - IRP_ENDIF - IRP_IF MPI - call MPI_BCAST (zmq_state, 128, MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in broadcast of zmq_state' - endif - IRP_ENDIF - - if(zmq_state(1:7) == 'Stopped') then - exit - endif - - - if (zmq_state(1:8) == 'davidson') then - - ! Davidson - ! -------- - - call wall_time(t0) - if (zmq_get_N_states_diag(zmq_to_qp_run_socket,1) == -1) cycle - if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states_diag) == -1) cycle - - call wall_time(t1) - if (mpi_master) then - call write_double(6,(t1-t0),'Broadcast time') - endif - - call omp_set_nested(.True.) - call davidson_slave_tcp(0) - call omp_set_nested(.False.) - print *, 'Davidson done' - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in barrier' - endif - IRP_ENDIF - print *, 'All Davidson done' - - else if (zmq_state(1:5) == 'dress') then - - ! Dress - ! --- - - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in barrier' - endif - IRP_ENDIF - call wall_time(t0) - if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle - if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle - if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_generators',threshold_generators,1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_selectors',threshold_selectors,1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle - if (zmq_get_int(zmq_to_qp_run_socket,1,'dress_stoch_istate',dress_stoch_istate) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'state_average_weight',state_average_weight,N_states) == -1) cycle - psi_energy(1:N_states) = energy(1:N_states) - TOUCH psi_energy state_average_weight dress_stoch_istate threshold_selectors threshold_generators - if (mpi_master) then - print *, 'N_det', N_det - print *, 'N_det_generators', N_det_generators - print *, 'N_det_selectors', N_det_selectors - print *, 'psi_energy', psi_energy - print *, 'dress_stoch_istate', dress_stoch_istate - print *, 'state_average_weight', state_average_weight - endif - - call wall_time(t1) - call write_double(6,(t1-t0),'Broadcast time') - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in barrier' - endif - IRP_ENDIF - - if (.true.) then - call omp_set_nested(.True.) - call run_dress_slave(0,i,dress_e0_denominator) - endif - print *, 'PT2 done' - FREE state_average_weight - - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in barrier' - endif - IRP_ENDIF - print *, 'All dress done' - - endif - - end do - IRP_IF MPI - call MPI_finalize(ierr) - IRP_ENDIF -end - - - - diff --git a/plugins/QMC/EZFIO.cfg b/plugins/tapplencourt/QMCPack/EZFIO.cfg similarity index 100% rename from plugins/QMC/EZFIO.cfg rename to plugins/tapplencourt/QMCPack/EZFIO.cfg diff --git a/plugins/QMC/NEEDED_CHILDREN_MODULES b/plugins/tapplencourt/QMCPack/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/QMC/NEEDED_CHILDREN_MODULES rename to plugins/tapplencourt/QMCPack/NEEDED_CHILDREN_MODULES diff --git a/plugins/QMC/README.rst b/plugins/tapplencourt/QMCPack/README.rst similarity index 100% rename from plugins/QMC/README.rst rename to plugins/tapplencourt/QMCPack/README.rst diff --git a/plugins/QMC/pot_ao_pseudo_ints.irp.f b/plugins/tapplencourt/QMCPack/pot_ao_pseudo_ints.irp.f similarity index 100% rename from plugins/QMC/pot_ao_pseudo_ints.irp.f rename to plugins/tapplencourt/QMCPack/pot_ao_pseudo_ints.irp.f diff --git a/plugins/tapplencourt/QMCPack/print_h0j.irp.f b/plugins/tapplencourt/QMCPack/print_h0j.irp.f new file mode 100644 index 00000000..603896b4 --- /dev/null +++ b/plugins/tapplencourt/QMCPack/print_h0j.irp.f @@ -0,0 +1,30 @@ +program print_h0j + use bitmasks + implicit none + BEGIN_DOC +! Print 1st line of H matrix + END_DOC + integer :: i,j,k + integer(bit_kind) :: det2(N_int,2) + double precision :: hij, E + + print *, '< 0 | H | j >' + print *, '=============' + print *, '' + + E = 0.d0 + do k=1,N_det + i = psi_bilinear_matrix_rows(k) + j = psi_bilinear_matrix_columns(k) + det2(:,1) = psi_det_alpha_unique(:,i) + det2(:,2) = psi_det_beta_unique(:,j) + + call i_h_j(psi_det(1,1,1), det2(1,1), N_int,hij) + print *, k, psi_bilinear_matrix_values(k,1), hij + E += psi_bilinear_matrix_values(k,1)*hij + end do + E = E/psi_bilinear_matrix_values(1,1) + print *, 'nuclear_repulsion = ', nuclear_repulsion + print *, 'E = ', E + nuclear_repulsion +end program + diff --git a/plugins/tapplencourt/QMCPack/print_pgm.irp.f b/plugins/tapplencourt/QMCPack/print_pgm.irp.f new file mode 100644 index 00000000..7e571ab5 --- /dev/null +++ b/plugins/tapplencourt/QMCPack/print_pgm.irp.f @@ -0,0 +1,27 @@ +program print_pgm + implicit none + + integer :: i,j + character*(64) :: fmt + + print '(A)', '-------------------------------' + print '(A)', 'P2' + print '(A)', '#' + print *, n_det_alpha_unique, n_det_beta_unique + print *, 255 + + write(fmt,*) '(',n_det_beta_unique,'(I3,X))' + + integer, external :: f + do i=1,n_det_alpha_unique + write(*,fmt) (f(psi_bilinear_matrix(i,j,1)), j=1,n_det_beta_unique) + enddo +end program + +integer function f(x) + implicit none + double precision :: x, df + df = 255.d0*erf(abs(10.d0*x)**(0.25d0)) + f = int(df) +end + diff --git a/plugins/QMC/pseudo.irp.f b/plugins/tapplencourt/QMCPack/pseudo.irp.f similarity index 100% rename from plugins/QMC/pseudo.irp.f rename to plugins/tapplencourt/QMCPack/pseudo.irp.f diff --git a/plugins/QMC/qmc_create_wf.irp.f b/plugins/tapplencourt/QMCPack/qmc_create_wf.irp.f similarity index 100% rename from plugins/QMC/qmc_create_wf.irp.f rename to plugins/tapplencourt/QMCPack/qmc_create_wf.irp.f diff --git a/plugins/QMC/qmc_e_curve.irp.f b/plugins/tapplencourt/QMCPack/qmc_e_curve.irp.f similarity index 100% rename from plugins/QMC/qmc_e_curve.irp.f rename to plugins/tapplencourt/QMCPack/qmc_e_curve.irp.f diff --git a/plugins/QMC/qp_convert_qmcpack_to_ezfio.py b/plugins/tapplencourt/QMCPack/qp_convert_qmcpack_to_ezfio.py similarity index 100% rename from plugins/QMC/qp_convert_qmcpack_to_ezfio.py rename to plugins/tapplencourt/QMCPack/qp_convert_qmcpack_to_ezfio.py diff --git a/plugins/tapplencourt/QMCPack/reorder_dets.irp.f b/plugins/tapplencourt/QMCPack/reorder_dets.irp.f new file mode 100644 index 00000000..009a7d44 --- /dev/null +++ b/plugins/tapplencourt/QMCPack/reorder_dets.irp.f @@ -0,0 +1,19 @@ +program print_h0j + use bitmasks + implicit none + BEGIN_DOC +! Print 1st line of H matrix + END_DOC + integer :: i,j,k + + do k=1,N_det + i = psi_bilinear_matrix_rows(k) + j = psi_bilinear_matrix_columns(k) + psi_det(:,1,k) = psi_det_alpha_unique(:,i) + psi_det(:,2,k) = psi_det_beta_unique(:,j) + psi_coef(k,:) = psi_bilinear_matrix_values(k,:) + end do + call save_wavefunction_unsorted + +end program + diff --git a/plugins/QMC/save_for_qmcpack.irp.f b/plugins/tapplencourt/QMCPack/save_for_qmcpack.irp.f similarity index 100% rename from plugins/QMC/save_for_qmcpack.irp.f rename to plugins/tapplencourt/QMCPack/save_for_qmcpack.irp.f diff --git a/plugins/QMC/target_pt2_qmc.irp.f b/plugins/tapplencourt/QMCPack/target_pt2_qmc.irp.f similarity index 100% rename from plugins/QMC/target_pt2_qmc.irp.f rename to plugins/tapplencourt/QMCPack/target_pt2_qmc.irp.f diff --git a/plugins/QMC/truncate_wf_spin.irp.f b/plugins/tapplencourt/QMCPack/truncate_wf_spin.irp.f similarity index 100% rename from plugins/QMC/truncate_wf_spin.irp.f rename to plugins/tapplencourt/QMCPack/truncate_wf_spin.irp.f diff --git a/plugins/tapplencourt/README.md b/plugins/tapplencourt/README.md new file mode 100644 index 00000000..6936430a --- /dev/null +++ b/plugins/tapplencourt/README.md @@ -0,0 +1,5 @@ +Please create a new repository on github/gitlab for your plugins. For example, see http://gitlab.com/scemama/qp_plugins and put your QP programs there. + +Some useless files might remain in the directories. Please check and create nice README files. + + diff --git a/plugins/pyscf/NEEDED_CHILDREN_MODULES b/plugins/tapplencourt/pyscf/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/pyscf/NEEDED_CHILDREN_MODULES rename to plugins/tapplencourt/pyscf/NEEDED_CHILDREN_MODULES diff --git a/plugins/pyscf/PyscfToQp.py b/plugins/tapplencourt/pyscf/PyscfToQp.py similarity index 100% rename from plugins/pyscf/PyscfToQp.py rename to plugins/tapplencourt/pyscf/PyscfToQp.py diff --git a/plugins/pyscf/README.rst b/plugins/tapplencourt/pyscf/README.rst similarity index 100% rename from plugins/pyscf/README.rst rename to plugins/tapplencourt/pyscf/README.rst diff --git a/plugins/pyscf/pyscf.main.irp.f b/plugins/tapplencourt/pyscf/pyscf.main.irp.f similarity index 100% rename from plugins/pyscf/pyscf.main.irp.f rename to plugins/tapplencourt/pyscf/pyscf.main.irp.f diff --git a/plugins/read_integral/NEEDED_CHILDREN_MODULES b/plugins/tapplencourt/read_integral/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/read_integral/NEEDED_CHILDREN_MODULES rename to plugins/tapplencourt/read_integral/NEEDED_CHILDREN_MODULES diff --git a/plugins/read_integral/README.rst b/plugins/tapplencourt/read_integral/README.rst similarity index 100% rename from plugins/read_integral/README.rst rename to plugins/tapplencourt/read_integral/README.rst diff --git a/plugins/read_integral/create_ezfio.py b/plugins/tapplencourt/read_integral/create_ezfio.py similarity index 100% rename from plugins/read_integral/create_ezfio.py rename to plugins/tapplencourt/read_integral/create_ezfio.py diff --git a/plugins/read_integral/print_integrals_ao.irp.f b/plugins/tapplencourt/read_integral/print_integrals_ao.irp.f similarity index 100% rename from plugins/read_integral/print_integrals_ao.irp.f rename to plugins/tapplencourt/read_integral/print_integrals_ao.irp.f diff --git a/plugins/read_integral/print_integrals_mo.irp.f b/plugins/tapplencourt/read_integral/print_integrals_mo.irp.f similarity index 100% rename from plugins/read_integral/print_integrals_mo.irp.f rename to plugins/tapplencourt/read_integral/print_integrals_mo.irp.f diff --git a/plugins/read_integral/read_integrals_achocol.irp.f b/plugins/tapplencourt/read_integral/read_integrals_achocol.irp.f similarity index 100% rename from plugins/read_integral/read_integrals_achocol.irp.f rename to plugins/tapplencourt/read_integral/read_integrals_achocol.irp.f diff --git a/plugins/read_integral/read_integrals_ao.irp.f b/plugins/tapplencourt/read_integral/read_integrals_ao.irp.f similarity index 100% rename from plugins/read_integral/read_integrals_ao.irp.f rename to plugins/tapplencourt/read_integral/read_integrals_ao.irp.f diff --git a/plugins/tapplencourt/read_integral/read_integrals_ao_test.irp.f b/plugins/tapplencourt/read_integral/read_integrals_ao_test.irp.f new file mode 100644 index 00000000..c4ffc17c --- /dev/null +++ b/plugins/tapplencourt/read_integral/read_integrals_ao_test.irp.f @@ -0,0 +1,44 @@ +program print_integrals + + PROVIDE ezfio_filename + call ezfio_set_integrals_monoelec_disk_access_ao_one_integrals('None') + call ezfio_set_integrals_bielec_disk_access_ao_integrals('None') + call run +end + +subroutine run + implicit none + + integer :: iunit + integer :: getunitandopen + + integer ::i,j,k,l + double precision :: integral + + PROVIDE ao_bielec_integrals_in_map + iunit = getunitandopen('eri.out','r') + + integer*8 :: i8 + integer :: i_idx, n_elements_max, k1, n_elements + integer :: ii(8), jj(8), kk(8), ll(8) + double precision, external :: ao_bielec_integral + integer(key_kind), allocatable :: keys(:) + double precision, allocatable :: values(:) + + + call get_cache_map_n_elements_max(ao_integrals_map,n_elements_max) + allocate(keys(n_elements_max), values(n_elements_max)) + + double precision, external :: get_ao_bielec_integral + double precision :: integral_read + do + read (iunit,*, END=10) i,j,k,l, integral_read + integral = get_ao_bielec_integral(i,j,k,l,ao_integrals_map) + if (dabs(1.d0 - integral_read/integral) > 1.d-3) then + print '(4(I6),2F20.15)', i,j,k,l,integral_read,integral + endif + enddo + 10 continue + + close(iunit) +end diff --git a/plugins/read_integral/read_integrals_mo.irp.f b/plugins/tapplencourt/read_integral/read_integrals_mo.irp.f similarity index 100% rename from plugins/read_integral/read_integrals_mo.irp.f rename to plugins/tapplencourt/read_integral/read_integrals_mo.irp.f diff --git a/plugins/read_integral/read_integrals_mo_chocol.irp.f b/plugins/tapplencourt/read_integral/read_integrals_mo_chocol.irp.f similarity index 100% rename from plugins/read_integral/read_integrals_mo_chocol.irp.f rename to plugins/tapplencourt/read_integral/read_integrals_mo_chocol.irp.f diff --git a/promela/collector.pml b/promela/collector.pml deleted file mode 100644 index 85aae99c..00000000 --- a/promela/collector.pml +++ /dev/null @@ -1,21 +0,0 @@ -proctype collector(byte state) { - - byte task; - req_message msg; - rep_message reply; - bit loop = 1; - xr pull_socket; - - do - :: (loop == 0) -> break - :: else -> - pull_socket ? task; - /* Handle result */ - send_req(DELTASK, task); - assert (reply.m == OK); - loop = reply.value; - od; - -} - - diff --git a/promela/fortran.pml b/promela/fortran.pml deleted file mode 100644 index 011eea75..00000000 --- a/promela/fortran.pml +++ /dev/null @@ -1,48 +0,0 @@ -active proctype fortran() { - req_message msg; - rep_message reply; - byte state; - byte count, wait; - - - /* New parallel job */ - state=1; - send_req( NEWJOB, state ); - assert (reply.m == OK); - - send_req( PUTPSI, state ); - assert (reply.m == PUTPSI_REPLY); - - /* Add tasks */ - count = 0; - do - :: (count == NTASKS) -> break; - :: else -> - count++; - send_req( ADDTASK, count ); - assert (reply.m == OK); - od - - wait = _nr_pr; - /* Run collector */ - run collector(state); - - /* Run slaves */ - count = 0; - do - :: (count == NPROC) -> break; - :: else -> count++; run slave(); - od - - /* Wait for collector and slaves to finish */ - (_nr_pr == wait); - - send_req( ENDJOB, state ); - assert (reply.m == OK); - state = reply.value; - - send_req( TERMINATE, 0); - assert (reply.m == OK); - -} - diff --git a/promela/integrals.pml b/promela/integrals.pml deleted file mode 100644 index 7b05156f..00000000 --- a/promela/integrals.pml +++ /dev/null @@ -1,272 +0,0 @@ -#define NPROC 1 -#define BUFSIZE 2 -#define NTASKS 3 - -mtype = { NONE, OK, WRONG_STATE, TERMINATE, GETPSI, PUTPSI, NEWJOB, ENDJOB, SETRUNNING, - SETWAITING, SETSTOPPED, CONNECT, DISCONNECT, ADDTASK, DELTASK, TASKDONE, GETTASK, - PSI, TASK, PUTPSI_REPLY, WAITING, RUNNING, STOPPED - } - -typedef rep_message { - mtype m = NONE; - byte value = 0; -} - -typedef req_message { - mtype m = NONE; - byte state = 0; - byte value = 0; - chan reply = [BUFSIZE] of { rep_message }; -} - -#define send_req( MESSAGE, VALUE ) msg.m=MESSAGE ; msg.value=VALUE ; msg.state=state; rep_socket ! msg; msg.reply ? reply - -chan rep_socket = [NPROC] of { req_message }; -chan pull_socket = [NPROC] of { byte }; -chan pair_socket = [NPROC] of { req_message }; -chan task_queue = [NTASKS+2] of { byte }; -chan pub_socket = [NTASKS+2] of { mtype }; - -bit socket_up = 0; -mtype global_state; /* Sent by pub */ - -active proctype qp_run() { - - bit psi = 0; - bit address_tcp = 0; - bit address_inproc = 0; - bit running = 0; - byte status = 0; - byte state = 0; - byte ntasks = 0; - req_message msg; - rep_message reply; - byte nclients = 0; - byte task; - - socket_up = 1; - running = 1; - do -// :: ( (running == 0) && (nclients == 0) && (ntasks == 0) ) -> break - :: ( running == 0 ) -> break - :: else -> - - rep_socket ? msg; - printf("req: "); printm(msg.m); printf("\t%d\n",msg.value); - - if - :: ( msg.m == TERMINATE ) -> - assert (state != 0); - assert (msg.state == state); - running = 0; - reply.m = OK; - - :: ( msg.m == PUTPSI ) -> - assert (state != 0); - assert (msg.state == state); - assert (psi == 0); - psi = 1; - reply.m = PUTPSI_REPLY; - - :: ( msg.m == GETPSI ) -> - assert (state != 0); - assert (msg.state == state); - assert (psi == 1); - reply.m = PSI; - - :: ( msg.m == NEWJOB ) -> - assert (state == 0); - state = msg.value; - pair_socket ! WAITING; - reply.m = OK; - reply.value = state; - - :: ( msg.m == ENDJOB ) -> - assert (state != 0); - assert (msg.state == state); - state = 0; - pair_socket ! WAITING; - reply.m = OK; - - :: ( msg.m == ADDTASK ) -> - assert (state != 0); - assert (msg.state == state); - task_queue ! msg.value; - ntasks++; - reply.m = OK; - - :: ( msg.m == GETTASK ) -> - assert (nclients > 0); - assert (state != 0); - assert (msg.state == state); - if - :: ( task_queue ?[task] ) -> - pair_socket ! WAITING; - reply.m = TASK; - task_queue ? reply.value - :: else -> - pair_socket ! RUNNING; - reply.m = NONE; - reply.value = 255; - fi; - - :: ( msg.m == TASKDONE) -> - assert (state != 0); - assert (msg.state == state); - assert (nclients > 0); - assert (ntasks > 0); - reply.m = OK; - - :: ( msg.m == DELTASK ) -> - assert (state != 0); - assert (msg.state == state); - ntasks--; - if - :: (ntasks > 0) -> reply.value = 1; - :: else -> reply.value = 0; - fi; - reply.m = OK; - - :: ( msg.m == CONNECT ) -> - assert ( state != 0 ) - nclients++; - reply.m = OK; - reply.value = state; - - :: ( msg.m == DISCONNECT ) -> - assert ( msg.state == state ) - nclients--; - reply.m = OK; - - :: ( msg.m == STOPPED ) -> - pair_socket ! STOPPED; - reply.m = OK; - - :: ( msg.m == WAITING ) -> - pair_socket ! WAITING; - reply.m = OK; - - :: ( msg.m == RUNNING ) -> - assert ( state != 0 ); - pair_socket ! RUNNING; - reply.m = OK; - - fi - msg.reply ! reply - od - pair_socket ! STOPPED; - socket_up = 0; - -} - - -active proctype master() { - - req_message msg; - rep_message reply; - byte state = 0; - byte count; - - run pub_thread(); - - /* New parallel job */ - state=1; - send_req( NEWJOB, state ); - assert (reply.m == OK); - - /* Add tasks */ - count = 0; - do - :: (count == NTASKS) -> break; - :: else -> - count++; - send_req( ADDTASK, count ); - assert (reply.m == OK); - od - - /* Run collector */ - run collector(state); - - /* Run slaves */ - count = 0; - do - :: (count == NPROC) -> break; - :: else -> count++; run slave(); - od - -} - -proctype slave() { - - req_message msg; - rep_message reply; - byte task; - byte state; - - msg.m=CONNECT; - msg.state = 0; - - if - :: (!socket_up) -> goto exit; - :: else -> skip; - fi - rep_socket ! msg; - - if - :: (!socket_up) -> goto exit; - :: else -> skip; - fi - msg.reply ? reply; - - state = reply.value; - - - task = 1; - do - :: (task == 255) -> break; - :: else -> - send_req( GETTASK, 0); - if - :: (reply.m == NONE) -> - task = 255; - :: (reply.m == TASK) -> - /* Compute task */ - task = reply.value; - send_req( TASKDONE, task); - assert (reply.m == OK); - pull_socket ! task; - fi - od - send_req( DISCONNECT, 0); - assert (reply.m == OK); - -exit: skip; -} - -proctype collector(byte state) { - byte task; - req_message msg; - rep_message reply; - bit loop = 1; - do - :: (loop == 0) -> break - :: else -> - pull_socket ? task; - /* Handle result */ - send_req(DELTASK, task); - assert (reply.m == OK); - loop = reply.value; - od - send_req( TERMINATE, 0); - assert (reply.m == OK); -} - -proctype pub_thread() { - mtype state = WAITING; - do - :: (state == STOPPED) -> break; - :: (pair_socket ? [state]) -> - pair_socket ? state; - global_state = state; - od -} diff --git a/promela/model.pml b/promela/model.pml deleted file mode 100644 index f55769d5..00000000 --- a/promela/model.pml +++ /dev/null @@ -1,35 +0,0 @@ -#define NPROC 3 -#define BUFSIZE 2 -#define NTASKS 4 - -mtype = { NONE, OK, WRONG_STATE, TERMINATE, GETPSI, PUTPSI, NEWJOB, ENDJOB, SETRUNNING, - SETWAITING, SETSTOPPED, CONNECT, DISCONNECT, ADDTASK, DELTASK, TASKDONE, GETTASK, - PSI, TASK, PUTPSI_REPLY, WAITING, RUNNING, STOPPED - } - -#define send_req( MESSAGE, VALUE ) atomic { msg.m=MESSAGE ; msg.value=VALUE ; msg.state=state; } ; rep_socket ! msg; msg.reply ? reply - -/* Request/Reply pattern */ - -typedef rep_message { - mtype m = NONE; - byte value = 0; -} - -typedef req_message { - mtype m = NONE; - byte state = 0; - byte value = 0; - chan reply = [BUFSIZE] of { rep_message }; -} - -/* Channels */ - -chan rep_socket = [NPROC] of { req_message }; -chan pull_socket = [NPROC] of { byte }; - - -#include "task_server.pml" -#include "fortran.pml" -#include "collector.pml" -#include "slave.pml" diff --git a/promela/slave.pml b/promela/slave.pml deleted file mode 100644 index e6bfbe2b..00000000 --- a/promela/slave.pml +++ /dev/null @@ -1,29 +0,0 @@ -proctype slave() { - req_message msg; - rep_message reply; - byte task; - byte state; - - send_req(CONNECT, 0); - assert (reply.m == OK); - state = reply.value; - - send_req(GETPSI, 0); - assert (reply.m == PSI); - - task=255; - do - :: (task == 0) -> break; - :: else -> - send_req( GETTASK, 0); - if - :: (reply.m == NONE) -> task = 0; - :: (reply.m == TASK) -> - task = reply.value; - /* Compute task */ - send_req( TASKDONE, task); - assert (reply.m == OK); - pull_socket ! task; - fi - od -} diff --git a/promela/task_server.pml b/promela/task_server.pml deleted file mode 100644 index 6f464628..00000000 --- a/promela/task_server.pml +++ /dev/null @@ -1,138 +0,0 @@ -/* State of the task server */ -typedef state_t { - chan queue = [NTASKS+2] of { byte }; - byte state = 0; - bit address_tcp = 0; - bit address_inproc = 0; - bit psi = 0; - bit running = 0; - byte ntasks; - byte nclients = 0; -} - - -active proctype task_server() { - - xr rep_socket; - state_t state; - req_message msg; - rep_message reply; - byte task; - - state.running = 1; - do - :: ( state.running + state.nclients == 0 ) -> break - :: else -> - rep_socket ? msg; - printf("req: "); printm(msg.m); printf("\t%d\n",msg.value); - - if - :: ( msg.m == TERMINATE ) -> - atomic { - assert (state.state == 0); - assert (msg.state == state.state); - state.running = 0; - reply.m = OK; - } - - :: ( msg.m == CONNECT ) -> - atomic { - assert (state.state != 0); - state.nclients++; - reply.m = OK; - reply.value = state.state; - } - -/* - :: ( msg.m == DISCONNECT ) -> - atomic { - assert (state.state != 0); - assert (msg.state == state.state); - state.nclients--; - reply.m = OK; - } -*/ - - :: ( msg.m == PUTPSI ) -> - atomic { - assert (state.state != 0); - assert (msg.state == state.state); - assert (state.psi == 0); - state.psi = 1; - reply.m = PUTPSI_REPLY; - } - - :: ( msg.m == GETPSI ) -> - atomic { - assert (state.state != 0); - assert (msg.state == state.state); - assert (state.psi == 1); - reply.m = PSI; - } - - :: ( msg.m == NEWJOB ) -> - atomic { - assert (state.state == 0); - state.state = msg.value; - reply.m = OK; - reply.value = state.state; - } - - :: ( msg.m == ENDJOB ) -> - atomic { - assert (state.state != 0); - assert (msg.state == state.state); - state.state = 0; - reply.m = OK; - } - - :: ( msg.m == TASKDONE ) -> - atomic { - assert (state.state != 0); - assert (state.ntasks > 0); - assert (msg.state == state.state); - reply.m = OK; - } - - :: ( msg.m == GETTASK ) -> - assert (state.state != 0); - assert (state.nclients > 0); - assert (msg.state == state.state); - if - :: ( state.queue ?[task] ) -> - reply.m = TASK; - state.queue ? reply.value - :: else -> - atomic { - reply.m = NONE; - reply.value = 0; - state.nclients--; - } - fi; - - :: ( msg.m == DELTASK ) -> - assert (state.state != 0); - assert (msg.state == state.state); - state.ntasks--; - if - :: (state.ntasks > 0) -> reply.value = 1; - :: else -> reply.value = 0; - fi; - reply.m = OK; - - :: ( msg.m == ADDTASK ) -> - assert (state.state != 0); - assert (msg.state == state.state); - atomic { - state.ntasks++; - reply.m = OK; - } - state.queue ! msg.value; - - fi; - msg.reply ! reply; - printf("rep: "); printm(reply.m); printf("\t%d\n",reply.value); - - od; -} - diff --git a/scripts/module/qp_update_readme.py b/scripts/module/qp_update_readme.py deleted file mode 100755 index b76030e9..00000000 --- a/scripts/module/qp_update_readme.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- -""" -Updates the README.rst of a module -Usage: - qp_update_readme.py [...] [--root_module=] - -Options: - path_readme: All the absolute path you want to update. - By default is the cwd - --root_module: Is the path of the root module who containt the tags file. - By default is the cwd -""" - -import sys - -try: - from docopt import docopt - from module_handler import is_module, is_plugin -except: - print "Please check if you have sourced the .quantum_package.rc" - print "(`source .quantum_package.rc`)" - print sys.exit(1) - -import os -from collections import namedtuple -from collections import defaultdict - - -def header_format(str_): - - warning = "\n".join([".. Do not edit this section It was auto-generated", - ".. by the `update_README.py` script."]) - - return "{0}\n{1}\n{2}\n".format(str_, "=" * len(str_), warning) - -D_KEY = {"needed_module": header_format("Needed Modules"), - "documentation": header_format("Documentation")} - - -def get_url(path_module_rel): - if is_plugin(path_module_rel): - url = "http://github.com/LCPQ/quantum_package/tree/master/plugins" - elif is_module(path_module_rel): - url = "http://github.com/LCPQ/quantum_package/tree/master/src" - else: - print "{0} Is not a valid module nor plugin".format(path_module_rel) - sys.exit(1) - - return os.path.join(url, path_module_rel) - - -def fetch_splitted_data(d_readme, l_module_readme): - """Read the README.rst file and split it in strings: - * The documentation - * The needed modules - The result is given as a list of strings - """ - - sentinel = "@@$%&@@" - - for path_readme in l_module_readme: - with open(os.path.join(path_readme, "README.rst"), 'r') as f: - data = f.read() - - # Place sentinels - - for v in D_KEY.values(): - data = data.replace(v, sentinel + v) - - # Now Split data using the sentinels - d_readme[path_readme] = {"human": data.split(sentinel)[0]} - - -def update_needed(d_readme): - """Read the NEEDED_CHILDREN_MODULES file, and replace the data with it. - Create the links to the GitHub pages.""" - - header_image = ".. image:: tree_dependency.png" - - for path in d_readme: - - with open(os.path.join(path, 'NEEDED_CHILDREN_MODULES'), 'r') as f: - modules = f.read() - - if modules.strip(): - l_module = ['* `{0} <{1}>`_'.format(name, get_url(name)) - for name in modules.split()] - - l_module_section = [D_KEY["needed_module"], '', - header_image, '', - '\n'.join(l_module), '', ''] - else: - l_module_section = "" - - d_readme[path]["needed_module"] = "\n".join(l_module_section) - - -def extract_doc(root_module, provider): - """Extracts the documentation contained in IRPF90_man file""" - - path = os.path.join(root_module, "IRPF90_man/%s.l" % (provider)) - with open(path, 'r') as f: - l_line = f.readlines() - - result = [] - inside = False - for line in l_line: - if not inside: - inside = line.startswith(".SH Description") - else: - if line.startswith(".SH"): - break - result.append(" {0}".format(line.strip())) - - if not result: - result = [" Undocumented"] - - return "\n".join(result) + "\n" - - -def update_documentation(d_readmen, root_module): - """Reads the BEGIN_DOC ... END_DOC blocks and builds the documentation""" - - IRP_info = namedtuple('IRP_info', ["module", "file", "provider", "line"]) - - # If the file does not exist, don't do anything - path = os.path.join(root_module, "tags") - - with open(path, 'r') as f: - dump = f.readlines() - - d_info = defaultdict(list) - - for i in dump: - # i = - # output_cpu_time_0 Ezfio_files/output.irp.f 2 - provider, irp_file_raw, ligne = i.split() - - for path in d_readme: - - if root_module == path and "/" not in irp_file_raw: - d_info[path].append(IRP_info(os.path.basename(path), - irp_file_raw, - provider, - ligne)) - - elif "/" in irp_file_raw and os.path.dirname(irp_file_raw) in path: - - module, irp_file = os.path.split(irp_file_raw) - d_info[path].append(IRP_info(module, irp_file, provider, ligne)) - - for path in d_readme: - - l_doc = [] - - for irp in d_info[path]: - url = os.path.join(get_url(os.path.basename(path)), irp.file) - doc = extract_doc(root_module, irp.provider) - - if ".irp.f_shell_" in irp.file: - l_doc += ["{0}".format(irp.provider), - doc, - ""] - else: - l_doc += ["`{0} <{1}#L{2}>`_".format(irp.provider, url, irp.line), - doc, - ""] - - l_doc_section = [D_KEY["documentation"], '', - "\n".join(l_doc)] - - d_readme[path]["documentation"] = "\n".join(l_doc_section) - - -if __name__ == '__main__': - - # Update documentation only if the remote repository is - # the main repository - from is_master_repository import is_master_repository - if not is_master_repository: - sys.exit(0) - - arguments = docopt(__doc__) - - if arguments["--root_module"]: - root_module = os.path.realpath(arguments["--root_module"]) - else: - root_module = os.getcwd() - - if not arguments[""]: - l_module_readme = [os.path.join(os.getcwd())] - else: - l_module_readme = arguments[""] - - # d[Path] ={humain, needed_module, documentation} - d_readme = defaultdict(dict) - - try: - fetch_splitted_data(d_readme, l_module_readme) - except IOError: - print l_module_readme, "is not a module and/or", - print "has not a `README.rst` file inside" - print "Aborting..." - sys.exit(1) - - update_needed(d_readme) - update_documentation(d_readme, root_module) - - for path, d in d_readme.iteritems(): - - with open(os.path.join(path, "README.rst"), 'w') as f: - for k in ["human", - "needed_module", - "documentation"]: - - f.write(d[k]) diff --git a/src/AO_Basis/tree_dependency.png b/src/AO_Basis/tree_dependency.png deleted file mode 100644 index acaeb7af..00000000 Binary files a/src/AO_Basis/tree_dependency.png and /dev/null differ diff --git a/src/Bitmask/tree_dependency.png b/src/Bitmask/tree_dependency.png deleted file mode 100644 index 24ce3397..00000000 Binary files a/src/Bitmask/tree_dependency.png and /dev/null differ diff --git a/plugins/CIS/H_apply.irp.f b/src/CIS/H_apply.irp.f similarity index 100% rename from plugins/CIS/H_apply.irp.f rename to src/CIS/H_apply.irp.f diff --git a/plugins/CISD/NEEDED_CHILDREN_MODULES b/src/CIS/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/CISD/NEEDED_CHILDREN_MODULES rename to src/CIS/NEEDED_CHILDREN_MODULES diff --git a/plugins/CIS/README.rst b/src/CIS/README.rst similarity index 100% rename from plugins/CIS/README.rst rename to src/CIS/README.rst diff --git a/plugins/CIS/cis.irp.f b/src/CIS/cis.irp.f similarity index 100% rename from plugins/CIS/cis.irp.f rename to src/CIS/cis.irp.f diff --git a/src/CISD/EZFIO.cfg b/src/CISD/EZFIO.cfg new file mode 100644 index 00000000..dc3ee61d --- /dev/null +++ b/src/CISD/EZFIO.cfg @@ -0,0 +1,10 @@ +[energy] +type: double precision +doc: Variational CISD energy +interface: ezfio + +[energy_pt2] +type: double precision +doc: Estimated CISD energy (including PT2) +interface: ezfio + diff --git a/src/CISD/H_apply.irp.f b/src/CISD/H_apply.irp.f new file mode 100644 index 00000000..8e565c8f --- /dev/null +++ b/src/CISD/H_apply.irp.f @@ -0,0 +1,11 @@ +! Generates subroutine H_apply_cisd +! ---------------------------------- + +BEGIN_SHELL [ /usr/bin/env python2 ] +from generate_h_apply import H_apply +H = H_apply("cisd",do_double_exc=True) +print H +H = H_apply("cis",do_double_exc=False) +print H +END_SHELL + diff --git a/src/CISD/NEEDED_CHILDREN_MODULES b/src/CISD/NEEDED_CHILDREN_MODULES new file mode 100644 index 00000000..3272abe5 --- /dev/null +++ b/src/CISD/NEEDED_CHILDREN_MODULES @@ -0,0 +1 @@ +Selectors_full SingleRefMethod DavidsonUndressed diff --git a/src/CISD/README.rst b/src/CISD/README.rst new file mode 100644 index 00000000..af772201 --- /dev/null +++ b/src/CISD/README.rst @@ -0,0 +1,85 @@ +CISD +==== + +This is a test directory which builds a CISD by setting the follwoing rules: + +* The only generator determinant is the Hartee-Fock (single-reference method) +* All generated determinants are included in the wave function (no perturbative + selection) + +These rules are set in the ``H_apply.irp.f`` file. + +Needed Modules +============== + +.. Do not edit this section. It was auto-generated from the +.. by the `update_README.py` script. + +.. image:: tree_dependency.png + +* `Selectors_full `_ +* `SingleRefMethod `_ + +Documentation +============= + +.. Do not edit this section. It was auto-generated from the +.. by the `update_README.py` script. + +`h_apply_cisd `_ + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +`h_apply_cisd_diexc `_ + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +`h_apply_cisd_monoexc `_ + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +.. image:: tree_dependency.png + +* `Selectors_full `_ +* `SingleRefMethod `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +h_apply_cisd + Calls H_apply on the HF determinant and selects all connected single and double + excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + +h_apply_cisd_diexc + Undocumented + + +h_apply_cisd_diexcorg + Generate all double excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + + +h_apply_cisd_diexcp + Undocumented + + +h_apply_cisd_monoexc + Generate all single excitations of key_in using the bit masks of holes and + particles. + Assume N_int is already provided. + diff --git a/plugins/CISD/cisd.irp.f b/src/CISD/cisd.irp.f similarity index 100% rename from plugins/CISD/cisd.irp.f rename to src/CISD/cisd.irp.f diff --git a/plugins/DavidsonDressed/NEEDED_CHILDREN_MODULES b/src/DavidsonDressed/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/DavidsonDressed/NEEDED_CHILDREN_MODULES rename to src/DavidsonDressed/NEEDED_CHILDREN_MODULES diff --git a/plugins/DavidsonDressed/README.rst b/src/DavidsonDressed/README.rst similarity index 100% rename from plugins/DavidsonDressed/README.rst rename to src/DavidsonDressed/README.rst diff --git a/plugins/DavidsonDressed/diagonalize_CI.irp.f b/src/DavidsonDressed/diagonalize_CI.irp.f similarity index 100% rename from plugins/DavidsonDressed/diagonalize_CI.irp.f rename to src/DavidsonDressed/diagonalize_CI.irp.f diff --git a/src/Determinants/tree_dependency.png b/src/Determinants/tree_dependency.png deleted file mode 100644 index 9184383e..00000000 Binary files a/src/Determinants/tree_dependency.png and /dev/null differ diff --git a/src/Electrons/tree_dependency.png b/src/Electrons/tree_dependency.png deleted file mode 100644 index b90a1f83..00000000 Binary files a/src/Electrons/tree_dependency.png and /dev/null differ diff --git a/src/Ezfio_files/tree_dependency.png b/src/Ezfio_files/tree_dependency.png deleted file mode 100644 index 48f53991..00000000 Binary files a/src/Ezfio_files/tree_dependency.png and /dev/null differ diff --git a/plugins/Full_CI_ZMQ/EZFIO.cfg b/src/FCI/EZFIO.cfg similarity index 100% rename from plugins/Full_CI_ZMQ/EZFIO.cfg rename to src/FCI/EZFIO.cfg diff --git a/plugins/Full_CI_ZMQ/fci_zmq.irp.f b/src/FCI/FCI.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/fci_zmq.irp.f rename to src/FCI/FCI.irp.f diff --git a/plugins/Full_CI_ZMQ/NEEDED_CHILDREN_MODULES b/src/FCI/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Full_CI_ZMQ/NEEDED_CHILDREN_MODULES rename to src/FCI/NEEDED_CHILDREN_MODULES diff --git a/plugins/Full_CI_ZMQ/pt2_stoch.irp.f b/src/FCI/PT2.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/pt2_stoch.irp.f rename to src/FCI/PT2.irp.f diff --git a/plugins/Full_CI_ZMQ/README.rst b/src/FCI/README.rst similarity index 100% rename from plugins/Full_CI_ZMQ/README.rst rename to src/FCI/README.rst diff --git a/plugins/Full_CI_ZMQ/dump_fci_iterations_value.irp.f b/src/FCI/dump_fci_iterations_value.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/dump_fci_iterations_value.irp.f rename to src/FCI/dump_fci_iterations_value.irp.f diff --git a/plugins/Full_CI_ZMQ/energy.irp.f b/src/FCI/energy.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/energy.irp.f rename to src/FCI/energy.irp.f diff --git a/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f b/src/FCI/pt2_stoch_routines.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f rename to src/FCI/pt2_stoch_routines.irp.f diff --git a/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f b/src/FCI/run_pt2_slave.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/run_pt2_slave.irp.f rename to src/FCI/run_pt2_slave.irp.f diff --git a/plugins/Full_CI_ZMQ/run_selection_slave.irp.f b/src/FCI/run_selection_slave.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/run_selection_slave.irp.f rename to src/FCI/run_selection_slave.irp.f diff --git a/plugins/Full_CI_ZMQ/selection.irp.f b/src/FCI/selection.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/selection.irp.f rename to src/FCI/selection.irp.f diff --git a/plugins/Full_CI_ZMQ/selection_buffer.irp.f b/src/FCI/selection_buffer.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/selection_buffer.irp.f rename to src/FCI/selection_buffer.irp.f diff --git a/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f b/src/FCI/selection_davidson_slave.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f rename to src/FCI/selection_davidson_slave.irp.f diff --git a/plugins/Full_CI_ZMQ/selection_slave.irp.f b/src/FCI/selection_slave.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/selection_slave.irp.f rename to src/FCI/selection_slave.irp.f diff --git a/plugins/Full_CI_ZMQ/selection_types.f90 b/src/FCI/selection_types.f90 similarity index 100% rename from plugins/Full_CI_ZMQ/selection_types.f90 rename to src/FCI/selection_types.f90 diff --git a/plugins/Full_CI_ZMQ/zmq_selection.irp.f b/src/FCI/zmq_selection.irp.f similarity index 100% rename from plugins/Full_CI_ZMQ/zmq_selection.irp.f rename to src/FCI/zmq_selection.irp.f diff --git a/plugins/Orbital_Entanglement/NEEDED_CHILDREN_MODULES b/src/Generators_CAS/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Orbital_Entanglement/NEEDED_CHILDREN_MODULES rename to src/Generators_CAS/NEEDED_CHILDREN_MODULES diff --git a/plugins/Generators_CAS/README.rst b/src/Generators_CAS/README.rst similarity index 100% rename from plugins/Generators_CAS/README.rst rename to src/Generators_CAS/README.rst diff --git a/plugins/Generators_CAS/generators.irp.f b/src/Generators_CAS/generators.irp.f similarity index 100% rename from plugins/Generators_CAS/generators.irp.f rename to src/Generators_CAS/generators.irp.f diff --git a/plugins/Generators_full/NEEDED_CHILDREN_MODULES b/src/Generators_full/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Generators_full/NEEDED_CHILDREN_MODULES rename to src/Generators_full/NEEDED_CHILDREN_MODULES diff --git a/plugins/Generators_full/README.rst b/src/Generators_full/README.rst similarity index 100% rename from plugins/Generators_full/README.rst rename to src/Generators_full/README.rst diff --git a/plugins/Generators_full/generators.irp.f b/src/Generators_full/generators.irp.f similarity index 100% rename from plugins/Generators_full/generators.irp.f rename to src/Generators_full/generators.irp.f diff --git a/plugins/Hartree_Fock/DIIS.irp.f b/src/Hartree_Fock/DIIS.irp.f similarity index 100% rename from plugins/Hartree_Fock/DIIS.irp.f rename to src/Hartree_Fock/DIIS.irp.f diff --git a/plugins/Hartree_Fock/EZFIO.cfg b/src/Hartree_Fock/EZFIO.cfg similarity index 100% rename from plugins/Hartree_Fock/EZFIO.cfg rename to src/Hartree_Fock/EZFIO.cfg diff --git a/plugins/Hartree_Fock/Fock_matrix.irp.f b/src/Hartree_Fock/Fock_matrix.irp.f similarity index 100% rename from plugins/Hartree_Fock/Fock_matrix.irp.f rename to src/Hartree_Fock/Fock_matrix.irp.f diff --git a/plugins/Hartree_Fock/HF_density_matrix_ao.irp.f b/src/Hartree_Fock/HF_density_matrix_ao.irp.f similarity index 100% rename from plugins/Hartree_Fock/HF_density_matrix_ao.irp.f rename to src/Hartree_Fock/HF_density_matrix_ao.irp.f diff --git a/plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES b/src/Hartree_Fock/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES rename to src/Hartree_Fock/NEEDED_CHILDREN_MODULES diff --git a/plugins/Hartree_Fock/README.rst b/src/Hartree_Fock/README.rst similarity index 100% rename from plugins/Hartree_Fock/README.rst rename to src/Hartree_Fock/README.rst diff --git a/plugins/Hartree_Fock/Roothaan_Hall_SCF.irp.f b/src/Hartree_Fock/Roothaan_Hall_SCF.irp.f similarity index 100% rename from plugins/Hartree_Fock/Roothaan_Hall_SCF.irp.f rename to src/Hartree_Fock/Roothaan_Hall_SCF.irp.f diff --git a/plugins/Hartree_Fock/SCF.irp.f b/src/Hartree_Fock/SCF.irp.f similarity index 100% rename from plugins/Hartree_Fock/SCF.irp.f rename to src/Hartree_Fock/SCF.irp.f diff --git a/plugins/Hartree_Fock/damping_SCF.irp.f b/src/Hartree_Fock/damping_SCF.irp.f similarity index 100% rename from plugins/Hartree_Fock/damping_SCF.irp.f rename to src/Hartree_Fock/damping_SCF.irp.f diff --git a/plugins/Hartree_Fock/diagonalize_fock.irp.f b/src/Hartree_Fock/diagonalize_fock.irp.f similarity index 100% rename from plugins/Hartree_Fock/diagonalize_fock.irp.f rename to src/Hartree_Fock/diagonalize_fock.irp.f diff --git a/plugins/Hartree_Fock/huckel.irp.f b/src/Hartree_Fock/huckel.irp.f similarity index 100% rename from plugins/Hartree_Fock/huckel.irp.f rename to src/Hartree_Fock/huckel.irp.f diff --git a/src/Integrals_Bielec/tree_dependency.png b/src/Integrals_Bielec/tree_dependency.png deleted file mode 100644 index 92944e89..00000000 Binary files a/src/Integrals_Bielec/tree_dependency.png and /dev/null differ diff --git a/src/MOGuess/tree_dependency.png b/src/MOGuess/tree_dependency.png deleted file mode 100644 index f33b4bb3..00000000 Binary files a/src/MOGuess/tree_dependency.png and /dev/null differ diff --git a/src/MO_Basis/tree_dependency.png b/src/MO_Basis/tree_dependency.png deleted file mode 100644 index c8086369..00000000 Binary files a/src/MO_Basis/tree_dependency.png and /dev/null differ diff --git a/src/MPI/.gitignore b/src/MPI/.gitignore deleted file mode 100644 index 7ac9fbf6..00000000 --- a/src/MPI/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -IRPF90_temp/ -IRPF90_man/ -irpf90.make -irpf90_entities -tags \ No newline at end of file diff --git a/src/Nuclei/tree_dependency.png b/src/Nuclei/tree_dependency.png deleted file mode 100644 index 72cfaeee..00000000 Binary files a/src/Nuclei/tree_dependency.png and /dev/null differ diff --git a/plugins/Perturbation/EZFIO.cfg b/src/Perturbation/EZFIO.cfg similarity index 100% rename from plugins/Perturbation/EZFIO.cfg rename to src/Perturbation/EZFIO.cfg diff --git a/plugins/Perturbation/NEEDED_CHILDREN_MODULES b/src/Perturbation/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Perturbation/NEEDED_CHILDREN_MODULES rename to src/Perturbation/NEEDED_CHILDREN_MODULES diff --git a/plugins/Perturbation/README.rst b/src/Perturbation/README.rst similarity index 100% rename from plugins/Perturbation/README.rst rename to src/Perturbation/README.rst diff --git a/plugins/Perturbation/exc_max.irp.f b/src/Perturbation/exc_max.irp.f similarity index 100% rename from plugins/Perturbation/exc_max.irp.f rename to src/Perturbation/exc_max.irp.f diff --git a/plugins/Perturbation/pert_sc2.irp.f b/src/Perturbation/pert_sc2.irp.f similarity index 100% rename from plugins/Perturbation/pert_sc2.irp.f rename to src/Perturbation/pert_sc2.irp.f diff --git a/plugins/Perturbation/pert_single.irp.f b/src/Perturbation/pert_single.irp.f similarity index 100% rename from plugins/Perturbation/pert_single.irp.f rename to src/Perturbation/pert_single.irp.f diff --git a/plugins/Perturbation/perturbation.irp.f b/src/Perturbation/perturbation.irp.f similarity index 100% rename from plugins/Perturbation/perturbation.irp.f rename to src/Perturbation/perturbation.irp.f diff --git a/plugins/Perturbation/perturbation.template.f b/src/Perturbation/perturbation.template.f similarity index 100% rename from plugins/Perturbation/perturbation.template.f rename to src/Perturbation/perturbation.template.f diff --git a/plugins/Perturbation/pt2_equations.irp.f b/src/Perturbation/pt2_equations.irp.f similarity index 100% rename from plugins/Perturbation/pt2_equations.irp.f rename to src/Perturbation/pt2_equations.irp.f diff --git a/plugins/Perturbation/pt2_new.irp.f b/src/Perturbation/pt2_new.irp.f similarity index 100% rename from plugins/Perturbation/pt2_new.irp.f rename to src/Perturbation/pt2_new.irp.f diff --git a/plugins/Perturbation/selection.irp.f b/src/Perturbation/selection.irp.f similarity index 100% rename from plugins/Perturbation/selection.irp.f rename to src/Perturbation/selection.irp.f diff --git a/plugins/Perturbation/var_pt2_ratio_provider.irp.f b/src/Perturbation/var_pt2_ratio_provider.irp.f similarity index 100% rename from plugins/Perturbation/var_pt2_ratio_provider.irp.f rename to src/Perturbation/var_pt2_ratio_provider.irp.f diff --git a/src/Pseudo/tree_dependency.png b/src/Pseudo/tree_dependency.png deleted file mode 100644 index 5a9af5ae..00000000 Binary files a/src/Pseudo/tree_dependency.png and /dev/null differ diff --git a/plugins/Psiref_CAS/NEEDED_CHILDREN_MODULES b/src/Psiref_CAS/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Psiref_CAS/NEEDED_CHILDREN_MODULES rename to src/Psiref_CAS/NEEDED_CHILDREN_MODULES diff --git a/plugins/Psiref_CAS/README.rst b/src/Psiref_CAS/README.rst similarity index 100% rename from plugins/Psiref_CAS/README.rst rename to src/Psiref_CAS/README.rst diff --git a/plugins/Psiref_CAS/psi_ref.irp.f b/src/Psiref_CAS/psi_ref.irp.f similarity index 100% rename from plugins/Psiref_CAS/psi_ref.irp.f rename to src/Psiref_CAS/psi_ref.irp.f diff --git a/plugins/DensityMatrix/NEEDED_CHILDREN_MODULES b/src/Psiref_Utils/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/DensityMatrix/NEEDED_CHILDREN_MODULES rename to src/Psiref_Utils/NEEDED_CHILDREN_MODULES diff --git a/plugins/Psiref_Utils/README.rst b/src/Psiref_Utils/README.rst similarity index 100% rename from plugins/Psiref_Utils/README.rst rename to src/Psiref_Utils/README.rst diff --git a/plugins/Psiref_Utils/extract_ref.irp.f b/src/Psiref_Utils/extract_ref.irp.f similarity index 100% rename from plugins/Psiref_Utils/extract_ref.irp.f rename to src/Psiref_Utils/extract_ref.irp.f diff --git a/plugins/Psiref_Utils/psi_ref_excitations_operators.irp.f b/src/Psiref_Utils/psi_ref_excitations_operators.irp.f similarity index 100% rename from plugins/Psiref_Utils/psi_ref_excitations_operators.irp.f rename to src/Psiref_Utils/psi_ref_excitations_operators.irp.f diff --git a/plugins/Psiref_Utils/psi_ref_utils.irp.f b/src/Psiref_Utils/psi_ref_utils.irp.f similarity index 100% rename from plugins/Psiref_Utils/psi_ref_utils.irp.f rename to src/Psiref_Utils/psi_ref_utils.irp.f diff --git a/plugins/Selectors_CASSD/NEEDED_CHILDREN_MODULES b/src/Selectors_CASSD/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Selectors_CASSD/NEEDED_CHILDREN_MODULES rename to src/Selectors_CASSD/NEEDED_CHILDREN_MODULES diff --git a/plugins/Selectors_CASSD/README.rst b/src/Selectors_CASSD/README.rst similarity index 100% rename from plugins/Selectors_CASSD/README.rst rename to src/Selectors_CASSD/README.rst diff --git a/plugins/Selectors_CASSD/selectors.irp.f b/src/Selectors_CASSD/selectors.irp.f similarity index 100% rename from plugins/Selectors_CASSD/selectors.irp.f rename to src/Selectors_CASSD/selectors.irp.f diff --git a/plugins/Selectors_Utils/NEEDED_CHILDREN_MODULES b/src/Selectors_Utils/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Selectors_Utils/NEEDED_CHILDREN_MODULES rename to src/Selectors_Utils/NEEDED_CHILDREN_MODULES diff --git a/plugins/Selectors_Utils/README.rst b/src/Selectors_Utils/README.rst similarity index 100% rename from plugins/Selectors_Utils/README.rst rename to src/Selectors_Utils/README.rst diff --git a/plugins/Selectors_Utils/e_corr_selectors.irp.f b/src/Selectors_Utils/e_corr_selectors.irp.f similarity index 100% rename from plugins/Selectors_Utils/e_corr_selectors.irp.f rename to src/Selectors_Utils/e_corr_selectors.irp.f diff --git a/plugins/Selectors_Utils/selectors.irp.f b/src/Selectors_Utils/selectors.irp.f similarity index 100% rename from plugins/Selectors_Utils/selectors.irp.f rename to src/Selectors_Utils/selectors.irp.f diff --git a/plugins/Selectors_Utils/zmq.irp.f b/src/Selectors_Utils/zmq.irp.f similarity index 100% rename from plugins/Selectors_Utils/zmq.irp.f rename to src/Selectors_Utils/zmq.irp.f diff --git a/plugins/Selectors_full/NEEDED_CHILDREN_MODULES b/src/Selectors_full/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Selectors_full/NEEDED_CHILDREN_MODULES rename to src/Selectors_full/NEEDED_CHILDREN_MODULES diff --git a/plugins/Selectors_full/README.rst b/src/Selectors_full/README.rst similarity index 100% rename from plugins/Selectors_full/README.rst rename to src/Selectors_full/README.rst diff --git a/plugins/Selectors_full/selectors.irp.f b/src/Selectors_full/selectors.irp.f similarity index 100% rename from plugins/Selectors_full/selectors.irp.f rename to src/Selectors_full/selectors.irp.f diff --git a/plugins/Selectors_no_sorted/NEEDED_CHILDREN_MODULES b/src/Selectors_no_sorted/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/Selectors_no_sorted/NEEDED_CHILDREN_MODULES rename to src/Selectors_no_sorted/NEEDED_CHILDREN_MODULES diff --git a/plugins/Selectors_no_sorted/README.rst b/src/Selectors_no_sorted/README.rst similarity index 100% rename from plugins/Selectors_no_sorted/README.rst rename to src/Selectors_no_sorted/README.rst diff --git a/plugins/Selectors_no_sorted/selectors.irp.f b/src/Selectors_no_sorted/selectors.irp.f similarity index 100% rename from plugins/Selectors_no_sorted/selectors.irp.f rename to src/Selectors_no_sorted/selectors.irp.f diff --git a/plugins/SingleRefMethod/NEEDED_CHILDREN_MODULES b/src/SingleRefMethod/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/SingleRefMethod/NEEDED_CHILDREN_MODULES rename to src/SingleRefMethod/NEEDED_CHILDREN_MODULES diff --git a/plugins/SingleRefMethod/README.rst b/src/SingleRefMethod/README.rst similarity index 100% rename from plugins/SingleRefMethod/README.rst rename to src/SingleRefMethod/README.rst diff --git a/plugins/SingleRefMethod/generators.irp.f b/src/SingleRefMethod/generators.irp.f similarity index 100% rename from plugins/SingleRefMethod/generators.irp.f rename to src/SingleRefMethod/generators.irp.f diff --git a/src/Utils/tree_dependency.png b/src/Utils/tree_dependency.png deleted file mode 100644 index 38b04785..00000000 Binary files a/src/Utils/tree_dependency.png and /dev/null differ diff --git a/src/ZMQ/tree_dependency.png b/src/ZMQ/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/src/core_integrals/NEEDED_CHILDREN_MODULES b/src/core_integrals/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 2b19caa2..00000000 --- a/src/core_integrals/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -MO_one_e_integrals Integrals_Bielec Bitmask diff --git a/src/core_integrals/core_integrals.main.irp.f b/src/core_integrals/core_integrals.main.irp.f deleted file mode 100644 index f5e9fd1b..00000000 --- a/src/core_integrals/core_integrals.main.irp.f +++ /dev/null @@ -1,7 +0,0 @@ -program core_integrals - implicit none - BEGIN_DOC -! TODO - END_DOC - print*,'core energy = ',core_energy -end diff --git a/src/core_integrals/core_quantities.irp.f b/src/core_integrals/core_quantities.irp.f deleted file mode 100644 index a120cf78..00000000 --- a/src/core_integrals/core_quantities.irp.f +++ /dev/null @@ -1,35 +0,0 @@ -BEGIN_PROVIDER [double precision, core_energy] - implicit none - integer :: i,j,k,l - core_energy = 0.d0 - do i = 1, n_core_orb - j = list_core(i) - core_energy += 2.d0 * mo_mono_elec_integral(j,j) + mo_bielec_integral_jj(j,j) - do k = i+1, n_core_orb - l = list_core(k) - core_energy += 2.d0 * (2.d0 * mo_bielec_integral_jj(j,l) - mo_bielec_integral_jj_exchange(j,l)) - enddo - enddo - core_energy += nuclear_repulsion - -END_PROVIDER - -BEGIN_PROVIDER [double precision, core_fock_operator, (mo_tot_num,mo_tot_num)] - implicit none - integer :: i,j,k,l,m,n - double precision :: get_mo_bielec_integral - BEGIN_DOC -! this is the contribution to the Fock operator from the core electrons - END_DOC - core_fock_operator = 0.d0 - do i = 1, n_act_orb - j = list_act(i) - do k = 1, n_act_orb - l = list_act(k) - do m = 1, n_core_orb - n = list_core(m) - core_fock_operator(j,l) += 2.d0 * get_mo_bielec_integral(j,n,l,n,mo_integrals_map) - get_mo_bielec_integral(j,n,n,l,mo_integrals_map) - enddo - enddo - enddo -END_PROVIDER diff --git a/plugins/dress_zmq/EZFIO.cfg.example b/src/dress_zmq/EZFIO.cfg.example similarity index 100% rename from plugins/dress_zmq/EZFIO.cfg.example rename to src/dress_zmq/EZFIO.cfg.example diff --git a/plugins/dress_zmq/NEEDED_CHILDREN_MODULES b/src/dress_zmq/NEEDED_CHILDREN_MODULES similarity index 100% rename from plugins/dress_zmq/NEEDED_CHILDREN_MODULES rename to src/dress_zmq/NEEDED_CHILDREN_MODULES diff --git a/plugins/dress_zmq/README.rst b/src/dress_zmq/README.rst similarity index 100% rename from plugins/dress_zmq/README.rst rename to src/dress_zmq/README.rst diff --git a/plugins/dress_zmq/alpha_factory.irp.f b/src/dress_zmq/alpha_factory.irp.f similarity index 100% rename from plugins/dress_zmq/alpha_factory.irp.f rename to src/dress_zmq/alpha_factory.irp.f diff --git a/plugins/dress_zmq/dress_general.irp.f b/src/dress_zmq/dress_general.irp.f similarity index 100% rename from plugins/dress_zmq/dress_general.irp.f rename to src/dress_zmq/dress_general.irp.f diff --git a/plugins/dress_zmq/dress_slave.irp.f b/src/dress_zmq/dress_slave.irp.f similarity index 100% rename from plugins/dress_zmq/dress_slave.irp.f rename to src/dress_zmq/dress_slave.irp.f diff --git a/plugins/dress_zmq/dress_stoch_routines.irp.f b/src/dress_zmq/dress_stoch_routines.irp.f similarity index 100% rename from plugins/dress_zmq/dress_stoch_routines.irp.f rename to src/dress_zmq/dress_stoch_routines.irp.f diff --git a/plugins/dress_zmq/dress_zmq_routines.irp.f b/src/dress_zmq/dress_zmq_routines.irp.f similarity index 100% rename from plugins/dress_zmq/dress_zmq_routines.irp.f rename to src/dress_zmq/dress_zmq_routines.irp.f diff --git a/plugins/dress_zmq/dressing.irp.f b/src/dress_zmq/dressing.irp.f similarity index 100% rename from plugins/dress_zmq/dressing.irp.f rename to src/dress_zmq/dressing.irp.f diff --git a/plugins/dress_zmq/dressing_vector.irp.f b/src/dress_zmq/dressing_vector.irp.f similarity index 100% rename from plugins/dress_zmq/dressing_vector.irp.f rename to src/dress_zmq/dressing_vector.irp.f diff --git a/plugins/dress_zmq/energy.irp.f b/src/dress_zmq/energy.irp.f similarity index 100% rename from plugins/dress_zmq/energy.irp.f rename to src/dress_zmq/energy.irp.f diff --git a/plugins/dress_zmq/extra_functions.irp.f.example b/src/dress_zmq/extra_functions.irp.f.example similarity index 100% rename from plugins/dress_zmq/extra_functions.irp.f.example rename to src/dress_zmq/extra_functions.irp.f.example diff --git a/plugins/dress_zmq/run_dress_slave.irp.f b/src/dress_zmq/run_dress_slave.irp.f similarity index 100% rename from plugins/dress_zmq/run_dress_slave.irp.f rename to src/dress_zmq/run_dress_slave.irp.f