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

Probability in tools needs parameter type #83

Closed
brennanfreeze opened this issue Sep 20, 2024 · 1 comment · Fixed by #87
Closed

Probability in tools needs parameter type #83

brennanfreeze opened this issue Sep 20, 2024 · 1 comment · Fixed by #87
Labels
good first issue Good for newcomers

Comments

@brennanfreeze
Copy link
Member

the probability function needs to have the "quantumstate" param changed to "quantum_state" and needs a union type of numpy array and quantumcircuit object.

@brennanfreeze brennanfreeze added the good first issue Good for newcomers label Sep 20, 2024
fabie37 added a commit to fabie37/qcpy that referenced this issue Sep 20, 2024
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.
fabie37 added a commit to fabie37/qcpy that referenced this issue Sep 20, 2024
Problem
- Project runs black formatter
- qubit needs to be included in root import

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

fabie37 commented Sep 20, 2024

Just noticed that import quantum circuit causes a circular dep as qubit.py is in the same init.py file as measure.py. The solution was to break the dep by separating qubit.py into another folder. I wasn't sure if this conforms to the projects directory structure but hopefully its ok.

parisosuch-dev added a commit that referenced this issue Sep 23, 2024
(resolves #83) Probability in tools needs parameter type
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.

2 participants