Closed Gruntrexpewrus closed 1 year ago
There is a little bug related to the operators, I will fix.
Merging #254 (79f17c1) into main (61c3366) will increase coverage by
0.28%
. The diff coverage is98.36%
.
@@ Coverage Diff @@
## main #254 +/- ##
==========================================
+ Coverage 92.25% 92.54% +0.28%
==========================================
Files 12 12
Lines 943 993 +50
Branches 180 189 +9
==========================================
+ Hits 870 919 +49
Misses 41 41
- Partials 32 33 +1
Impacted Files | Coverage Δ | |
---|---|---|
skqulacs/circuit/__init__.py | 100.00% <ø> (ø) |
|
skqulacs/circuit/circuit.py | 83.06% <90.90%> (+0.29%) |
:arrow_up: |
skqulacs/circuit/pre_defined.py | 97.54% <100.00%> (+0.10%) |
:arrow_up: |
skqulacs/qnn/regressor.py | 84.76% <100.00%> (+3.15%) |
:arrow_up: |
skqulacs/qnn/solver.py | 90.27% <100.00%> (+1.21%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
⚠️⚠️⚠️ There still is a bug related to the observables, I will update here when is solved. Maybe I will also modify the test file to show a circuit where I manually select the observables.
I don't understand why codecov says that a function that I explicitly use in the test_qnn_regressor_grad_descent.py
is not used. Do tests not include my new test file?
It seems that the PR passed all the checks 🥹
I think I followed your advices @ikanago, let me know if I should change other things 🤓
Merged.
Hi, it's Leonardo and this is a list of what I would like to pull: 1) In
skqulacs/circuit/circuit.py
I added a function to perform any multiqubit gate using qulacs base function. 2) Inskqulacs/qnn/solver
I added gradient descent method. 3) Inskqulacs/qnn/regressor
I added:_func_grad
which computes the gradients of the circuit without the cost, I addedobservables_str: List[str] = field(init=True, default_factory=list)
for the class and modified around to make it possible to use. The latter allows to arbitrary select the observable writing them as a string (e.g. "Z 3"). I think it was a bit more complex. Since is initialized as empty list, it does not cause problems in any test code. 4) Inskqulacs/test
I addedtest_qnn_regressor_grad_descent.py
which in the style of the other tests shows that is possible to learn the sin (noisy or not) with batch gradient. Careful, it seems that stochastic gradient does not work, and it may be a simple theoretical reason.Feel free to contact me if there is any error in the codes or PR!