{"id":32177219,"url":"https://github.com/singroup/pycp2k","last_synced_at":"2026-02-24T04:02:42.718Z","repository":{"id":44799100,"uuid":"27869355","full_name":"SINGROUP/pycp2k","owner":"SINGROUP","description":"Python Cp2k interface","archived":false,"fork":false,"pushed_at":"2022-06-07T17:15:56.000Z","size":41167,"stargazers_count":99,"open_issues_count":4,"forks_count":31,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-11-22T20:17:07.113Z","etag":null,"topics":["cp2k","python","python-interface"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SINGROUP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-11T11:55:37.000Z","updated_at":"2025-10-26T12:18:15.000Z","dependencies_parsed_at":"2022-09-19T05:11:14.556Z","dependency_job_id":null,"html_url":"https://github.com/SINGROUP/pycp2k","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SINGROUP/pycp2k","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SINGROUP%2Fpycp2k","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SINGROUP%2Fpycp2k/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SINGROUP%2Fpycp2k/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SINGROUP%2Fpycp2k/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SINGROUP","download_url":"https://codeload.github.com/SINGROUP/pycp2k/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SINGROUP%2Fpycp2k/sbom","scorecard":{"id":124091,"data":{"date":"2025-08-11","repo":{"name":"github.com/SINGROUP/pycp2k","commit":"2e0449e5253836d45b2771e75fbb54ce0298db26"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 4/17 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T03:17:43.841Z","repository_id":44799100,"created_at":"2025-08-16T03:17:43.842Z","updated_at":"2025-08-16T03:17:43.842Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29771046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:01:02.180Z","status":"ssl_error","status_checked_at":"2026-02-24T03:59:49.901Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cp2k","python","python-interface"],"created_at":"2025-10-21T20:01:48.565Z","updated_at":"2026-02-24T04:02:42.713Z","avatar_url":"https://github.com/SINGROUP.png","language":"Python","readme":"PYCP2K: a python interface to CP2K\n==================================================\n\n1. [Introduction](#introduction)\n2. [Example](#example)\n3. [Installation through pip](#pip)\n3. [Manual installation](#manual)\n4. [Installation on HPC](#triton)\n5. [Implementation Notes](#notes)\n6. [Contact](#contact)\n\n\u003ca name=\"introduction\"\u003e\u003c/a\u003e\n1\\. Introduction\n--------------------------------------------------\n\nPYCP2K is a python package providing a dynamic object-oriented interface to\n[CP2K](http://www.cp2k.org/), an atomistic and molecular simulation software.\n\nPYCP2K allows the user to create and run entire CP2K simulations with python\nscripts. The simulation parameters can be dynamically created and altered\nthanks to an *object tree* that replaces the traditional CP2K input scripts.\n\nThe benefits of using PYCP2K over using the traditional CP2K input files:\n- Use python data structures and algorithms to create and modify the input\n- Create and run CP2K simulations with one python script.\n- Modular simulation setup by e.g. using functions to create parts of the input\n- Structure creation and loading with [ASE](https://wiki.fysik.dtu.dk/ase/)\n- Autocompletion if provided by your IDE (tested with VIM plugin\n  [YouCompleteMe](https://valloric.github.io/YouCompleteMe/) and the\n  [Spyder](https://code.google.com/p/spyderlib/) IDE)\n- There are lots of python libraries (numpy, scipy, matplotlib, etc.) to also\n  analyze the results - all with python.\n\nTechnically the interfacing to CP2K happens simply by writing CP2K input files\nand reading the output files. There is no direct interface to the fortran code.\n\n\u003cimg src=\"https://raw.githubusercontent.com/SINGROUP/pycp2k/master/example.gif\"\u003e\u003c/img\u003e\n\n\u003ca name=\"example\"\u003e\u003c/a\u003e\n2\\. Example\n--------------------------------------------------\nAn example script that calculates the energy and forces in a silicon lattice\nusing DFT. To see a fully documented version of this example and other\nexamples, look at the examples folder.\n```python\n    from pycp2k import CP2K\n    from ase.lattice.cubic import Diamond\n\n    #====================== Create the structure with ASE ==========================\n    lattice = Diamond(directions=[[1, 0, 0], [0, 1, 0], [0, 0, 1]],\n                    symbol='Si',\n                    latticeconstant=5.430697500,\n                    size=(1, 1, 1))\n\n    #================= Define and setup the calculator object ======================\n    calc = CP2K()\n    calc.working_directory = \"./\"\n    calc.project_name = \"si_bulk\"\n    calc.mpi_n_processes = 2\n\n    #================= An existing input file can be parsed  =======================\n    calc.parse(\"template.in\")\n\n    #==================== Define shortcuts for easy access =========================\n    CP2K_INPUT = calc.CP2K_INPUT\n    GLOBAL = CP2K_INPUT.GLOBAL\n    FORCE_EVAL = CP2K_INPUT.FORCE_EVAL_add()  # Repeatable items have to be first created\n    SUBSYS = FORCE_EVAL.SUBSYS\n    DFT = FORCE_EVAL.DFT\n    SCF = DFT.SCF\n\n    #======================= Write the simulation input ============================\n    GLOBAL.Run_type = \"ENERGY_FORCE\"\n    FORCE_EVAL.Method = \"Quickstep\"\n    FORCE_EVAL.PRINT.FORCES.Section_parameters = \"ON\"\n    DFT.Basis_set_file_name = \"BASIS_SET\"\n    DFT.Potential_file_name = \"GTH_POTENTIALS\"\n    DFT.QS.Eps_default = 1.0E-10\n    DFT.MGRID.Ngrids = 4\n    DFT.MGRID.Cutoff = 300\n    DFT.MGRID.Rel_cutoff = 60\n    DFT.XC.XC_FUNCTIONAL.Section_parameters = \"PADE\"\n    SCF.Scf_guess = \"ATOMIC\"\n    SCF.Eps_scf = 1.0E-7\n    SCF.Max_scf = 300\n    SCF.DIAGONALIZATION.Section_parameters = \"ON\"\n    SCF.DIAGONALIZATION.Algorithm = \"STANDARD\"\n    SCF.MIXING.Section_parameters = \"T\"\n    SCF.MIXING.Method = \"BROYDEN_MIXING\"\n    SCF.MIXING.Alpha = 0.4\n    SCF.MIXING.Nbroyden = 8\n    KIND = SUBSYS.KIND_add(\"Si\")  # Section_parameters can be provided as argument.\n    KIND.Basis_set = \"DZVP-GTH-PADE\"\n    KIND.Potential = \"GTH-PADE-q4\"\n    calc.create_cell(SUBSYS, lattice)\n    calc.create_coord(SUBSYS, lattice)\n\n    #============ Run the simulation or just write the input file ================\n    calc.write_input_file()\n    calc.run()\n```\n\n\u003ca name=\"pip\"\u003e\u003c/a\u003e\n3\\. Installation through pip\n--------------------------------------------------\n\nThere is a default implementation available which does not require any user input.\nCP2K version 5.1 is assumed (it should work with most other versions). The cp2k executable\nis called *cp2k.popt* and no mpi-command is given. If you want to change the\nname of the executable and the mpi-command, please modify pycp2k/config.py.\n\nOtherwise, the installation is as easy as:\n\n```python\npip install pycp2k\n```\n\nIf version 5.1 does not work for you, we recommend a manual installation (see\nbelow).\n\n\n\u003ca name=\"manual\"\u003e\u003c/a\u003e\n4\\. Manual installation\n--------------------------------------------------\nThese installation instructions were tested on Ubuntu 16.04 x64:\n\n1. Pull this repository to any location on your computer:\n\n   ```\n   git clone --depth 1 https://github.com/SINGROUP/pycp2k.git\n   ```\n\n2. The correct input structure is created from the .xml file that can be\n   created by calling the CP2K executable with flag --xml. During the setup you\n   will have the option of creating the .xml file by using a CP2K executable on\n   your computer, or by using a pre-existing .xml file. The .xml files may\n   differ between CP2K versions, and if you change CP2K version or update\n   pycp2k, you may need to rerun this installation. When doing a reinstall, it\n   is best to remove the old class hiearchy by deleting the folder\n   *pycp2k/pycp2k/classes*.\n\n3. Install the package by running the setup script in terminal. During setup\n   you will be asked how you want to create the input structure (using\n   executable or existing xml file) and what should the default CP2K and MPI\n   commands be. For setup use (use the *--user* flag when necessary to avoid\n   issues with root access):\n\n   ```\n   python setup_manual.py install\n   ```\n\n\u003ca name=\"triton\"\u003e\u003c/a\u003e\n5\\. Installation on HPC\n--------------------------------------------------\n\nThese instructions were made for and tested on Triton, the computing cluster at\nAalto University, but they should be extensible to any other computer cluster\nwith the appropriate changes.\n\n1. Installation:\n   1. Load the modules required for installation. If you use the default CP2K\n      version, you must load the module containing CP2K, because the cp2k\n      executable is called during installation (if you don't use an existing\n      xml file). Python \u003e= 2.7.6 should also be loaded.  If on the other hand\n      you plan on using your custom compiled version, remember to have it in\n      you path.\n\n   2. Clone this repository to somewhere in your work directory:\n\n      ```\n      git clone --depth 1 https://github.com/SINGROUP/pycp2k.git\n      ```\n\n   3. Install the package locally with (use the *--user* flag when necessary to\n      avoid issues with root access):\n\n      ```\n      python setup_manual.py install\n      ```\n\n      If you loaded the cp2k module you should be able to create the input\n      structure from the cp2k executable. When the setup asks for default MPI\n      executable provide choose either *srun --mpi=openmpi* or *srun\n      --mpi=pmi2* depending on which MPI library you're using.\n\n\n\u003ca name=\"notes\"\u003e\u003c/a\u003e\n6\\. Implementation Notes\n--------------------------------------------------\n\n1. All section names are in uppercase to prevent clashes with python keywords\n   (global, print, etc.)\n2. The keyword names are capitalized. This is in order to avoid clashing with\n   subsection names (yes, a section may have a keyword and a subsection with\n   the same name) and python keywords.\n3. Section and keyword names 'X' that start with a numeric value have been\n   renamed to 'NUMX'. This is because python doesn't support variable names\n   which start with numbers\n4. Section and keyword names which include the plus sign '+' have been renamed\n   so that it is replaced with 'PLUS'. This is because python doesn't allow the\n   plus sign within variable names.\n5. Section and keyword names which include the minus/hyphen sign '-' have been\n   renamed so that it is replaced wih '_'. This is because python doesn't allow\n   the minus/hyphen sign within variable names.\n6. All the repeatable sections X have to be added with a function 'X\\_add()'.\n   This function returns a reference to the newly created object which you\n   should store into a new variable for later access. Optionally you can\n   provide the 'Section\\_parameters' as an argument to this function. The list\n   of the repeatable sections can be accessed from attribute 'X\\_list'.\n7. You can use aliases and even use several aliases for the same item in the\n   scripts. However, the default name will be used in the input file.\n\n\u003ca name=\"contact\"\u003e\u003c/a\u003e\n7\\. Contact\n--------------------------------------------------\nIf you have any issues, or general questions regarding the package, please use\ngithub's issue system. Just simply open a new issue and put your message there.\nThis way the discussion is open for other users, and may also help them in any\npossible problems.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingroup%2Fpycp2k","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsingroup%2Fpycp2k","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsingroup%2Fpycp2k/lists"}