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

Allow user to choose algorithm in hafnian wrapper #41

Open
josh146 opened this issue Aug 24, 2019 · 1 comment
Open

Allow user to choose algorithm in hafnian wrapper #41

josh146 opened this issue Aug 24, 2019 · 1 comment
Labels
enhancement New feature or request python

Comments

@josh146
Copy link
Member

josh146 commented Aug 24, 2019

Currently, when calling the hafnian Python wrapper, all you specify is whether recursive is True or False:

hafnian(A, loop=True, recursive=True, quad=True, approx=False, etc...)

We then apply logic to call the best case hafnian algorithm considering the matrix+options the user has provided.

We should modify it to look like this:

hafnian(A, loop=True, algorithm="best", options={})

where algorithm is a string containing the algorithm to use:

  • best is the current logic (and the default)

  • recursive

  • trace

  • approx

and options are the algorithm specific options, i.e. options={'samples': 100} for the approx algorithm, options={'quad': True} for the recursive, options={'powtrace': 'eigenvalues'} for the trace algorithm, etc.

Note: the moment/repeated hafnian will have to remain its own function, since it also takes rpt as an argument.

@josh146 josh146 added enhancement New feature or request python labels Aug 24, 2019
@sduquemesa
Copy link
Contributor

@nquesada is this still relevant? Current function signature here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python
Projects
None yet
Development

No branches or pull requests

2 participants