ITensor / ITensor/SparseArraysBase.jl

[ENHANCEMENT] Define an `SparseArraysBase.issparse` trait function and associated trait

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Julia
Stars
1
Forks
1
Avg merge
21m
Merged PRs (30d)
1

Description

Define an SparseArraysBase.issparse trait function with an associated type trait SparseArraysBase.IsSparse, in the style of SimpleTraits.jl.

We could use SparseArraysBase.issparse(a) = interface(a) isa AbstractSparseArrayInterface as a default definition.

Possibly we can overload/repurpose Base.issparse for this but I don't know how general that is meant to be, for example:

julia> using SparseArrays: issparse

julia> using LinearAlgebra: Diagonal

julia> issparse(Diagonal(randn(4)))
false

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing SparseArraysBase interface, especially interface(a) and AbstractSparseArrayInterface, then compare the proposed trait with SimpleTraits.jl. Determine the intended relationship between SparseArraysBase.issparse, IsSparse, and Base.issparse; done means the trait API and its default behavior are defined consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.