tensorcircuit icon indicating copy to clipboard operation
tensorcircuit copied to clipboard

Allow sparse matrix as circuit input

Open royess opened this issue 7 months ago • 3 comments

Issue Description

In some cases, we would like a sparse matrix as circuit input.

Right now, this seems impossible because of type conversion. For example, DMCircuit does this:

dminputs = backend.convert_to_tensor(dminputs)

which throws an error like "TypeError: Failed to convert elements of SparseTensor(...) to Tensor" in TensorFlow.

Proposed Solution

I'm not sure whether we can just modify type conversions.

royess avatar Dec 04 '23 09:12 royess