Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include "qelib1.inc";
- qreg q[16];
- creg c[16];
- creg fire[1];
- gate paddle1 qubit
- {
- U(0,0,pi/-1) qubit;
- }
- gate paddle2 qubit
- {
- U(0,0,pi/7) qubit;
- }
- gate redbutton wire
- {
- x wire;
- }
- gate quantumteleportation source, destination, up, left
- {
- h up;
- cx up,destination;
- cx source,up;
- h destination;
- h source;
- cx source,destination;
- z left;
- h destination;
- h source;
- cx up,destination;
- x left;
- h source;
- }
- //player 1
- U(pi/2, 0, 0) q[1];
- cx q[1],q[0];
- //player 2
- U(pi/2, 0, 0) q[3];
- cx q[3],q[2];
- //power pellet
- U(0, 0, 0) q[4];
- U(pi, 0, 0) q[5];
- U(0, 0, 0) q[6];
- U(pi, 0, 0) q[7];
- paddle1 q[0];
- paddle1 q[1];
- U(0,pi/4,0) q[0]; // \ )
- U(0,3*pi/4,0) q[1]; // / )
- paddle2 q[2];
- paddle2 q[3];
- U(pi,pi/4,0) q[2]; // \ /
- U(pi,3*pi/4,0) q[3]; // (___)
- redbutton q[15];
- measure q[15] -> fire[0];
- if(fire==0)
- measure q[0] -> c[0];
- if(fire==0)
- measure q[1] -> c[1];
- if(fire==1)
- quantumteleportation q[0], q[8], q[10],q[11];
- if(fire==1)
- quantumteleportation q[1], q[9], q[12],q[13];
- measure q[2] -> c[2];
- measure q[3] -> c[3];
- measure q[4] -> c[4];
- measure q[5] -> c[5];
- measure q[6] -> c[6];
- measure q[7] -> c[7];
- measure q[8] -> c[8];
- measure q[9] -> c[9];
Advertisement
Add Comment
Please, Sign In to add comment