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

Subspace utility for excitation-number-restricted spaces #58

Closed
andgoldschmidt opened this issue Nov 29, 2023 · 1 comment · Fixed by #78
Closed

Subspace utility for excitation-number-restricted spaces #58

andgoldschmidt opened this issue Nov 29, 2023 · 1 comment · Fixed by #78
Assignees
Labels
good first issue Good for newcomers

Comments

@andgoldschmidt
Copy link
Member

Is your feature request related to a problem? Please describe.
The current subspaces are defined for guard levels. There is also the case of excitation number restrictions, which limits the total excitation count to a specific amount.

Describe the solution you'd like
An enr_subspace_indices function.

@andgoldschmidt andgoldschmidt added the good first issue Good for newcomers label Nov 29, 2023
@andgoldschmidt
Copy link
Member Author

This is the fragment to add to quantum_utils.jl:

basis_labels(levels::AbstractVector{Int}; baseline=1) =
    kron([""], [string.(baseline:level - 1 + baseline) for level  levels]...)

function enr_subspace_indices(excitation_number::Int, levels::AbstractVector{Int})
    # excitation_number uses baseline of zero
    return findall(
        b -> sum([parse(Int, bᵢ) for bᵢ  b])  excitation_restriction,
        basis_labels(levels, baseline=0)
    )
end

Where we also rewrite the existing subspace calls to use the basis_labels function shown here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant