brahmap.core.InvNoiseCovLO_Toeplitz01¶
Bases: InvNoiseCovLinearOperator
A linear operator representing the inverse of a Toeplitz noise covariance matrix \(N^{-1}\)
This inverse operator is based on the PCG based Toeplitz system solver.
The input covariance array must be at least of the size \(n\). The input power spectrum array must be of the size \(2n-2\) or \(2n-1\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
The size (dimension) of the linear operator |
required |
input
|
ArrayLike
|
The input array or data defining the operator |
required |
input_type
|
Literal['covariance', 'power_spectrum']
|
Specifies whether the |
'power_spectrum'
|
precond_op
|
LinearOperator | Literal[None, 'Strang', 'TChan', 'RChan', 'KK2']
|
The preconditioner operator, by default |
None
|
precond_maxiter
|
int
|
The maximum number of iterations allowed for the preconditioner, by
default |
50
|
precond_atol
|
float
|
The absolute tolerance setting for the preconditioner solver, by
default |
1e-10
|
precond_callback
|
Callable | None
|
An optional callback function executed within the preconditioner
step, by default |
None
|
dtype
|
DTypeFloat
|
The data type of the operator, by default |
float64
|
Methods:
| Name | Description |
|---|---|
reset_counters |
Resets matrix-vector product counter to zero. |
dot |
Numpy-like dot() method. |
matvec |
Matrix-vector multiplication method. |
to_array |
Returns the dense form of the linear operator as a 2D NumPy array. |
get_inverse |
Returns the inverse of this operator, which is the original |
Attributes:
| Name | Type | Description |
|---|---|---|
dtype |
DTypeLike
|
The data type of the operator. |
nargin |
int
|
Size of the input vector \(x\), i.e. the number of columns of the operator |
nargout |
int
|
Size of the output vector \(A(x)\), i.e. the number of rows of the operator |
symmetric |
bool
|
Indicates whether the operator is symmetric or not |
shape |
tuple[int, int]
|
A tuple |
nMatvec |
int
|
The number of matrix-vector multiplications computed so far |
T |
LinearOperator
|
The transpose operator |
H |
LinearOperator
|
The adjoint operator |
size |
int
|
The dimension i.e. the number of rows/columns of the operator |
precond_op |
LinearOperator | None
|
The preconditioner operator used to accelerate convergence. |
diag |
NDArray[number]
|
The diagonal elements of the inverse noise covariance operator. |
previous_num_iterations |
int
|
The number of iterations performed in the last linear solve. |
Source code in brahmap/core/noise_ops_toeplitz.py
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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
Attributes¶
dtype: npt.DTypeLike
property
writable
¶
The data type of the operator.
Returns:
| Type | Description |
|---|---|
DTypeLike
|
The NumPy data type of the operator |
nargin: int
property
¶
Size of the input vector \(x\), i.e. the number of columns of the operator
Returns:
| Type | Description |
|---|---|
int
|
The number of input columns |
nargout: int
property
¶
Size of the output vector \(A(x)\), i.e. the number of rows of the operator
Returns:
| Type | Description |
|---|---|
int
|
The number of output rows |
symmetric: bool
property
¶
Indicates whether the operator is symmetric or not
Returns:
| Type | Description |
|---|---|
bool
|
|
shape: Tuple[int, int]
property
¶
A tuple (nargout, nargin) representing the shape of the operator
Returns:
| Type | Description |
|---|---|
tuple[int, int]
|
A tuple |
nMatvec: int
property
¶
The number of matrix-vector multiplications computed so far
Returns:
| Type | Description |
|---|---|
int
|
The number of matrix-vector multiplications performed |
T: LinearOperator
property
¶
The transpose operator
Returns:
| Type | Description |
|---|---|
LinearOperator
|
The transpose of this linear operator |
H: LinearOperator
property
¶
The adjoint operator
Returns:
| Type | Description |
|---|---|
LinearOperator
|
The Hermitian adjoint of this linear operator |
size: int
property
¶
The dimension i.e. the number of rows/columns of the operator
Returns:
| Type | Description |
|---|---|
int
|
The size of the operator |
precond_op: LinearOperator | None
property
writable
¶
The preconditioner operator used to accelerate convergence.
Returns:
| Type | Description |
|---|---|
LinearOperator | None
|
The preconditioner operator, if set |
diag: npt.NDArray[np.number]
property
writable
¶
The diagonal elements of the inverse noise covariance operator.
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
A 1-d array containing the diagonal elements |
previous_num_iterations: int
property
¶
The number of iterations performed in the last linear solve.
Returns:
| Type | Description |
|---|---|
int
|
Number of iterations |
Functions¶
reset_counters() -> None
¶
dot(x) -> npt.NDArray[np.number]
¶
Numpy-like dot() method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Any
|
The input vector or object to multiply with. |
required |
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
The result of the dot product. |
Source code in brahmap/base/linop.py
matvec(x) -> npt.NDArray[np.number]
¶
Matrix-vector multiplication method.
The matvec method encapsulates the matvec
routine specified at construct time, to ensure the
consistency of the input and output arrays with the
operator's shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
NDArray[number]
|
The input vector \(x\) to be multiplied by the operator |
required |
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
The result of the matrix-vector multiplication \(A(x)\) |
Source code in brahmap/base/linop.py
to_array() -> npt.NDArray[np.number]
¶
Returns the dense form of the linear operator as a 2D NumPy array.
Warning
This method first allocates a NumPy array of shape self.shape
and data-type self.dtype, and then fills them with numbers. As
such, for a large linear operator, it can occupy an enormous
amount of memory and crash your system. Don't use it unless you
understand the risk!
Returns:
| Type | Description |
|---|---|
NDArray[number]
|
The dense 2D array representation of the linear operator |
Source code in brahmap/base/linop.py
get_inverse() -> NoiseCovLO_Toeplitz01
¶
Returns the inverse of this operator, which is the original noise covariance operator.
Returns:
| Type | Description |
|---|---|
NoiseCovLO_Toeplitz01
|
The noise covariance operator \(N\) |