d154be3a085fc40bb8540ddf285a8adfc90aa868,test/test_bernsteinvazirani.py,TestBernsteinVazirani,test_bernsteinvazirani,#TestBernsteinVazirani#Any#,35

Before Change


    ])
    def test_bernsteinvazirani(self, bv_input):
        nbits = math.log(len(bv_input), 2)
        if math.ceil(nbits) != math.floor(nbits):
            raise AquaError("Input not the right length")
        nbits = int(nbits)

After Change


            bit = bv_input[2 ** i]
            parameter += bit

        for optimization_mode in [None, "simple"]:
            backend = get_aer_backend("qasm_simulator")
            oracle = TruthTableOracle(bv_input, optimization_mode=optimization_mode)
            algorithm = BernsteinVazirani(oracle)
            result = algorithm.run(backend)
            // print(result["circuit"].draw(line_length=10000))
            self.assertEqual(result["result"], parameter)


if __name__ == "__main__":
    unittest.main()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: d154be3a085fc40bb8540ddf285a8adfc90aa868
Time: 2019-02-15
Author: shaohan.hu@ibm.com
File Name: test/test_bernsteinvazirani.py
Class Name: TestBernsteinVazirani
Method Name: test_bernsteinvazirani


Project Name: ilastik/ilastik
Commit Name: f5bc12bdb54dfd6fecc8eb2b70cd294ef52b4f39
Time: 2014-01-03
Author: webmaster@burgerdev.de
File Name: ilastik/applets/thresholdTwoLevels/thresholdTwoLevelsGui.py
Class Name: ThresholdTwoLevelsGui
Method Name: _updateOperatorFromGui


Project Name: NifTK/NiftyNet
Commit Name: c8b28432a637a780eed96547260722ff3dede57e
Time: 2017-10-04
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/sampler_selective.py
Class Name:
Method Name: rand_choice_coordinates


Project Name: facebookresearch/ParlAI
Commit Name: 892b037877b91d47df552079fa4463ee742104ee
Time: 2018-05-31
Author: kulikov@fb.com
File Name: parlai/scripts/train_model.py
Class Name: TrainLoop
Method Name: validate