Exemplo n.º 1
0
    def test_map_type_linear(self):
        """,ap type linear test"""
        ref_map = [[0, 1], [1, 2], [2, 3]]
        entangler_map = get_entangler_map("linear", 4)

        for (ref_src, ref_targ), (exp_src,
                                  exp_targ) in zip(ref_map, entangler_map):
            self.assertEqual(ref_src, exp_src)
            self.assertEqual(ref_targ, exp_targ)
Exemplo n.º 2
0
    def test_map_type_full(self):
        """map type full test"""
        ref_map = [[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3]]
        entangler_map = get_entangler_map("full", 4)

        for (ref_src, ref_targ), (exp_src,
                                  exp_targ) in zip(ref_map, entangler_map):
            self.assertEqual(ref_src, exp_src)
            self.assertEqual(ref_targ, exp_targ)
Exemplo n.º 3
0
 def get_entangler_map(map_type, num_qubits, offset=0):
     """ returns entangler map """
     return get_entangler_map(map_type, num_qubits, offset)