qml.measurements.add_shots¶
- add_shots(s1, s2)[source]¶
Add two
Shots
objects by concatenating their shot vectors.- Parameters
- Returns
a
Shots
object built by concatenating the shot vectors ofs1
ands2
- Return type
Example
>>> s1 = Shots((5, (10, 2))) >>> s2 = Shots((3, 2, (10, 3))) >>> print(qml.measurements.add_shots(s1, s2)) Shots(total=60, vector=[5 shots, 10 shots x 2, 3 shots, 2 shots, 10 shots x 3])
code/api/pennylane.measurements.add_shots
Download Python script
Download Notebook
View on GitHub