Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function to create singles and doubles transitions. #126

Open
MarcoBarroca opened this issue Jan 8, 2025 · 1 comment
Open

Function to create singles and doubles transitions. #126

MarcoBarroca opened this issue Jan 8, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@MarcoBarroca
Copy link

MarcoBarroca commented Jan 8, 2025

What should we add?

It would be useful to give users functions to create singles and doubles transitions instead of asking them to code it themselves like in this tutorial.

Supposing one has the code to calculate the transitions it could work something like this:

import numpy as np
from qiskit_addon_sqd.fermion import create_transitions_doubles_within_same_spin, create_transitions_doubles_across_spin, create_transitions_single

transitions_single = create_transitions_single(norb)
transitions_doubles_same = create_transitions_doubles_within_same_spin(norb)
transitions_doubles_across= ccreate_transitions_doubles_across_spin(norb)
    
# Create the identity transition
identity_transition = np.array([['I'] * (2 * norb)], dtype='<U1')
    
# Combine all transitions
transitions_combined = np.vstack([transitions_single, transitions_doubles_same,transitions_doubles_across, identity_transition])

Then a user could easily create whichever transitions it wanted and include then with enlarge_batch_from_transitions.

I could work on this if people think it would be useful.

@caleb-johnson
Copy link
Collaborator

@MarcoBarroca , thanks for submitting this! I could see a couple of helper functions like this making sense in the counts module.

We'd need:

  • 3 new public functions (I think in counts module).
  • Tests to ensure the functions produce the right output for some given inputs.
  • Release note
  • Update relevant notebook(s) to use the functions instead of doing it manually

@caleb-johnson caleb-johnson added the enhancement New feature or request label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants