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

(resolves #83) Probability in tools needs parameter type #87

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

fabie37
Copy link
Contributor

@fabie37 fabie37 commented Sep 20, 2024

Pull Request

Requesting to pull changes to resolve issue #83

Description

Fixes issue presented in #83

Please include a summary of the changes and the motivation behind them. If applicable, link to any related issues.

Type of Change

Please check the type of change your PR introduces:

  • Bugfix
  • New feature
  • Enhancement
  • Documentation
  • Refactoring
  • Other (please specify):

Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the documentation accordingly.
  • I ran black formatter on the codebase. (CI/CD will fail if neglected)
  • My code follows the project's coding style guidelines.

Related Issues

Screenshots (if applicable)

NA

Additional Notes

Problem:

  • Probability function needs Union[quantum_circuit, ndarray] type for quantum_state
  • quantum_state rename from quantumstate

Issues:

  • Importing quantum_circuit causes circular dependency
  • quantum_circuit import base_core imports from tools qubit
  • measure which is in tools imports probability which imports quantum_circuit

Solution:

    1. Rename qunatumstate to quantum_state
    1. Add Union type from typing
    1. Remove qubit from tools and put into separate folder to separate imports this solve the dependency issue.

Problem:
- Probability function needs Union[quantum_circuit, ndarray] type for quantum_state
- quantum_state rename from quantumstate

Issues:
- Importing quantum_circuit causes circular dependency
- quantum_circuit import base_core imports from tools qubit
- measure which is in tools imports probability which imports quantum_circuit

Solution:
- 1. Rename qunatumstate to quantum_state
- 2. Add Union type from typing
- 3. Remove qubit from tools and put into separate folder to separate imports
this solve the dependency issue.
Problem:
- Probability function needs Union[quantum_circuit, ndarray] type for quantum_state
- quantum_state rename from quantumstate

Issues:
- Importing quantum_circuit causes circular dependency
- quantum_circuit import base_core imports from tools qubit
- measure which is in tools imports probability which imports quantum_circuit

Solution:
- 1. Rename qunatumstate to quantum_state
- 2. Add Union type from typing
- 3. Remove qubit from tools and put into separate folder to separate imports
this solve the dependency issue.
Problem
- Project runs black formatter
- qubit needs to be included in root import

Solution
- run `black qcpy/`
- add `from ./qubit import *`
@brennanfreeze
Copy link
Member

Hi @fabie37, thank you for checking these issues out! Looks great so far, would it possible to change the imports with an asterisk to an explicit import? This has been needed to be done and would be a big help thank you!

@parisosuch-dev
Copy link
Member

Hi @fabie37, thank you for checking these issues out! Looks great so far, would it possible to change the imports with an asterisk to an explicit import? This has been needed to be done and would be a big help thank you!

we could just accept it and solve that in another PR to cover issue #68

@brennanfreeze
Copy link
Member

Hi @fabie37, thank you for checking these issues out! Looks great so far, would it possible to change the imports with an asterisk to an explicit import? This has been needed to be done and would be a big help thank you!

we could just accept it and solve that in another PR to cover issue #68

Works with me! Regardless, looks great.

Copy link
Member

@parisosuch-dev parisosuch-dev left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks :)

@parisosuch-dev parisosuch-dev merged commit 0bc72c5 into QCpython:main Sep 23, 2024
2 checks passed
@fabie37
Copy link
Contributor Author

fabie37 commented Sep 23, 2024

Awesome, glad I could help!

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.

Probability in tools needs parameter type
3 participants