File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
test/python/plugins/qiskit Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -162,19 +162,17 @@ def test_estimator_broadcasting(backend_with_mock_jobs: QDMIBackend) -> None:
162162 # 2 Observables
163163 ops = [SparsePauliOp ("Z" ), SparsePauliOp ("X" )]
164164
165- # 3 Parameter sets
166- # Broadcast: 2 observables x 3 parameters.
167- # To test broadcasting, we reshape to make them compatible for outer product.
168- # Params: shape (3, 1) (via bindings array reshape or just repeating ops)
169- # But EstimatorPub.coerce is strict.
170- # Let's align shapes to (2,) for simplicity in this test
165+ # 2 Parameter sets (shape (2,) / two values)
166+ # Test asserts broadcasting for 2 observables x 2 parameter sets
167+ # We align shapes to (2,) so they broadcast element-wise.
171168 vals = [[0.0 ], [np .pi ]]
172169
173170 pub = EstimatorPub .coerce ((qc , ops , vals )) # type: ignore[arg-type]
174171 job = estimator .run ([pub ])
175172 result = job .result ()
176173
177174 data = cast ("Any" , result [0 ].data )
175+ # Shape expectations: (2,) result from broadcasting
178176 assert data .evs .shape == (2 ,)
179177 assert data .stds .shape == (2 ,)
180178
You can’t perform that action at this time.
0 commit comments