{"id":24897209,"url":"https://github.com/deepmodeling/openlam","last_synced_at":"2025-10-16T11:31:22.783Z","repository":{"id":235091838,"uuid":"790034807","full_name":"deepmodeling/openlam","owner":"deepmodeling","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-10T03:36:17.000Z","size":31,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-09T02:03:27.802Z","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":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepmodeling.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-22T06:31:11.000Z","updated_at":"2025-04-02T12:45:38.000Z","dependencies_parsed_at":"2024-05-22T08:44:49.046Z","dependency_job_id":"885e5a72-bbe9-465f-9403-e7b1d0a5553a","html_url":"https://github.com/deepmodeling/openlam","commit_stats":null,"previous_names":["deepmodeling/openlam"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deepmodeling/openlam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmodeling%2Fopenlam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmodeling%2Fopenlam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmodeling%2Fopenlam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmodeling%2Fopenlam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepmodeling","download_url":"https://codeload.github.com/deepmodeling/openlam/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepmodeling%2Fopenlam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279183685,"owners_count":26121447,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-02-01T20:16:57.469Z","updated_at":"2025-10-16T11:31:22.777Z","avatar_url":"https://github.com/deepmodeling.png","language":"Python","funding_links":[],"categories":["Community resources"],"sub_categories":[],"readme":"# A crystal structure optimization tool built on top of ASE\n\n## Installation\n\nAfter cloning this project, install `lam-crystal-philately` with common dependencies (including requirements for workflows) by\n```\npip install .\n```\nTo install additional dependencies for DP\n```\npip install \".[dp]\"\n```\nor mace\n```\npip install \".[mace]\"\n```\n\nDownload the latest DP model for structure optimization by\n```\nwget https://bohrium-api.dp.tech/ds-dl/lam-crystal-model-01oe-v4.zip\nunzip lam-crystal-model-01oe-v4.zip\n```\n\n\n## Structure Optimization\n\n### Python API\n\n```\nfrom pathlib import Path\nfrom lam_optimize.main import relax_run\nfrom lam_optimize.relaxer import Relaxer\n\ncif_folder_path = Path(\"/cifs\")\nrelaxer = Relaxer(\"mace\") # using default mace model\n# relaxer = Relaxer(Path(\"dp.pth\")) # using DP model\nres_df = relax_run(\n    cif_folder_path,\n    relaxer\n)\n```\n\nYou should see something similar to this:\n\n\u003cimg width=\"429\" alt=\"image\" src=\"https://github.com/deepmodeling/lam-crystal-philately/assets/137014849/0e652ec3-aa8d-4332-b90a-c3fb13c081ff\"\u003e\n\nThe resulting dataframe should contain the following columns:\n\n\u003cimg width=\"539\" alt=\"image\" src=\"https://github.com/deepmodeling/lam-crystal-philately/assets/137014849/f3be0bbf-ff85-4d27-92b2-46ba81e9c5c2\"\u003e\n\nTo get the optimized structure (if converged), do the following:\n\n```\nfrom pymatgen.core import Structure\n\nStructure.from_dict(df['final_structure'][0])\n```\n\n### Commandline tool\n\nTo optimize structures using DP model\n```\nlam-opt relax -i examples/data -m \u003cpath-to-DP-model\u003e\n```\nor using mace\n```\nlam-opt relax -i examples/data -t mace\n```\n\nTo submit a workflow for optimizing structures on parallel\n```\nlam-opt submit examples/wf.json -i part0 part1 -m \u003cpath-to-DP-model\u003e\n```\nwhere the arguments after `-i` should be a list of directories containing cifs.\n\n## Single Point Evaluation\n\n```\nfrom lam_optimize.main import single_point\n\nsingle_point(Path(fpth), relaxer)\n\n```\nThis returns the potential energy and forces for a given `.cif` structure.\n\n\u003cimg width=\"568\" alt=\"image\" src=\"https://github.com/deepmodeling/lam-crystal-philately/assets/137014849/6917528d-7e2a-4dc0-a49a-a87825983fba\"\u003e\n\n\n## Query crystal structures from OpenLAM Database\n\nSet environmental variable `BOHRIUM_ACCESS_KEY` which is generated from https://bohrium.dp.tech/settings/user\n```\nexport BOHRIUM_ACCESS_KEY=xxx\n```\nQuery crystal structures from OpenLAM Database using Python API (The method `query_by_page` is deprecated! Use `query_by_offset` instead.)\n```python\nfrom lam_optimize import CrystalStructure\ndata = CrystalStructure.query_by_offset()\n```\nThe method `query_by_offset` accept following arguments as query conditions\n```python\nformula: Optional[str] = None\nmin_energy: Optional[float] = None\nmax_energy: Optional[float] = None\nmin_submission_time: Optional[datetime.datetime] = None\nmax_submission_time: Optional[datetime.datetime] = None\noffset: int = 0\nlimit: int = 10\n```\nThe structure of the returned data is like\n```\n{'nextStartId': 18, 'items': [\u003clam_optimize.db.CrystalStructure object at 0x7fbd6832e520\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d04aaf0\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d11c610\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d11cd60\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d21a130\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d21a4c0\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d21a850\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d21abe0\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d21af70\u003e, \u003clam_optimize.db.CrystalStructure object at 0x7fbd6d21d340\u003e]}\n```\nExcept for `nextStartId` (used as `offset` in the next query), `items` is a list of `CrystalStructure` objects\n```python\nclass CrystalStructure:\n    formula: str\n    structure: pymatgen.core.Structure\n    energy: float\n    submission_time: datetime.datetime\n```\n\nThe method `query` merging paged results is also provided\n```python\nstructures = CrystalStructure.query(formula=\"Sr2YSbO6\")\n```\nwhich returns a list of `CrystalStructure` objects.\n\nNOTE: Calling non-paging method without query condition will be extremely slow.\n\n## Query hull from OpenLAM Database\n\nSet environmental variable `BOHRIUM_ACCESS_KEY` which is generated from https://bohrium.dp.tech/settings/user\n```\nexport BOHRIUM_ACCESS_KEY=xxx\n```\nQuery hull by composition from OpenLAM Database using Python API\n```python\nfrom lam_optimize.utils import query_hull_by_composition\nhull = query_hull_by_composition([\"Ac\", \"Ag\", \"Bi\", \"As\", \"Rh\", \"Cl\", \"O\"])\n```\nYou can calculate energy above hull using the hull\n```python\nfrom lam_optimize.utils import get_e_above_hull\nehull = get_e_above_hull(structure, hull, 0.123)\n```\nTo refer to OpenLAM Database in a publication, please cite the [preprint](https://arxiv.org/abs/2501.16358):\n\u003e Anyang Peng, Xinzijian Liu, Ming-Yu Guo, Linfeng Zhang, Han Wang. \"The OpenLAM Challenges.\" arXiv, January 20, 2025. https://doi.org/10.48550/arXiv.2501.16358.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepmodeling%2Fopenlam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepmodeling%2Fopenlam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepmodeling%2Fopenlam/lists"}