Skip to content

Group interactions

GroupInteraction

Source code in cmtj/reservoir/__init__.pyi
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class GroupInteraction:
    def __init__(
        self,
        coordinateMatrix: list[cmtj.CVector],
        junctionList: list[cmtj.Junction],
        topId: str = "free",
    ) -> None:
        """Initialize GroupInteraction for coupled junctions.

        :param coordinateMatrix: List of position vectors for each junction
        :param junctionList: List of junctions to couple
        :param topId: ID of the top layer to use for interactions (default: "free")
        :raises RuntimeError: If coordinate and junction lists have different sizes or are empty
        """
        ...

    def clearLogs(self) -> None:
        """Clear the logs"""
        ...

    @overload
    def getLog(self, junctionIndex: int) -> dict[str, list[float]]:
        """Get the logs for a specific junction.

        :param junctionIndex: Index of the junction
        :raises RuntimeError: If junction index is out of bounds
        :return: Dictionary containing log data
        """
        ...

    @overload
    def getLog(self) -> dict[str, list[float]]:
        """Get the logs for all junctions.

        :return: Dictionary containing log data
        """
        ...

    def runSimulation(self, totalTime: float, timeStep: float = 1e-13, writeFrequency: float = 1e-13) -> None:
        """Run the coupled simulation.

        :param totalTime: Total simulation time
        :param timeStep: Time step for integration
        :param writeFrequency: How often to write data to logs
        :raises RuntimeError: If timeStep > writeFrequency or junctions have incompatible solver modes
        """
        ...

    def setInteractionFunction(
        self,
        function: Callable[[cmtj.CVector, cmtj.CVector, cmtj.Layer, cmtj.Layer], cmtj.CVector],
    ) -> None:
        """Set the interaction function for the coupled junctions.

        :param function: Interaction function.
            Either `computeDipoleInteraction` or `computeDipoleInteractionNoumra` or `nullDipoleInteraction`
            or provide your own custom function.
        """
        ...

__init__(coordinateMatrix, junctionList, topId='free')

Initialize GroupInteraction for coupled junctions.

Parameters:

Name Type Description Default
coordinateMatrix list[cmtj.CVector]

List of position vectors for each junction

required
junctionList list[cmtj.Junction]

List of junctions to couple

required
topId str

ID of the top layer to use for interactions (default: "free")

'free'

Raises:

Type Description
RuntimeError

If coordinate and junction lists have different sizes or are empty

Source code in cmtj/reservoir/__init__.pyi
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
def __init__(
    self,
    coordinateMatrix: list[cmtj.CVector],
    junctionList: list[cmtj.Junction],
    topId: str = "free",
) -> None:
    """Initialize GroupInteraction for coupled junctions.

    :param coordinateMatrix: List of position vectors for each junction
    :param junctionList: List of junctions to couple
    :param topId: ID of the top layer to use for interactions (default: "free")
    :raises RuntimeError: If coordinate and junction lists have different sizes or are empty
    """
    ...

clearLogs()

Clear the logs

Source code in cmtj/reservoir/__init__.pyi
21
22
23
def clearLogs(self) -> None:
    """Clear the logs"""
    ...

runSimulation(totalTime, timeStep=1e-13, writeFrequency=1e-13)

Run the coupled simulation.

Parameters:

Name Type Description Default
totalTime float

Total simulation time

required
timeStep float

Time step for integration

1e-13
writeFrequency float

How often to write data to logs

1e-13

Raises:

Type Description
RuntimeError

If timeStep > writeFrequency or junctions have incompatible solver modes

Source code in cmtj/reservoir/__init__.pyi
43
44
45
46
47
48
49
50
51
def runSimulation(self, totalTime: float, timeStep: float = 1e-13, writeFrequency: float = 1e-13) -> None:
    """Run the coupled simulation.

    :param totalTime: Total simulation time
    :param timeStep: Time step for integration
    :param writeFrequency: How often to write data to logs
    :raises RuntimeError: If timeStep > writeFrequency or junctions have incompatible solver modes
    """
    ...

setInteractionFunction(function)

Set the interaction function for the coupled junctions.

Parameters:

Name Type Description Default
function Callable[[cmtj.CVector, cmtj.CVector, cmtj.Layer, cmtj.Layer], cmtj.CVector]

Interaction function. Either computeDipoleInteraction or computeDipoleInteractionNoumra or nullDipoleInteraction or provide your own custom function.

required
Source code in cmtj/reservoir/__init__.pyi
53
54
55
56
57
58
59
60
61
62
63
def setInteractionFunction(
    self,
    function: Callable[[cmtj.CVector, cmtj.CVector, cmtj.Layer, cmtj.Layer], cmtj.CVector],
) -> None:
    """Set the interaction function for the coupled junctions.

    :param function: Interaction function.
        Either `computeDipoleInteraction` or `computeDipoleInteractionNoumra` or `nullDipoleInteraction`
        or provide your own custom function.
    """
    ...

Reservoir

Source code in cmtj/reservoir/__init__.pyi
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
class Reservoir:
    def __init__(
        self,
        coordinateMatrix: list[list[cmtj.CVector]],
        layerMatrix: list[list[cmtj.Layer]],
    ) -> None:
        """Initialize Reservoir simulation.

        :param coordinateMatrix: 2D matrix of position vectors
        :param layerMatrix: 2D matrix of magnetic layers
        """
        ...

    def clearLogs(self) -> None: ...
    def getLayer(self, arg0: int) -> cmtj.Layer:
        """Get layer at the specified index (using row-major ordering).

        :param arg0: Index of the layer
        :return: Layer object
        """
        ...

    def getMagnetisation(self, arg0: int) -> cmtj.CVector:
        """Get magnetization vector for layer at specified index (using row-major ordering).

        :param arg0: Index of the layer
        :return: Magnetization vector
        """
        ...

    def runSimulation(self, totalTime: float, timeStep: float) -> None:
        """Run reservoir simulation and log data.

        :param totalTime: Total simulation time
        :param timeStep: Integration time step
        """
        ...

    def saveLogs(self, filename: str) -> None:
        """Save simulation logs to file.

        :param filename: Path to save the log file. Empty string will skip saving.
        """
        ...

    def setAllExternalField(self, driver: cmtj.AxialDriver) -> None:
        """Set external field for all layers.

        :param driver: External field driver
        """
        ...

    def setLayerAnisotropy(self, arg0: int, driver: cmtj.ScalarDriver) -> None:
        """Set anisotropy for specific layer.

        :param arg0: Layer index
        :param driver: Anisotropy driver
        """
        ...

    def setLayerExternalField(self, arg0: int, driver: cmtj.AxialDriver) -> None:
        """Set external field for specific layer.

        :param arg0: Layer index
        :param driver: External field driver
        """
        ...

__init__(coordinateMatrix, layerMatrix)

Initialize Reservoir simulation.

Parameters:

Name Type Description Default
coordinateMatrix list[list[cmtj.CVector]]

2D matrix of position vectors

required
layerMatrix list[list[cmtj.Layer]]

2D matrix of magnetic layers

required
Source code in cmtj/reservoir/__init__.pyi
66
67
68
69
70
71
72
73
74
75
76
def __init__(
    self,
    coordinateMatrix: list[list[cmtj.CVector]],
    layerMatrix: list[list[cmtj.Layer]],
) -> None:
    """Initialize Reservoir simulation.

    :param coordinateMatrix: 2D matrix of position vectors
    :param layerMatrix: 2D matrix of magnetic layers
    """
    ...

getLayer(arg0)

Get layer at the specified index (using row-major ordering).

Parameters:

Name Type Description Default
arg0 int

Index of the layer

required

Returns:

Type Description
cmtj.Layer

Layer object

Source code in cmtj/reservoir/__init__.pyi
79
80
81
82
83
84
85
def getLayer(self, arg0: int) -> cmtj.Layer:
    """Get layer at the specified index (using row-major ordering).

    :param arg0: Index of the layer
    :return: Layer object
    """
    ...

getMagnetisation(arg0)

Get magnetization vector for layer at specified index (using row-major ordering).

Parameters:

Name Type Description Default
arg0 int

Index of the layer

required

Returns:

Type Description
cmtj.CVector

Magnetization vector

Source code in cmtj/reservoir/__init__.pyi
87
88
89
90
91
92
93
def getMagnetisation(self, arg0: int) -> cmtj.CVector:
    """Get magnetization vector for layer at specified index (using row-major ordering).

    :param arg0: Index of the layer
    :return: Magnetization vector
    """
    ...

runSimulation(totalTime, timeStep)

Run reservoir simulation and log data.

Parameters:

Name Type Description Default
totalTime float

Total simulation time

required
timeStep float

Integration time step

required
Source code in cmtj/reservoir/__init__.pyi
 95
 96
 97
 98
 99
100
101
def runSimulation(self, totalTime: float, timeStep: float) -> None:
    """Run reservoir simulation and log data.

    :param totalTime: Total simulation time
    :param timeStep: Integration time step
    """
    ...

saveLogs(filename)

Save simulation logs to file.

Parameters:

Name Type Description Default
filename str

Path to save the log file. Empty string will skip saving.

required
Source code in cmtj/reservoir/__init__.pyi
103
104
105
106
107
108
def saveLogs(self, filename: str) -> None:
    """Save simulation logs to file.

    :param filename: Path to save the log file. Empty string will skip saving.
    """
    ...

setAllExternalField(driver)

Set external field for all layers.

Parameters:

Name Type Description Default
driver cmtj.AxialDriver

External field driver

required
Source code in cmtj/reservoir/__init__.pyi
110
111
112
113
114
115
def setAllExternalField(self, driver: cmtj.AxialDriver) -> None:
    """Set external field for all layers.

    :param driver: External field driver
    """
    ...

setLayerAnisotropy(arg0, driver)

Set anisotropy for specific layer.

Parameters:

Name Type Description Default
arg0 int

Layer index

required
driver cmtj.ScalarDriver

Anisotropy driver

required
Source code in cmtj/reservoir/__init__.pyi
117
118
119
120
121
122
123
def setLayerAnisotropy(self, arg0: int, driver: cmtj.ScalarDriver) -> None:
    """Set anisotropy for specific layer.

    :param arg0: Layer index
    :param driver: Anisotropy driver
    """
    ...

setLayerExternalField(arg0, driver)

Set external field for specific layer.

Parameters:

Name Type Description Default
arg0 int

Layer index

required
driver cmtj.AxialDriver

External field driver

required
Source code in cmtj/reservoir/__init__.pyi
125
126
127
128
129
130
131
def setLayerExternalField(self, arg0: int, driver: cmtj.AxialDriver) -> None:
    """Set external field for specific layer.

    :param arg0: Layer index
    :param driver: External field driver
    """
    ...

computeDipoleInteraction(r1, r2, layer1, layer2)

Compute dipole interaction between two junctions (Kanao et al. 2019 PRA).

Parameters:

Name Type Description Default
r1 cmtj.CVector

Position vector of the first junction

required
r2 cmtj.CVector

Position vector of the second junction

required
layer1 cmtj.Layer

Magnetic layer of the first junction

required
layer2 cmtj.Layer

Magnetic layer of the second junction

required

Returns:

Type Description
cmtj.CVector

Dipole interaction vector

Source code in cmtj/reservoir/__init__.pyi
133
134
135
136
137
138
139
140
141
142
143
144
145
def computeDipoleInteraction(
    r1: cmtj.CVector, r2: cmtj.CVector, layer1: cmtj.Layer, layer2: cmtj.Layer
) -> cmtj.CVector:
    """Compute dipole interaction between two junctions (Kanao et al. 2019 PRA).

    :param r1: Position vector of the first junction
    :param r2: Position vector of the second junction
    :param layer1: Magnetic layer of the first junction
    :param layer2: Magnetic layer of the second junction

    :return: Dipole interaction vector
    """
    ...

computeDipoleInteractionNoumra(r1, r2, layer1, layer2)

Compute dipole interaction between two junctions (Nomura et al. 2019 JJAP).

Parameters:

Name Type Description Default
r1 cmtj.CVector

Position vector of the first junction

required
r2 cmtj.CVector

Position vector of the second junction

required
layer1 cmtj.Layer

Magnetic layer of the first junction

required
layer2 cmtj.Layer

Magnetic layer of the second junction

required

Returns:

Type Description
cmtj.CVector

Dipole interaction vector

Source code in cmtj/reservoir/__init__.pyi
147
148
149
150
151
152
153
154
155
156
157
158
159
def computeDipoleInteractionNoumra(
    r1: cmtj.CVector, r2: cmtj.CVector, layer1: cmtj.Layer, layer2: cmtj.Layer
) -> cmtj.CVector:
    """Compute dipole interaction between two junctions (Nomura et al. 2019 JJAP).

    :param r1: Position vector of the first junction
    :param r2: Position vector of the second junction
    :param layer1: Magnetic layer of the first junction
    :param layer2: Magnetic layer of the second junction

    :return: Dipole interaction vector
    """
    ...

nullDipoleInteraction(r1, r2, layer1, layer2)

Compute null dipole interaction between two junctions. This is a placeholder function that returns a zero vector.

Parameters:

Name Type Description Default
r1 cmtj.CVector

Position vector of the first junction

required
r2 cmtj.CVector

Position vector of the second junction

required
layer1 cmtj.Layer

Magnetic layer of the first junction

required
layer2 cmtj.Layer

Magnetic layer of the second junction

required

Returns:

Type Description
cmtj.CVector

Zero vector

Source code in cmtj/reservoir/__init__.pyi
161
162
163
164
165
166
167
168
169
170
171
172
def nullDipoleInteraction(r1: cmtj.CVector, r2: cmtj.CVector, layer1: cmtj.Layer, layer2: cmtj.Layer) -> cmtj.CVector:
    """Compute null dipole interaction between two junctions.
    This is a placeholder function that returns a zero vector.

    :param r1: Position vector of the first junction
    :param r2: Position vector of the second junction
    :param layer1: Magnetic layer of the first junction
    :param layer2: Magnetic layer of the second junction

    :return: Zero vector
    """
    ...