Make functions accept StateVector in addition to Numpy array

Open
#253 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
numpy, python

Research direction

Start with the StateVector class in python/ffsim/states/states.py and the sample_state_vector example. Inspect functions in gates/ and protocols/ that currently accept NumPy arrays and require norb and nelec. Done means the affected functions accept StateVector inputs and can obtain those values from the object when they are not passed separately.

Written by the indexing model from the issue text.

Description

Now that the StateVector class exists, functions that accept vec as a Numpy array should be updated to also accept a StateVector, in which norb and nelec don't also need to be passed.

See sample_state_vector for an example of how to support both input types.

Non-exhaustive list of affected modules:

  • gates/
  • protocols/
Dominant language
Python
Stars
116
Forks
50
Avg merge
2h 1m
Merged PRs (30d)
8

Getting set up

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.

More from Qiskit/ffsim

All issues in Qiskit/ffsim

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.