def test_conditional_gates_132bit(self, method, device): """Test conditional gate operations on 132-bit conditional register.""" shots = 100 cases = ref_conditionals.conditional_cases_132bit() backend = self.backend(method=method, device=device) circuits = ref_conditionals.conditional_circuits_nbit( 132, cases, final_measure=True, conditional_type='gate') targets = ref_conditionals.condtional_counts_nbit(132, cases, shots, hex_counts=False) result = backend.run(circuits, shots=shots).result() self.assertSuccess(result) self.compare_counts(result, circuits, targets, hex_counts=False, delta=0)
def test_conditional_gates_132bit(self): """Test conditional gate operations on 132-bit conditional register.""" shots = 100 cases = ref_conditionals.conditional_cases_132bit() circuits = ref_conditionals.conditional_circuits_nbit( 132, cases, final_measure=True, conditional_type='gate') targets = ref_conditionals.condtional_counts_nbit(132, cases, shots, hex_counts=False) qobj = assemble(circuits, self.SIMULATOR, shots=shots) result = self.SIMULATOR.run(qobj, **self.BACKEND_OPTS).result() self.assertSuccess(result) self.compare_counts(result, circuits, targets, hex_counts=False, delta=0)
def test_conditional_gates_64bit(self, method, device): """Test conditional gate operations on 64-bit conditional register.""" shots = 100 # [value of conditional register, list of condtional values] cases = ref_conditionals.conditional_cases_64bit() backend = self.backend(method=method, device=device) circuits = ref_conditionals.conditional_circuits_nbit( 64, cases, final_measure=True, conditional_type='gate') # not using hex counts because number of leading zeros in results # doesn't seem consistent targets = ref_conditionals.condtional_counts_nbit(64, cases, shots, hex_counts=False) result = backend.run(circuits, shots=shots).result() self.assertSuccess(result) self.compare_counts(result, circuits, targets, hex_counts=False, delta=0)
def test_conditional_gates_64bit(self): """Test conditional gate operations on 64-bit conditional register.""" shots = 100 # [value of conditional register, list of condtional values] cases = ref_conditionals.conditional_cases_64bit() circuits = ref_conditionals.conditional_circuits_nbit( 64, cases, final_measure=True, conditional_type='gate') # not using hex counts because number of leading zeros in results # doesn't seem consistent targets = ref_conditionals.condtional_counts_nbit(64, cases, shots, hex_counts=False) qobj = assemble(circuits, self.SIMULATOR, shots=shots) result = self.SIMULATOR.run(qobj, **self.BACKEND_OPTS).result() self.assertSuccess(result) self.compare_counts(result, circuits, targets, hex_counts=False, delta=0)