aiida_cif2j.data.exchange_coupling module¶
AiiDA Data node for TB2J isotropic exchange-coupling parameters.
- aiida_cif2j.data.exchange_coupling.ANISOTROPIC_EXCHANGE_UNITS = {'J_tensor': 'meV', 'distance': 'Ang', 'distance_vector': 'Ang'}¶
Units for AnisotropicExchangeData’s stored arrays.
- class aiida_cif2j.data.exchange_coupling.AnisotropicExchangeData(arrays: Iterable | dict[str, Iterable] | None = None, **kwargs)¶
Bases:
ArrayDataOne row per magnetic-site-pair entry in a TB2J run’s Jani_dict.
Only produced when TB2J computed anisotropic exchange for the run (Jani_dict is not None); Jani_dict may cover a different set of pairs than exchange_Jdict, so this is built from its own keys, not ExchangeCouplingData’s.
Stored arrays (all length n_pairs, except R/distance_vector which are (n_pairs, 3), and J_tensor which is (n_pairs, 3, 3)):
site_i, site_j: 0-based magnetic-site indices of the pair.
R: the lattice-translation vector TB2J associates with this coupling.
distance: scalar distance between the two sites, in Angstrom.
distance_vector: cartesian vector from site i to site j, in Angstrom.
J_tensor: the anisotropic exchange tensor, in meV.
- class AttributesModel(**data: Any)¶
Bases:
AttributesModel- model_config = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'json_schema_extra': {'patternProperties': {'^array\\|[A-Za-z0-9_]+$': {'description': 'Shape of an array stored in the repository', 'items': {'type': 'integer'}, 'minItems': 1, 'readOnly': True, 'type': 'array'}}}, 'serialize_by_alias': True, 'title': 'AnisotropicExchangeDataAttributesModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- class ReadModel(**data: Any)¶
Bases:
ReadModel- attributes: AttributesModel¶
- model_config = {'defer_build': True, 'extra': 'forbid', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'serialize_by_alias': True, 'title': 'AnisotropicExchangeDataReadModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- node_type: Literal['data.cif2j.anisotropic_exchange.AnisotropicExchangeData.']¶
- class WriteModel(**data: Any)¶
Bases:
WriteModel- attributes: AttributesWriteModel¶
- description: str¶
- extras: dict[str, Any]¶
- label: str¶
- model_config = {'defer_build': True, 'extra': 'forbid', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'serialize_by_alias': True, 'title': 'AnisotropicExchangeDataWriteModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- node_type: Literal['data.cif2j.anisotropic_exchange.AnisotropicExchangeData.']¶
- repository_metadata: dict[str, Any]¶
- fields = {'attributes': "QbAttributesField('attributes', dtype=<class 'aiida_cif2j.data.exchange_coupling.AnisotropicExchangeData.AttributesModel'>, doc='The node attributes')", 'computer': "QbNumericField('computer', dtype=int | None, doc='The PK of the computer')", 'ctime': "QbNumericField('ctime', dtype=<class 'datetime.datetime'>, doc='The creation time of the node')", 'description': "QbStrField('description', dtype=<class 'str'>, doc='The node description')", 'extras': "QbDictField('extras', dtype=dict[str, typing.Any], doc='The node extras')", 'label': "QbStrField('label', dtype=<class 'str'>, doc='The node label')", 'mtime': "QbNumericField('mtime', dtype=<class 'datetime.datetime'>, doc='The modification time of the node')", 'node_type': "QbStrField('node_type', dtype=typing.Literal['data.cif2j.anisotropic_exchange.AnisotropicExchangeData.'], doc='The type of the node.')", 'pk': "QbNumericField('pk', dtype=<class 'int'>, doc='The primary key of the entity')", 'process_type': "QbStrField('process_type', dtype=str | None, doc='The process type of the node')", 'repository_metadata': "QbDictField('repository_metadata', dtype=dict[str, typing.Any], doc='Virtual hierarchy of the file repository')", 'source': "QbDictField('attributes.source', dtype=dict | None, doc='Source of the data')", 'user': "QbNumericField('user', dtype=<class 'int'>, doc='The PK of the user who owns the node')", 'uuid': "QbStrField('uuid', dtype=<class 'uuid.UUID'>, doc='The UUID of the node')"}¶
- class aiida_cif2j.data.exchange_coupling.DMIVectorData(arrays: Iterable | dict[str, Iterable] | None = None, **kwargs)¶
Bases:
ArrayDataOne row per magnetic-site-pair entry in a TB2J run’s dmi_ddict.
Only produced when TB2J computed Dzyaloshinskii-Moriya interactions for the run (dmi_ddict is not None); dmi_ddict may cover a different set of pairs than exchange_Jdict, so this is built from its own keys, not ExchangeCouplingData’s.
Stored arrays (all length n_pairs, except R/distance_vector/ dmi_vector which are (n_pairs, 3)):
site_i, site_j: 0-based magnetic-site indices of the pair.
R: the lattice-translation vector TB2J associates with this coupling.
distance: scalar distance between the two sites, in Angstrom.
distance_vector: cartesian vector from site i to site j, in Angstrom.
dmi_vector: the DMI vector (Dx, Dy, Dz), in meV.
- class AttributesModel(**data: Any)¶
Bases:
AttributesModel- model_config = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'json_schema_extra': {'patternProperties': {'^array\\|[A-Za-z0-9_]+$': {'description': 'Shape of an array stored in the repository', 'items': {'type': 'integer'}, 'minItems': 1, 'readOnly': True, 'type': 'array'}}}, 'serialize_by_alias': True, 'title': 'DMIVectorDataAttributesModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- class ReadModel(**data: Any)¶
Bases:
ReadModel- attributes: AttributesModel¶
- model_config = {'defer_build': True, 'extra': 'forbid', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'serialize_by_alias': True, 'title': 'DMIVectorDataReadModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- node_type: Literal['data.cif2j.dmi_vectors.DMIVectorData.']¶
- class WriteModel(**data: Any)¶
Bases:
WriteModel- attributes: AttributesWriteModel¶
- description: str¶
- extras: dict[str, Any]¶
- label: str¶
- model_config = {'defer_build': True, 'extra': 'forbid', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'serialize_by_alias': True, 'title': 'DMIVectorDataWriteModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- node_type: Literal['data.cif2j.dmi_vectors.DMIVectorData.']¶
- repository_metadata: dict[str, Any]¶
- fields = {'attributes': "QbAttributesField('attributes', dtype=<class 'aiida_cif2j.data.exchange_coupling.DMIVectorData.AttributesModel'>, doc='The node attributes')", 'computer': "QbNumericField('computer', dtype=int | None, doc='The PK of the computer')", 'ctime': "QbNumericField('ctime', dtype=<class 'datetime.datetime'>, doc='The creation time of the node')", 'description': "QbStrField('description', dtype=<class 'str'>, doc='The node description')", 'extras': "QbDictField('extras', dtype=dict[str, typing.Any], doc='The node extras')", 'label': "QbStrField('label', dtype=<class 'str'>, doc='The node label')", 'mtime': "QbNumericField('mtime', dtype=<class 'datetime.datetime'>, doc='The modification time of the node')", 'node_type': "QbStrField('node_type', dtype=typing.Literal['data.cif2j.dmi_vectors.DMIVectorData.'], doc='The type of the node.')", 'pk': "QbNumericField('pk', dtype=<class 'int'>, doc='The primary key of the entity')", 'process_type': "QbStrField('process_type', dtype=str | None, doc='The process type of the node')", 'repository_metadata': "QbDictField('repository_metadata', dtype=dict[str, typing.Any], doc='Virtual hierarchy of the file repository')", 'source': "QbDictField('attributes.source', dtype=dict | None, doc='Source of the data')", 'user': "QbNumericField('user', dtype=<class 'int'>, doc='The PK of the user who owns the node')", 'uuid': "QbStrField('uuid', dtype=<class 'uuid.UUID'>, doc='The UUID of the node')"}¶
- aiida_cif2j.data.exchange_coupling.DMI_UNITS = {'distance': 'Ang', 'distance_vector': 'Ang', 'dmi_vector': 'meV'}¶
Units for DMIVectorData’s stored arrays.
- class aiida_cif2j.data.exchange_coupling.ExchangeCouplingData(arrays: Iterable | dict[str, Iterable] | None = None, **kwargs)¶
Bases:
ArrayDataOne row per physical magnetic-site pair, from a TB2J run’s exchange_Jdict.
Unlike DMIVectorData/AnisotropicExchangeData (and unlike TB2J’s own exchange.out, which double-counts every bond once from each site’s perspective), TB2JParser deduplicates exchange_Jdict’s mirrored (R, i, j)/(-R, j, i) pairs before building this node - see aiida_cif2j.parsers.tb2j._deduplicate_mirrored_pairs. This is safe only because J_iso is a scalar with J_ij == J_ji; DMI/anisotropic exchange are antisymmetric/tensor-valued and are kept TB2J-faithful instead.
Stored arrays (all length n_pairs, except R/distance_vector which are (n_pairs, 3)):
site_i, site_j: 0-based magnetic-site indices of the pair, in whichever of the two mirrored directions TB2J’s exchange_Jdict happened to list first - the other direction’s (R, i, j) is equivalent and not stored separately.
R: the lattice-translation vector TB2J associates with this coupling.
distance: scalar distance between the two sites, in Angstrom.
distance_vector: cartesian vector from site i to site j, in Angstrom.
J_iso: isotropic exchange coupling, in meV - averaged over both mirrored directions’ values (see _deduplicate_mirrored_pairs).
- class AttributesModel(**data: Any)¶
Bases:
AttributesModel- model_config = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'json_schema_extra': {'patternProperties': {'^array\\|[A-Za-z0-9_]+$': {'description': 'Shape of an array stored in the repository', 'items': {'type': 'integer'}, 'minItems': 1, 'readOnly': True, 'type': 'array'}}}, 'serialize_by_alias': True, 'title': 'ExchangeCouplingDataAttributesModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- class ReadModel(**data: Any)¶
Bases:
ReadModel- attributes: AttributesModel¶
- model_config = {'defer_build': True, 'extra': 'forbid', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'serialize_by_alias': True, 'title': 'ExchangeCouplingDataReadModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- node_type: Literal['data.cif2j.exchange_coupling.ExchangeCouplingData.']¶
- class WriteModel(**data: Any)¶
Bases:
WriteModel- attributes: AttributesWriteModel¶
- description: str¶
- extras: dict[str, Any]¶
- label: str¶
- model_config = {'defer_build': True, 'extra': 'forbid', 'json_encoders': {<class 'datetime.datetime'>: <function OrmModel.<lambda>>}, 'serialize_by_alias': True, 'title': 'ExchangeCouplingDataWriteModel', 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- node_type: Literal['data.cif2j.exchange_coupling.ExchangeCouplingData.']¶
- repository_metadata: dict[str, Any]¶
- fields = {'attributes': "QbAttributesField('attributes', dtype=<class 'aiida_cif2j.data.exchange_coupling.ExchangeCouplingData.AttributesModel'>, doc='The node attributes')", 'computer': "QbNumericField('computer', dtype=int | None, doc='The PK of the computer')", 'ctime': "QbNumericField('ctime', dtype=<class 'datetime.datetime'>, doc='The creation time of the node')", 'description': "QbStrField('description', dtype=<class 'str'>, doc='The node description')", 'extras': "QbDictField('extras', dtype=dict[str, typing.Any], doc='The node extras')", 'label': "QbStrField('label', dtype=<class 'str'>, doc='The node label')", 'mtime': "QbNumericField('mtime', dtype=<class 'datetime.datetime'>, doc='The modification time of the node')", 'node_type': "QbStrField('node_type', dtype=typing.Literal['data.cif2j.exchange_coupling.ExchangeCouplingData.'], doc='The type of the node.')", 'pk': "QbNumericField('pk', dtype=<class 'int'>, doc='The primary key of the entity')", 'process_type': "QbStrField('process_type', dtype=str | None, doc='The process type of the node')", 'repository_metadata': "QbDictField('repository_metadata', dtype=dict[str, typing.Any], doc='Virtual hierarchy of the file repository')", 'source': "QbDictField('attributes.source', dtype=dict | None, doc='Source of the data')", 'user': "QbNumericField('user', dtype=<class 'int'>, doc='The PK of the user who owns the node')", 'uuid': "QbStrField('uuid', dtype=<class 'uuid.UUID'>, doc='The UUID of the node')"}¶
- aiida_cif2j.data.exchange_coupling.UNITS = {'J_iso': 'meV', 'distance': 'Ang', 'distance_vector': 'Ang'}¶
Units for the stored arrays, as reported by TB2J itself.