jelli.core.custom_basis
CustomBasis
A class to represent a custom parameter basis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the custom basis. |
required |
parameters
|
list or dict
|
The parameters in the custom basis. If a list is provided, all parameters are assumed to be real. If a dict is provided, the keys are the parameter names and the values are the types (e.g., |
required |
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the custom basis. |
parameters |
dict
|
The parameters in the custom basis. The keys are the parameter names and the values are the types (e.g., |
Methods:
Name | Description |
---|---|
get_all_names |
Get all custom basis names. |
get |
Get a custom basis by name. |
get_all |
Get all custom basis objects. |
get_parameter_basis |
Get the parameter basis. |
Examples:
Initialize a custom basis with real parameters:
>>> custom_basis = CustomBasis('example_basis', ['param1', 'param2'])
Initialize a custom basis with mixed parameters:
>>> custom_basis = CustomBasis('example_basis', {'param1': 'R', 'param2': 'C'})
Get all custom basis names:
>>> CustomBasis.get_all_names()
Get a custom basis by name:
>>> custom_basis = CustomBasis.get('example_basis')
Get all custom basis objects:
>>> custom_bases = CustomBasis.get_all()
Get the parameter basis:
>>> parameter_basis = custom_basis.get_parameter_basis()
Source code in jelli/core/custom_basis.py
3 4 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 64 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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|
__init__(name, parameters)
Initialize the CustomBasis class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the custom basis. |
required |
parameters
|
list or dict
|
The parameters in the custom basis. If a list is provided, all parameters are assumed to be real. If a dict is provided, the keys are the parameter names and the values are the types (e.g., |
required |
Returns:
Type | Description |
---|---|
None
|
|
Examples:
Initialize a custom basis with real parameters:
>>> custom_basis = CustomBasis('example_basis', ['param1', 'param2'])
Initialize a custom basis with mixed parameters:
>>> custom_basis = CustomBasis('example_basis', {'param1': 'R', 'param2': 'C'})
Source code in jelli/core/custom_basis.py
62 63 64 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 |
|
get(name)
classmethod
Get a custom basis by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the custom basis. |
required |
Returns:
Type | Description |
---|---|
CustomBasis
|
The custom basis object. |
Examples:
>>> CustomBasis.get('example_basis')
Source code in jelli/core/custom_basis.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
get_all()
classmethod
Get all custom basis objects.
Returns:
Type | Description |
---|---|
list
|
A list of all custom basis objects. |
Examples:
>>> CustomBasis.get_all()
Source code in jelli/core/custom_basis.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
get_all_names()
classmethod
Get all custom basis names.
Returns:
Type | Description |
---|---|
list
|
A list of all custom basis names. |
Examples:
>>> CustomBasis.get_all_names()
Source code in jelli/core/custom_basis.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
get_parameter_basis(split_re_im=True)
Get the parameter basis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
split_re_im
|
bool
|
If |
True
|
Returns:
Type | Description |
---|---|
list
|
A list containing the parameter basis. |
Examples:
>>> custom_basis = CustomBasis('example_basis', ['param1', 'param2'])
>>> custom_basis.get_parameter_basis('example_basis')
Source code in jelli/core/custom_basis.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|