{"id":17043515,"url":"https://github.com/rhsimplex/tetpack","last_synced_at":"2025-03-23T02:24:10.750Z","repository":{"id":19765904,"uuid":"23023826","full_name":"rhsimplex/tetpack","owner":"rhsimplex","description":"Packing tetrahedra based on tcp chemical structures","archived":false,"fork":false,"pushed_at":"2014-09-05T15:49:25.000Z","size":1668,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T05:27:24.313Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhsimplex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-16T17:55:20.000Z","updated_at":"2022-09-25T15:17:32.000Z","dependencies_parsed_at":"2022-08-21T14:01:09.557Z","dependency_job_id":null,"html_url":"https://github.com/rhsimplex/tetpack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhsimplex%2Ftetpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhsimplex%2Ftetpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhsimplex%2Ftetpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhsimplex%2Ftetpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhsimplex","download_url":"https://codeload.github.com/rhsimplex/tetpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245045768,"owners_count":20552082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-14T09:29:45.350Z","updated_at":"2025-03-23T02:24:10.675Z","avatar_url":"https://github.com/rhsimplex.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"tetpack\n=======\n\nPacking tetrahedra based on tetrahedrally-close-packed (TCP) chemical structures\n\nThis program attempts to pack tetrahdra starting from real solid-state structures. The algorithm is roughly as follows:\n\n1. Starting from a real structure, add tetrahedra to the tetrahedral voids (subject to some regularity constraint).  Expand structure.\n2. Use Ewald summation to relax structure.  Tetrahedra orientations are preserved, but pushed apart.\n3. Compress cell axes by small fixed percentage.\n4. Check for collisions.\n5. If there are collisions, attempt to resolve by randomly walking the tetrahedron in configuration space for N steps (six degrees of freedom: three translational, three rotational).\n6. If collisions cannot be resolved, relax structure -- increase cell axes and relax via Ewald summation. Change parameters according to some temperature profile.\n7. Go to step 4.\n\nCurrently, this algorithm hits a wall around 14% packing density (see https://github.com/rhsimplex/tetpack/blob/master/tetpack_results.pdf?raw=true ).  A number of possible improvements are described at the end of this document.\n\n=======\nInstallation and running:\n\nYou will need the pymatgen library (http://pymatgen.org) installed.  Clone this repository. You should be able to run the tetrahedra extraction and collision function on the default structure (Cu5Zn8) with:\n```\n$ python compression.py\n```\nOr if you prefer to run in ipython:\n```\nIn[1]: import compression\nIn[2]: compression.main()\n```\nThe compression script runs indefinitely. Resolved packings will be output into a subdirectory named after the original structure (.cif and .csv).\n\nThree structures are included (in pymatgen .mson format):\n* mp-1368.mson -- Cu5Zn8 \"cell-centered packing\"\n* mp-196.mson -- Al5Co2 \"face-centered packing\"\n* mp-30784.mson -- Mg2Zn11 \"vertex-centered packing\"\n* (Missing: edge-centered packing)\n\nTo run with an alternative structure use, e.g.:\n```\n$ python compression.py mp-196.mson\n```\nor in ipython:\n```\nIn[1]: compression.main('mp-196.mson')\n```\n\nMore sophisticated command-line arguments are not implemented yet.  You can do some other things (e.g. different temperature profiles) by calling the main method directly. From ipython:\n```\nIn[1]: import compression\nIn[2]: compression.main('random_AlCo.mson', beta=1.0, initial_temp = 0.5, precomputed_structure = True)\n```\nStarts with the 'random_AlCo' file, which is 24 tetrahedra randomly uniformly distributed in the Al5Co2 unit cell.  The algorithm 'cools' according to \n```\nT = initial_temp * exp(-beta*phi)  \n```\nwhere phi is the current packing fraction.\n\n=======\nMissing Features/Future improvements:\n\n1. Cell axes/angles cannot vary freely in this implementation, but only for simplicity.  Since symmetry is immediately broken by tetrahedra moving around, axes/angles ought to be able to move freely.\n2. Compression could be more Metropolis-like: any configuration resulting in collisions is currently rejected, but could be accepted with some probability related to the packing density change.\n3. Supercells.  The current best tetrahedral packings are non-periodic.\n5. ...\n\n=======\nAttributions:\n\n1. Starting from real TCP crystal structures was inspired by my own thesis research (https://www.dropbox.com/s/vte7zpx59gaqdme/thesis.pdf?dl=0).\n2. This program relies heavily on the pymatgen (http://pymatgen.org) library, and the initial structures were pulled from the Materials Project (http://materialsproject.org).\n3. rotation_matrix.py is part of the relax package written by Edward d'Auvergne.\n4. ewald.py is part of pymatgen but not included with the default build, so it's included separately here. Written by Shyue Ping Ong and William Davidson Richard.\n5. The tetrahedra collision detection is based on the triangle intersection algorithm of Devillers and Guigue  (http://hal.archives-ouvertes.fr/docs/00/07/21/00/PDF/RR-4488.pdf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhsimplex%2Ftetpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhsimplex%2Ftetpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhsimplex%2Ftetpack/lists"}