{"id":9585,"library":"clease","title":"CLuster Expansion in Atomistic Simulation Environment (clease)","description":"CLEASE (CLuster Expansion in Atomistic Simulation Environment) is a Python package for constructing and handling cluster expansion Hamiltonians for materials simulations, often used in conjunction with ASE. It is currently at version 1.2.0 and receives updates periodically, with the last major release in April 2024.","status":"active","version":"1.2.0","language":"en","source_language":"en","source_url":"https://github.com/clease/clease","tags":["materials science","physics","simulation","cluster expansion","ASE","density functional theory"],"install":[{"cmd":"pip install clease","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Numerical operations and array handling.","package":"numpy","optional":false},{"reason":"Scientific computing routines.","package":"scipy","optional":false},{"reason":"Data structures and analysis.","package":"pandas","optional":false},{"reason":"Reading and writing HDF5 files for cluster expansion data.","package":"h5py","optional":false},{"reason":"Serialization of Python objects.","package":"dill","optional":false},{"reason":"Atomistic Simulation Environment, commonly used for defining structures and interacting with CLEASE.","package":"ase","optional":true}],"imports":[{"note":"CEConfig was renamed to CEBulk in v1.1.0.","wrong":"from clease import CEConfig","symbol":"CEBulk","correct":"from clease import CEBulk"},{"note":"CESlab was renamed to CEPrism in v1.1.0.","wrong":"from clease import CESlab","symbol":"CEPrism","correct":"from clease import CEPrism"},{"symbol":"Settings","correct":"from clease import Settings"},{"symbol":"Concentration","correct":"from clease import Concentration"}],"quickstart":{"code":"from ase.build import bulk\nfrom clease import CEBulk, Concentration, Settings\n\n# 1. Define primitive cell using ASE\nprim = bulk(\"Cu\", \"fcc\", a=3.61)\n\n# 2. Define concentration for a binary system (e.g., Cu-Au)\nconc = Concentration(basis_elements=[[\"Cu\", \"Au\"]])\n\n# 3. Define settings for the cluster expansion\nsettings = Settings(\n    primitive_structure=prim,\n    supercell=[2, 2, 2], # Supercell dimensions for mapping\n    concentrations=[conc],\n    max_cluster_dia=[3.0, 4.0, 5.0] # Max diameter for 2-body, 3-body, 4-body clusters\n)\n\n# 4. Initialize the Cluster Expansion Bulk object\nce_bulk = CEBulk(settings, verbose=False)\n\nprint(f\"CEBulk object initialized for {ce_bulk.name}\")\n# Further steps involve fitting and predicting properties.\n","lang":"python","description":"Initializes a basic Cluster Expansion Bulk (CEBulk) object using an ASE primitive cell, defines concentrations, and sets up the cluster expansion parameters."},"warnings":[{"fix":"Update your imports and class instantiations: `CEConfig(...)` becomes `CEBulk(...)` and `CESlab(...)` becomes `CEPrism(...)`.","message":"The main classes `CEConfig` and `CESlab` were renamed to `CEBulk` and `CEPrism` respectively.","severity":"breaking","affected_versions":">=1.1.0"},{"fix":"For SQS generation, migrate to the dedicated `sqsgenerator` library, which CLEASE now recommends as an external dependency.","message":"The `clease.sqs` module, which provided functionality for generating Special Quasirandom Structures, has been removed.","severity":"breaking","affected_versions":">=1.2.0"},{"fix":"Pass `max_cluster_dia` as a list, e.g., `max_cluster_dia=[3.0, 4.0, 5.0]` for 2-body, 3-body, and 4-body clusters respectively.","message":"The `max_cluster_dia` parameter in `clease.Settings` expects a list of floats (one for each cluster order), not a single float.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Replace `CEConfig` with `CEBulk`. For slab calculations, `CESlab` was renamed to `CEPrism`.","cause":"Using the old class name 'CEConfig' which was renamed in clease v1.1.0.","error":"NameError: name 'CEConfig' is not defined"},{"fix":"Install and use the `sqsgenerator` library directly for SQS functionality, as it is no longer integrated into `clease`.","cause":"Attempting to use the `clease.sqs` module, which was removed in clease v1.2.0.","error":"AttributeError: module 'clease' has no attribute 'sqs'"},{"fix":"Ensure `max_cluster_dia` is a list, e.g., `Settings(max_cluster_dia=[3.0, 4.0, 5.0])`.","cause":"Providing a single float value to `Settings(max_cluster_dia=...)` instead of a list.","error":"TypeError: 'float' object is not iterable"}]}