cutile-python icon indicating copy to clipboard operation
cutile-python copied to clipboard

[FEA]: Identity matrix

Open Da1sypetals opened this issue 3 weeks ago • 0 comments

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request?

Critical (currently preventing usage)

Please provide a clear description of problem this feature solves

Have trouble solving small linear systems using iterative methods without the support of creating identity matrix(tile).

Feature Description

Need a way to create identity tile (1s on the diagonal, 0s elsewhere). It will be great if diag is also supported.

Describe your ideal solution

Proposed API would be:

ct.identity(4, dtype=ct.float32)
# returns Tile[float32, (4, 4)]

# for any tile `values` with type Tile[float32, (8)]
ct.diag(values)
# returns Tile[float32, (8, 8)]

Describe any alternatives you have considered

No response

Additional context

No response

Contributing Guidelines

  • [x] I agree to follow cuTile Python's contributing guidelines
  • [x] I have searched the open feature requests and have found no duplicates for this feature request

Da1sypetals avatar Jan 05 '26 06:01 Da1sypetals