Closed shef4 closed 8 months ago
@shef4 to fix the coverage failure you need to add more tests. tests that will cover the new lines you added, specifically these lines
************* cirq-core/cirq/sim/classical_simulator.py (4 uncovered)
Line 69 is new or changed but not covered: return ClassicalStateTrialResult(
Line 70 is new or changed but not covered: params, measurements, final_simulator_state=final_simulator_state
Line 71 is new or changed but not covered: )
Line 76 is new or changed but not covered: return ClassicalStateStepResult(sim_state)
Found 4 uncovered touched lines.
@NoureldinYosri Thanks for the insight, looking for example test to follow 👍
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Attention: Patch coverage is 99.20000%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 97.76%. Comparing base (
7780c01
) to head (064ae51
).
Files | Patch % | Lines |
---|---|---|
cirq-core/cirq/sim/classical_simulator.py | 98.41% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @NoureldinYosri, in the Qualtran meeting I think it was mentioned that Classical Simulators are signed int types.
Would it be better to use the original _run()
function and set state_type = Type[int]
or state_type = type(int)
as a default value in the constructor? - All tests pass except for the ones I added, might cause coverage issues.
these are two different things the state_type
is the name of the class that will store the simulation state, this type should be a subclass of SimulationState
class.
the conversation in the qualtran sync was about quantum number/registers. quantum numbers aren't represented explicitly in Cirq. Cirq deals with the qubits directly while Qulatran groups qubits to form registers that can then be used to represent numbers which can be signed/unsigned, integer/float, ..etc. Cirq and Qualtran are two different libraries and have different scopes.
Hi @NoureldinYosri, I'm not sure what is causing this CI fail, any insight would be really appreciated.
FAILED dev_tools/docker_test.py::test_docker_pre - assert 1 == 0
+ where 1 = CompletedProcess(args=['docker run cirq_image_pre python -c "import cirq; assert cirq.__version__ is not None"'], returncode=1).returncode
= 1 failed, 20135 passed, 146 skipped, 86 xfailed, 726 warnings in 365.34s (0:06:05) =
@shef4 I temporarily supressed that test because it is failing at head.
@NoureldinYosri Thanks, glad to know it's working. Learnt some interesting concepts from this issue!
Related issue - #6343