0% found this document useful (0 votes)
19 views16 pages

Virtual Lab Experiments For CSE Stream 2024-25

Uploaded by

shreeharshastark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views16 pages

Virtual Lab Experiments For CSE Stream 2024-25

Uploaded by

shreeharshastark
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Dept.

of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

Quantum gates using simulation


Aim: To realise quantum gates using simulation method and to draw the truth tables.

Link: https://algassert.com/quirk
Single Qubit Gates

1. X Gate or quantum NOT gate:

It is represented by the matric X as

0 1 
x  X  
1 0

0 1 1 0 + 0 0 
X 0 =   =   =  = 1
1 0 0 1 + 0  1

0 1 0  0 + 1 1
X 1 =   =  =  = 0
1 0 1 0 + 0 0
Truth table for Pauli X gate or quantum NOT gate
Input Out put
0
1
 0 +1

X
Input  0 +  1 otuput  1 +  0

Figure: X gate
2. Y gate:

It is represented by the matric Y as;

0 − i 
 y Y  
i 0 

0 − i  1 0 + 0 0
Y 0 = = = =i 1
i 0  0  i + 0   i 

0 − i  0   0 − i  1
Y 1 =    =  = − i  = − i 0
i 0  1 0 + 0 0 

1
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

0 − i     0 − i  − i 
Y (  0 +  1 )=  = = = i 1 − i 0
i 0     i + 0  i 

Truth table for Y gate


Input Out put
0
1
 0 +1

Y
Input  0 +  1 out put i 1 − i 0

Figure: Y gate
3. Z gate:

The Z gate is defined as


1 0
Z  Z   
0 − 1

1 0  1 1 + 0  1
Z 0 =   =  =  = 0
0 − 1 0 0 + 0 0

1 0  0   0 + 0   0 
Z 1 =   =  = =− 1
0 − 1 1  0 − 1 −1

1 0     + 0   
Z (  0 +  1 )=    =  =  = 0 −  1
0 − 1    0 −   −  
Truth table for Y gate
Input Out put
0
1
 0 +1

Z
Input  0 +  1 output  0 −  1

Figure: Z gate
4. Phase Gate (or S Gate):

2
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

The Phase gate or S gate can be defined as


1 0
S 
0 i 

It effect on 0 is

1 0 1 1 + 0  1
S 0 =   =  = = 0
 0 i   0  0 + 0   0 

i.e output is 0

It effect on 1 is

1 0 0 0 + 0  0  0 
S 1 =   =   =   = i  = i 1
0 i  1  0 + i   i  1

i.e output is i 1

1 0     + 0    
S(  0 +  1 )=    =   =   =  0 + i 1
 0 i      0 + i   i  

i.e output is  0 + i 1

Truth table of S gate


Input Out put
0
1
 0 +1

S
Input  0 +  1 Output  0 + i 1

Figure: S gate

Multiple Qubit Gates

1. Controlled gate / CNOT gate:

The multi-qubit quantum logic gate is the controlled NOT or CNOT gate. The circuit of the
CNOT gate is shown in figure. The gate has two input qubits. (1) Control qubit and (2) Target
qubit.

Control qubit

3
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

a a

b ba
Target qubit
Figure. CNOT gate
If the control qubit of the gate is set to 0, then the target qubit is not altered. If the control qubit
is set to 1, then the target qubit is inverted. The figure shows a control gate with the control
qubit a and target qubit b .

(1) Input state 0 0 (Control qubit = 0, Target qubit = 0)

Both the bits remain unaltered. Hence, the output state is the same as the input state or

00 → 00

(2) Input state 01 (Control qubit = 0, Target qubit = 1)

Both the bits remain unaltered. Again, the output state is the same as the input state or

01 → 01

(3) Input state 1 0 (Control qubit = 1, Target qubit = 0)

The target qubit is flipped to 1. Therefore, the output state has both qubits 1, or

1 0 → 11

(4) Input state 11 (Control qubit = 1, Target qubit = 1)

The target qubit is flipped to 0. Therefore, the output state becomes 1 0 , or

11 → 10
CNOT can be represented in the matrix form as
1 0 0 0
0 1 0 0
U CN =
0 0 0 1
 
0 0 1 0

Truth table of a CNOT gate


Input Out put
00
01
10
11

4
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

2. Swap gate:
The swap gate is a simple quantum circuit containing three quantum gates. The circuit is read
from left to right and each line represents a quantum passage, maybe of time, perhaps a physical
particle such as a photon or a particle of light to move from one location to another space.

1 0 0 0
0 0 1 0
U SWAP =
0 1 0 0
 
0 0 0 1

Swap gate equivalent schematic symbol notation

Figure. Swap gate


The output of the first CNOT gate is a, b → a, a  b .

This is fed as input to the second gate which also does modulo 2 addition but the result is placed
in the first qubit now.

Its output becomes a  (a  b),), a  b = b, a  b

This is now fed to the third gate which performs modulo 2 addition and places the result in the
second qubit.

The output finally becomes b, (a  b)  b, ) = b, a .

Thus, the overall effect is that the two qubits have been swapped.

Truth table of a swap gate


Input Out put
00
01
10
11

5
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

3. Controlled -Z gate:
The controlled-Z gate is another example of a controlled gate, i.e. gates in which the operation
is of the kind “If A is true, then do B”.

Control qubit

Target qubit Z

Figure. Controlled Z-Gate


The action of a controlled Z-gate is specified as follows.
1 0 0 0
0 1 0 0 
UZ = 
0 0 1 0
 
0 0 0 − 1

1 0 0 0  1 1
0 1 0 0  0 0
U Z 00 =  = = 00
0 0 1 0  0  0 
    
0 0 0 − 1 0 0

1 0 0 0  0  0 
0 1 0 0  1 1
U Z 01 =  = = 01
0 0 1 0  0  0 
    
0 0 0 − 1 0 0

1 0 0 0  0  0 
0 1 0 0  0 0
U Z 10 =  = = 10
0 0 1 0  1 1
    
0 0 0 − 1 0 0

1 0 0 0  0   0 
0 1 0 0  0  0 
U Z 11 =  = = − 11
0 0 1 0  0   0 
    
0 0 0 − 1 1 − 1

6
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

Truth table of a controlled Z-gate


Input Out put
00

01

10

11

4. Toffoli gate (CCNOT, CCX, TOFF):

Any classical logic circuit can be build using a quantum circuit. Any classical circuit can be
replaced by an equivalent circuit containing only reversible element, by using a reversible gate
called Toffoli Gate.

Control qubit a a

Control qubit b b

Target qubit c c  ab

Figure. Toffoli gate


The Toffoli gate has three input bits ( a , b and c ) and three output bits ( a , b and c ).

The first two bits are control bits which remain unaffected by the action of the Toffoli gate.
The third is the target bit which is inverted if both the control bits are 1; else it is left unchanged.

Input Output
a b c a b c

0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
1 1 0 1 1 1
1 1 1 1 1 0

7
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

The Toffoli gate is its own inverse since applying it once to the input, a, b, c gives the output,
a, b, c  ab .

Applying it to another Toffoli gate gives the output


a, b, (c  ab)  ab = a, b, c

As the modulo-2 sum of a number with itself gives 0. Hence, the Toffoli gate is a reversible
gate and is its own inverse.

8
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

Energy Band Gap of Semiconductor by simulation method


AIM: To Determine Energy Band Gap of Semiconductor by simulation method using the link
provided by virtual lab experiments designed by IITs.
Theory: In the case of insulators, the region between highest level of filled valence band and
the lowest level of allowed conduction band is very wide. This is called energy gap, denoted
by Eg and is about 3 eV to 7 eV in case of insulators. In case of semiconductors, this energy
gap is quite small. For example, in case of germanium, Eg =0.7 eV and in case of silicon Eg =1.1
eV. In semiconductors at low temperatures, there are few charges carriers to move so
conductivity is quite low. At higher temperatures, the donor or acceptor levels come into action
and provide charge carriers and hence the conduction increases. In addition to the dependence
of the electrical conductivity on the number of free charges, it also depends on their mobility.
However, mobility of the charge carriers somewhat decreases with increasing temperature but
on the average the conductivity of the semiconductors rises with increasing temperature. To
determine the energy gap of a semi-conducting material, we study the variation of its
conductance with temperature. In reverse bias, the currents flowing through the junction are
quite small and internal heating of the junction does not take place.

In the reverse bias, the saturated value of the reverse current for a PN junction diode is given
by,
Is =A.T3/2 e -Eg/KT _ _ _ _ _(1)

Where,
A= constant term
Is = saturation current in micro ampere
T = temperature of junction diode in Kelvin
Eg = band gap in eV
K = Boltzmann constant in eV per Kelvin
For small changes in temperature where log T can be treated as constant relation (1) can be
written as
log10Is = constant – 5.04 Eg x 103 /T_ _ _ _ (2)
Graph between 103 /T as abscissa and log10Is as ordinate will be a straight line having a slope
= 5.04Eg
Hence band gap
Eg = slope of the line / 5.04

9
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

Circuit diagram
Experimental procedure:
• Open the link provided by the virtual lab by clicking on the https://bop-
iitk.vlabs.ac.in
• Click the “Enable Power” button.
• Choose the correct image.
• After correct answer “X” (cross) the image.
• Click the “Place Container” button and then click on the drawing box.
• Click on “Battery” button and then click to drawing box.
• Click on “Ammeter” button and then click on drawing box.
• Click on “Voltmeter” button and then click on drawing box.
• Click on “PN Junction” button and then click on liquid inside container.
• Click on “Point” button and then click on drawing board wherever point connections
are required.
• Click on “Connect” button and then click on point to be connected to complete the
circuit diagram.
• Click on “Undo/Redo” button in case of wrong connections.
• Select voltage from the drop-down button.
• After selecting voltage press the “Click” button.
• Draw the slider to choose temperature.
• Click on “Find here” button to get reverse saturation current.
• Repeat this process to complete the observation table.
• Click “Calculate Data” button.
• Click on “Draw Graph” button.
• Place the cursor on the plotted graph to enter the value of first and second coordinate.
• Click on “Find Slope” button.
• Enter the value of calculated slope.
• Click “Calculate” button to get the value of Energy Band Gap.

10
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

SAMPLE EXPERIMENT:

Tabular column:

Sl.No. Temperature(oC Current Is (µA) Temperature(oK) 103/T Log10 Is


)
01 52 15.074 325 3.08 1.178
02 62 20.011 335 2.99 1.301
03 72 26.132 345 2.90 1.417
04 82 33.616 355 2.82 1.527
05 92 42.651 365 2.74 1.630
06 42 11.513 315 3.17 1.061
07 32 8.090 305 3.28 0.908
08 22 5.742 295 3.39 0.759

Sample graph:

Calculated Slope is -0.746


Enter value of Slope calculated above in the below box
Energy Band Gap (Eg) = slope /5.04

11
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

Result: Energy Band Gap of the given semiconductor by using the simulation method is found
to be = -------------------eV.

12
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

Study of projectile motion of a body Using Spreadsheets


AIM: To study the motion of a projectile using spread sheet and hence to find maximum height
and range of the projectile motion.

APPARATUS: spreadsheet (Excel sheet)


PRINCIPLE: A projectile is any object thrown into space upon which the only acting force is
gravity. The path followed by a projectile is known as a trajectory. A ball thrown into space is
an example of a projectile motion. When a particle is projected in the air with some speed, the
only force acting on it during its time in the air is the acceleration due to gravity (g). This
acceleration acts vertically downward. There is no acceleration in the horizontal direction,
which means that the velocity of the particle in the horizontal direction remains constant.
FORMULA:
Let us consider a ball projected at an angle θ with respect to the horizontal x-axis with the
initial velocity V0 as

The equations of motion of the projectile are given by


1. Vx = V0 Cosθ

2. Vy = V0 Sinθ

3. X = Vx . t

4. Y = Vy t – ½ g t2
Where,
V0 is the initial velocity of the projectile.
 is the angle of projection.
g is acceleration due to gravity
t is the time interval

13
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

Horizontal range is given by


𝑉02 sin 2𝜃
𝑅= ----- m
𝑔

Maximum height is given by


𝑉02 Sin2 𝜃
𝐻= ---- m
2𝑔

PROCEDURE:
• Open a Microsoft excel sheet. Enter the initial values like initial velocity V0 (say 100
m/s), angel of projection θ (say 60o), time interval dt (say 0.1 sec) and acceleration due
to gravity g = 9.8 m/s2 in the excel sheet as shown in tabular column 1.

Vo 100 m/s
Angle 60 deg
g 9.8 m/s2
dt 0.10 sec

Tabular column 1
• Create a tabular column as shown in column 2to in the excel sheet and enter the formula
for Vx, Vy, X and Y measurements using excel commands.

Time Vx Vy X Y
=C$2*COS(RADIANS(C$3)) =C$2*SIN(RADIANS(C$3)) 0 0
=D8+B8*C$5 =E8+C8*C$5

• By choosing the columns X and Y, plot the graph as shown below.

200.00

150.00

100.00

50.00

0.00
0.00 200.00 400.00 600.00 800.00

14
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

• From the graph note down the values of maximum height and range of the projectile
motion.
• Calculate the maximum height and range by using formulas. Compare these with
graphical values.
• Repeat the procedure for different values of angle of projections say 45o and 30o.
• Compare the plots of different values of angle of projections and tabulate the result in
the tabular column.

RESULT :
The projectile motion is studied using spreadsheet for different values of projection angles θ
and the values of maximum height H and range R are as tabulated.

θ Theoretical Graphical Theoretical Graphical


value of H values of H(m) value of R (m) values of R (m)
(m)
30o
45o
65o

15
Dept. of Physics Virtual Lab experiments procedure CSE Stream AY: 2024-25

Creating animated videos using software


AIM: To create animated videos using the virtual lab links in simulation method
Theory: Write down about the process to make the animated video like character, text, images,
contents, etc. for each slide. There should be minimum 5 slides and minimum time limit to be
2 min.

Procedure:
Follow these steps to create an awesome animated video and make learning fun.
https://www.animaker.com/hub/animated-educational-videos/
Click on: https://www.animaker.com/educational-video-maker

• Step 1 - Create an Account


• Step 2 - Exploring the Animaker Dashboard and Interface
• Step 3 - Creating the first scene
• Adding a Character:
• Adding a Background
• Adding Text:
• Adding Properties:
• Adding voice-over to the character
• Adding Background narration voice
• Controlling the scene duration
• Step 4 - Add/Delete/Duplicate scenes
• Step 5 - Creating the second scene
• Step 6 - Add transition effects
• Step 7 - Add Music tracks
• Step 8 - Preview and Download the video
• Step 9- Share the video to your e-mail

Show the video to the faculty.


Result: Write down about the animated video and take the print of slides and paste in lab
record.
Reference:
Follow these links before start the experiment
https://youtu.be/NH_xoB4zlfs?si=6aa9oCU7b6_pOlwU
https://app.animaker.com/animo/VXM6lsoLEOF3Smrg/

16

You might also like