Grover’s Search Algorithm in Python

As you may have read in some previous post I am actually working on a modified version of the Grover‘s Algorithm. For those who don’t know the principles of Grover’s Algorithm, here is a quick explanation.

We have a function $$f : \mathbb{Z}_2^n\rightarrow \mathbb{Z}_2$$ that is True for only one $$a \in \mathbb{Z}_2^n$$. We also have a quantum oracle that returns the value of the function f. Classicaly, finding the value of $$a$$ will take n-1 steps. With the quantum version (Grover’s Algorithm) it takes only $$\sqrt{n}$$ steps.

»

Python et Google PageRank

pythonSuite à mes recherches pour trouver un script de calcul de Pagerank en python, je souhaitais vous présenter deux pages qui me sont tombées sous les yeux.

»

Numpy error – ValueError: setting an array element with sequence

You have struggled during hours and hours to understand why you got this damned error while compiling a complex array structure? I did. In my case I was trying to create an array of the following shape :

[  [ [0,0,1,0] , 0.5] , [ [0,1,1,0] , 0.3] , [ [1,0,1,0] , 0.2] ]

With the basic syntax, it was impossible. I first didn’t notice the problem because I wasn’t using the ‘array‘ constructor, but when I tried to append some value to my initial vector, I got the error : ValueError: setting an array element with sequence. »

La panoplie du petit chercheur

A tout ceux qui veulent se lancer dans des sujets scientifiques ou l’on demandera de coder des choses nouvelles, je conseille le logiciel Python(x,y) qui integre en son sein toutes les bibliotheques python que vous pourrez surement demander un jour.

A telecharger ici : http://www.pythonxy.com

»

Extraire les URLs des résultats Google en python

J’ai passé une bonne partie de l’après-midi à me former à Python. Comme exercice je voulais adapter le script de Tiger sur l’extraction de résultats sur google, en traduisant le php en python.

J’ai eu quelques soucis à cause d’erreurs d’innatention et de bêtises de codage, mais au final j’ai réussi. Le code suivant (Python 3.0) vous donne le même résultat (sans la mise en forme) que le script de Tiger. »