def test_initialize_1(self, device): """Test StatevectorSimulator initialize""" backend = self.backend(device=device) circuits = ref_initialize.initialize_circuits_1(final_measure=False) targets = ref_initialize.initialize_statevector_1() result = backend.run(circuits).result() self.assertSuccess(result) self.compare_statevector(result, circuits, targets)
def test_initialize_1(self): """Test StatevectorSimulator initialize""" circuits = ref_initialize.initialize_circuits_1(final_measure=False) targets = ref_initialize.initialize_statevector_1() qobj = assemble(circuits, shots=1) sim_job = StatevectorSimulator().run(qobj) result = sim_job.result() self.assertTrue(getattr(result, 'success', False)) self.compare_statevector(result, circuits, targets)
def test_initialize_1(self): """Test StatevectorSimulator initialize""" circuits = ref_initialize.initialize_circuits_1(final_measure=False) targets = ref_initialize.initialize_statevector_1() qobj = assemble_circuits(circuits, run_config=RunConfig(shots=1)) sim_job = StatevectorSimulator().run(qobj) result = sim_job.result() self.is_completed(result) self.compare_statevector(result, circuits, targets)
def test_initialize_1(self): """Test StatevectorSimulator initialize""" circuits = ref_initialize.initialize_circuits_1(final_measure=False) targets = ref_initialize.initialize_statevector_1() qobj = assemble(circuits, shots=1) sim_job = self.SIMULATOR.run(qobj, **self.BACKEND_OPTS) result = sim_job.result() self.assertSuccess(result) self.compare_statevector(result, circuits, targets)