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

Cleanup plane wave fourier transform #34

Merged
merged 22 commits into from
May 26, 2017

Conversation

Strilanc
Copy link
Collaborator

@Strilanc Strilanc commented May 20, 2017

  • Use Grid parameter instead of grid field parameters
  • Extract common helper to handle both the forward and inverse cases

Comes after #32

babbush
babbush previously approved these changes May 20, 2017
@Strilanc
Copy link
Collaborator Author

Don't merge this yet (that's why [Blocked] is in the title). It needs to be rebased to expunge the non-CLA commit.

- Use Grid parameter instead of grid field parameters
- Extract common helper to handle both the forward and inverse cases
# Conflicts:
#	src/fermilib/ops/_fermion_operator.py
#	src/fermilib/ops/_fermion_operator_test.py
@Strilanc
Copy link
Collaborator Author

Rebased. Still blocked; comes after #35 and #39

@damiansteiger damiansteiger removed their request for review May 24, 2017 03:24
… u/cg/minor-9

# Conflicts:
#	src/fermilib/utils/_plane_wave_hamiltonian.py
@Strilanc Strilanc changed the title [Blocked] Cleanup plane wave fourier transform Cleanup plane wave fourier transform May 24, 2017
@Strilanc
Copy link
Collaborator Author

No longer blocked.

transformed_term = new_basis
else:
transformed_term *= new_basis
if transformed_term is None:
Copy link
Collaborator Author

@Strilanc Strilanc May 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@babbush Please double-check that removing this conditional-continue doesn't change the logic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Spaceenter please advise.

hamiltonian_t = transformed_term
else:
hamiltonian_t += transformed_term
hamiltonian_t += transformed_term
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If transformed_term equals to FermionOperator.identity(), we should not add to hamiltonian_t?
It's equivalent to the case that the code doesn't enter the for loop in line 221, but maybe that's not possible since we don't expect empty term in hamiltonian.terms?

@Strilanc
Copy link
Collaborator Author

Strilanc commented May 25, 2017 via email

@Spaceenter
Copy link
Contributor

Actually, I think what you implemented should be OK, as the hamiltonian is always from the function plane_wave_hamiltonian(), so it should not contain "empty" term.
Thanks for clean this up!

@babbush
Copy link
Contributor

babbush commented May 26, 2017

Great work guys!

@babbush babbush merged commit d049440 into ProjectQ-Framework:develop May 26, 2017
@Strilanc Strilanc deleted the u/cg/minor-9 branch May 26, 2017 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants