Well, this article is from ACM TechNews , abt the first programmable quantum computer
Using a few ultracold ions, intense lasers and some electrodes, researchers have built the first programmable quantum computer. The new system, described in a paper to be published in Nature Physics, flexed its versatility by performing 160 randomly chosen processing routines.
Earlier versions of quantum computers have been largely restricted to a narrow window of specific tasks. To be more generally useful, a quantum computer should be programmable, in the same way that a classical computer must be able to run many different programs on a single piece of machinery.
The new study is “a powerful demonstration of the technological advances towards producing a real-world quantum computer,” says quantum physicist Winfried Hensinger of the University of Sussex in Brighton, England.
Researchers led by David Hanneke of the National Institute of Standards and Technology in Boulder, Colo., based their quantum computer on two beryllium ions chilled to just above absolute zero. These ions, trapped by an electromagnetic field on a gold-plated alumina chip, formed the quantum bits, or qubits, analogous to the bits in regular computers represented by 0s and 1s. Short laser bursts manipulated the beryllium ions to perform the processing operations, while nearby magnesium ions kept the beryllium ions cool and still.
Hanneke and colleagues programmed the computer to do operations on a single beryllium ion and on both of the beryllium ions together. In the quantum world, a single qubit can represent a mixture of 0 and 1 simultaneously, a state called a superposition. A laser pulse operation could change the composition of the mixture within the qubit, tipping the scales to make the qubit more likely to become a 1 when measured.
Both of the qubits together could be entangled, a situation where the two qubits are intimately linked, and what happens to one seems to affect the fate of the other. Different combinations of one- and two-qubit operations made up various programs. “We put all these pieces together and asked, what can we do with the circuit?” Hanneke says.
Hanneke and colleagues chose 160 programs for the quantum computer to run. “We picked them, quite literally, at random,” Hanneke says. “We really wanted to sample all possible operations.”
The researchers ran each program 900 times. On average, the quantum computer operated accurately 79 percent of the time, the team reported in their paper, which was published online November 15. “Getting this kind of control over a quantum system is really interesting from a physics perspective,” Hanneke says.
Earlier research has estimated that to be useful, a quantum computer must operate accurately 99.99 percent of the time. Hanneke says that with stronger lasers and other refinements, the system’s fidelity may be improved.
Experimental physicist Boris Blinov says that one of the most exciting things about the new study is that the quantum computer may be scaled up. “What’s most impressive and important is that they did it in the way that can be applied to a larger-scale system,” says Blinov, of the University of Washington in Seattle. “The very same techniques they’ve used for two qubits can be applied to much larger systems.”
Thursday, December 31, 2009
Thursday, November 26, 2009
Program 2 find the balancing factor of a node in an AVL tree
/*
*Program to calculate the balancing factor of an AVL Tree
*/
/**
*Assumptions to run this program:
*no data of a node is set to 0
*/
#include
#include
#include
#define array_max 100
//function declaration
int left(int);//return the location of left child
int right(int);//returns the location of right child
int traverse(int,int); //traverses to the specific location and returns the position
void postOrder(int);//
int calculateHeight(int);
int compareHeight(int,int);//generates the height of a tree
//stores the tree in an array
int tree[100];
//stores the inorder of an array
int temp_array[100] = {0};
//declare left function
int left(int node)
{
return 2*node+1;
}
int right(int node)
{
return 2*node+2;
}
//initilizes all elements to zero
tree[100]={0};
//traverse to d element and return the index of element in that array
int traverse(int item,int n)
{
if(tree[n] == item)
return n;
else if(tree[n] < item)
{
n=left(n);
traverse(item,n);
return n;
}
else
{
n=right(n);
traverse(item,n);
return n;
}
}
//compares the height of a tree
int compareHeight(int position,int start)
{
int l,r;
l=2*start+1;
r=2*start+2;
if(position == l)
return start+1;
else if(position == r)
return start+1;
else
{
compareHeight(position, l);
compareHeight(position, r);
}
}
//calculate the post order traversal of the tree and return the index of last element
void postOrder(int pos)//pos stores the index of root node
{
int i;
i=0;
if(tree[pos != 0])
{
temp_array[i]=pos;
postOrder(left(pos));
postOrder(right(pos));
}
}
int calculateHeight(int element)
{
int i,pos;
i=0;
while(temp_array[i] != 0)
{
i++;
}
i--;
pos = compareHeight(temp_array[i],0);
return pos;
}
//main function goes here.................
int main()
{
int i,temp;
i=0;
int position;
int height1,height2;
int balancingFactor;
printf("Caution: This program assumes that none of the element in a tree is #define array_max 1000\n");
printf("Caution: The tree which you are entering must be a AVL Tree\n");
printf("Enter the elements of the array\n");
printf("Enter 0 to exit\n");
printf("Dont Enter any element as 0\n");
do
{
scanf("%d",&temp);
if(temp != 0)
{
tree[i]=temp;
}
}while(temp != 0);
printf("Enter the element to find the balancing factor\n");
scanf("%d",&temp);
position=traverse(temp,0);
height1=calculateHeight(left(position));
height2=calculateHeight(right(position));
balancingFactor=height1-height2;
printf("The balancing factor of that element is %d",balancingFactor);
return 0;
}
u may modify this program & implement using linked list
*Program to calculate the balancing factor of an AVL Tree
*/
/**
*Assumptions to run this program:
*no data of a node is set to 0
*/
#include
#include
#define array_max 100
//function declaration
int left(int);//return the location of left child
int right(int);//returns the location of right child
int traverse(int,int); //traverses to the specific location and returns the position
void postOrder(int);//
int calculateHeight(int);
int compareHeight(int,int);//generates the height of a tree
//stores the tree in an array
int tree[100];
//stores the inorder of an array
int temp_array[100] = {0};
//declare left function
int left(int node)
{
return 2*node+1;
}
int right(int node)
{
return 2*node+2;
}
//initilizes all elements to zero
tree[100]={0};
//traverse to d element and return the index of element in that array
int traverse(int item,int n)
{
if(tree[n] == item)
return n;
else if(tree[n] < item)
{
n=left(n);
traverse(item,n);
return n;
}
else
{
n=right(n);
traverse(item,n);
return n;
}
}
//compares the height of a tree
int compareHeight(int position,int start)
{
int l,r;
l=2*start+1;
r=2*start+2;
if(position == l)
return start+1;
else if(position == r)
return start+1;
else
{
compareHeight(position, l);
compareHeight(position, r);
}
}
//calculate the post order traversal of the tree and return the index of last element
void postOrder(int pos)//pos stores the index of root node
{
int i;
i=0;
if(tree[pos != 0])
{
temp_array[i]=pos;
postOrder(left(pos));
postOrder(right(pos));
}
}
int calculateHeight(int element)
{
int i,pos;
i=0;
while(temp_array[i] != 0)
{
i++;
}
i--;
pos = compareHeight(temp_array[i],0);
return pos;
}
//main function goes here.................
int main()
{
int i,temp;
i=0;
int position;
int height1,height2;
int balancingFactor;
printf("Caution: This program assumes that none of the element in a tree is
printf("Caution: The tree which you are entering must be a AVL Tree\n");
printf("Enter the elements of the array\n");
printf("Enter 0 to exit\n");
printf("Dont Enter any element as 0\n");
do
{
scanf("%d",&temp);
if(temp != 0)
{
tree[i]=temp;
}
}while(temp != 0);
printf("Enter the element to find the balancing factor\n");
scanf("%d",&temp);
position=traverse(temp,0);
height1=calculateHeight(left(position));
height2=calculateHeight(right(position));
balancingFactor=height1-height2;
printf("The balancing factor of that element is %d",balancingFactor);
return 0;
}
u may modify this program & implement using linked list
Saturday, November 21, 2009
Opera Dragonfly
Today I tried the opera dragonfly. its a developer tool that helps you to inspect elements in a web page and of course you can modify the code according to your requirements and design your own website. Great tool for web developers.
To use, you just need to download the DebugMenu.ini on your opera browser and then use it by clicking on Debug Menu.
link http://dragonfly.opera.com/app/debugmenu/DebugMenu.ini
To use, you just need to download the DebugMenu.ini on your opera browser and then use it by clicking on Debug Menu.
link http://dragonfly.opera.com/app/debugmenu/DebugMenu.ini
Wednesday, November 18, 2009
Recursive Quicksort
Hi !!!
This is an algorithmn to quicksort an array on n numbers
Quicksort(Array A, first, last)
{
middle=lowerbound(first+last/2);
Quicksort(A,first, middle);
Quicksort(A, middle+1, last);
}
post an iterative solution to it....
This is an algorithmn to quicksort an array on n numbers
Quicksort(Array A, first, last)
{
middle=lowerbound(first+last/2);
Quicksort(A,first, middle);
Quicksort(A, middle+1, last);
}
post an iterative solution to it....
Subscribe to:
Posts (Atom)
