Arithmetic Operations¶
Basic arithmetic operations on tensors.
Supported Operations¶
Nicole tensors support standard arithmetic operations:
Addition and Subtraction¶
C = A + B # Element-wise addition
D = A - B # Element-wise subtraction
E = A + scalar # Add scalar to all blocks
Requirements: Tensors must have identical index structure (same indices, same tags).
Scalar Multiplication¶
Negation¶
Description¶
Arithmetic operations are performed block-wise. Each operation processes only the blocks that exist in both tensors (for binary operations) or in the single tensor (for unary operations).
See Also¶
- oplus: Direct sum operation
- Tensor: Main tensor class
- Examples: Arithmetic
Notes¶
- Operations preserve block structure
- Results have same dtype unless promotion occurs
- Blocks must have matching shapes for addition/subtraction
- For non-Abelian groups, linearly dependent components introduced by the operation are automatically compressed away