Source code for moyopy._base
from typing import Any
[docs]
class Cell:
def __init__(
self,
basis: list[list[float]],
positions: list[list[float]],
numbers: list[int],
): ...
@property
[docs]
def basis(self) -> list[list[float]]: ...
@property
[docs]
def positions(self) -> list[list[float]]: ...
@property
[docs]
def numbers(self) -> list[int]: ...
@property
[docs]
def num_atoms(self) -> int: ...
# Serialization and deserialization
[docs]
def serialize_json(self) -> str:
"""Serialize the cell to a JSON string"""
@classmethod
[docs]
def deserialize_json(cls, json_str: str) -> Cell:
"""Deserialize a JSON string to a Cell object"""
[docs]
def as_dict(self) -> dict[str, Any]:
"""Convert the cell to a dictionary"""
@classmethod
[docs]
def from_dict(cls, data: dict[str, Any]) -> Cell:
"""Create a cell from a dictionary"""
[docs]
class CollinearMagneticCell:
def __init__(
self,
basis: list[list[float]],
positions: list[list[float]],
numbers: list[int],
magnetic_moments: list[float],
): ...
@property
[docs]
def basis(self) -> list[list[float]]: ...
@property
[docs]
def positions(self) -> list[list[float]]: ...
@property
[docs]
def numbers(self) -> list[int]: ...
@property
[docs]
def magnetic_moments(self) -> list[float]: ...
@property
[docs]
def num_atoms(self) -> int: ...
# Serialization and deserialization
[docs]
def serialize_json(self) -> str:
"""Serialize the cell to a JSON string"""
@classmethod
[docs]
def deserialize_json(cls, json_str: str) -> Cell:
"""Deserialize a JSON string to a Cell object"""
[docs]
def as_dict(self) -> dict[str, Any]:
"""Convert the cell to a dictionary"""
@classmethod
[docs]
def from_dict(cls, data: dict[str, Any]) -> Cell:
"""Create a cell from a dictionary"""
[docs]
class NonCollinearMagneticCell:
def __init__(
self,
basis: list[list[float]],
positions: list[list[float]],
numbers: list[int],
magnetic_moments: list[list[float]],
): ...
@property
[docs]
def basis(self) -> list[list[float]]: ...
@property
[docs]
def positions(self) -> list[list[float]]: ...
@property
[docs]
def numbers(self) -> list[int]: ...
@property
[docs]
def magnetic_moments(self) -> list[list[float]]: ...
@property
[docs]
def num_atoms(self) -> int: ...
# Serialization and deserialization
[docs]
def serialize_json(self) -> str:
"""Serialize the cell to a JSON string"""
@classmethod
[docs]
def deserialize_json(cls, json_str: str) -> Cell:
"""Deserialize a JSON string to a Cell object"""
[docs]
def as_dict(self) -> dict[str, Any]:
"""Convert the cell to a dictionary"""
@classmethod
[docs]
def from_dict(cls, data: dict[str, Any]) -> Cell:
"""Create a cell from a dictionary"""
[docs]
class Operations:
@property
[docs]
def rotations(self) -> list[list[list[float]]]: ...
@property
[docs]
def translations(self) -> list[list[float]]: ...
@property
[docs]
def num_operations(self) -> int: ...
[docs]
def __len__(self) -> int: ...
[docs]
class MagneticOperations:
@property
[docs]
def rotations(self) -> list[list[list[float]]]: ...
@property
[docs]
def translations(self) -> list[list[float]]: ...
@property
[docs]
def time_reversals(self) -> list[bool]: ...
@property
[docs]
def num_operations(self) -> int: ...
[docs]
def __len__(self) -> int: ...