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 for simulate_tree_mcm #6231

Merged
merged 26 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7740a41
init_tests
obliviateandsurrender Sep 6, 2024
58676a3
add tests
obliviateandsurrender Sep 6, 2024
1c18eb4
add more tests
obliviateandsurrender Sep 10, 2024
e6faa7b
happy `isort`
obliviateandsurrender Sep 10, 2024
b6861f7
Merge branch 'master' into tree_mcm_tests
obliviateandsurrender Sep 10, 2024
726e45e
happy `pylint`
obliviateandsurrender Sep 10, 2024
6214f74
tweak test
obliviateandsurrender Sep 10, 2024
348bdf3
fix `shots`
obliviateandsurrender Sep 10, 2024
2269b1f
add `marker`
obliviateandsurrender Sep 10, 2024
e0a20e0
add more unit tests
obliviateandsurrender Sep 14, 2024
c5f962b
fix `isort`
obliviateandsurrender Sep 14, 2024
caf70ba
Merge branch 'master' into tree_mcm_tests
obliviateandsurrender Sep 14, 2024
599b7e2
Merge branch 'master' into tree_mcm_tests
obliviateandsurrender Sep 17, 2024
e250c89
add another test
obliviateandsurrender Sep 18, 2024
5639b52
Merge branch 'tree_mcm_tests' of https://github.com/PennyLaneAI/penny…
obliviateandsurrender Sep 18, 2024
9255508
skip `tf`
obliviateandsurrender Sep 18, 2024
85c902b
revert `tf`
obliviateandsurrender Sep 18, 2024
2a4bea2
fix post selection
obliviateandsurrender Sep 18, 2024
875dbbd
Merge branch 'master' into tree_mcm_tests
obliviateandsurrender Sep 19, 2024
a84a6a9
shifting marker to test `class`
obliviateandsurrender Sep 19, 2024
3705690
apply suggestions
obliviateandsurrender Sep 19, 2024
6128b35
Merge branch 'master' into tree_mcm_tests
obliviateandsurrender Sep 19, 2024
aa045f3
reliable one-shot?
obliviateandsurrender Sep 19, 2024
20499eb
happier `one_shot`?
obliviateandsurrender Sep 19, 2024
833a101
Merge branch 'master' into tree_mcm_tests
obliviateandsurrender Sep 19, 2024
387b101
Merge branch 'master' into tree_mcm_tests
obliviateandsurrender Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pennylane/devices/qubit/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ def prepend_state_prep(circuit, state, interface, wires):
else state
)
return qml.tape.QuantumScript(
[qml.StatePrep(state.ravel(), wires=wires, validate_norm=False)] + circuit.operations,
[qml.StatePrep(qml.math.ravel(state), wires=wires, validate_norm=False)]
+ circuit.operations,
circuit.measurements,
shots=circuit.shots,
)
Expand Down Expand Up @@ -942,7 +943,7 @@ def _(original_measurement: ProbabilityMP, measures): # pylint: disable=unused-

@combine_measurements_core.register
def _(original_measurement: SampleMP, measures): # pylint: disable=unused-argument
"""The combined samples of two branches is obtained by concatenating the sample if each branch.."""
"""The combined samples of two branches is obtained by concatenating the sample of each branch."""
new_sample = tuple(
qml.math.atleast_1d(m[1]) for m in measures.values() if m[0] and not m[1] is tuple()
)
Expand Down
Loading
Loading