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

Add unit-tests to applyOp function #53

Merged
merged 5 commits into from
May 22, 2024
Merged

Conversation

JohanSchott
Copy link
Owner

Add unit-tests to the function applyOp in impurityModel/ed/finite.py.

applyOp is a cornerstone of this repo.
It applied an operator on a multi-configurational state and returns the resulting multi-configurational state.

The input operator can be anything (following the syntax: dict(process: process_amplitude))

The input multi-configurational state can be anything (following the syntax: dict(product_state: product_state_probability_amplitude))

@JohanSchott
Copy link
Owner Author

I'll merge this PR in a couple of days unless someone objects or provide feedback.

@johanjoensson
Copy link
Collaborator

This looks good to me. However, I notice that you only use the bytes representation for the product states. Maybe it would be a good idea to test with int and the other representations as well?

@JohanSchott
Copy link
Owner Author

Thanks for your review @johanjoensson !

True, only test with bytes.

The current implementation of applyOp can only handle product states in the bytes representation.
Does other representations, e.g. int, work in your fork version?

@johanjoensson
Copy link
Collaborator

Sorry, I was confused. My version of applyOp also only accepts bytes as well.

@JohanSchott
Copy link
Owner Author

Alright!

If it looks good to you, would you like to click the "approve" button?

So I can skip the red and dangerously looking "Merge without waiting for requirements to be met" button:
Screenshot 2024-05-21 at 22 36 49

Copy link
Collaborator

@johanjoensson johanjoensson left a comment

Choose a reason for hiding this comment

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

This looks good!

@JohanSchott JohanSchott self-assigned this May 22, 2024
@JohanSchott JohanSchott merged commit 07bc240 into master May 22, 2024
1 check passed
@JohanSchott JohanSchott deleted the add_tests_to_applyOp branch May 22, 2024 22:00
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.

None yet

2 participants