This essay has been submitted by a student. This is not an example of the work written by professional essay writers.
Museum

Quantum computing uses quantum mechanical phenomena for computation

This essay is written by:

Louis PHD Verified writer

Finished papers: 5822

4.75

Proficient in:

Psychology, English, Economics, Sociology, Management, and Nursing

You can get writing help to write an essay on these topics
100% plagiarism-free

Hire This Writer

Quantum computing uses quantum mechanical phenomena for computation

aQuestion 1

(a)

Quantum computing uses quantum mechanical phenomena for computation that do not have any classical counterpart. Quantum information processing puts more focus on information computing and handling based on quantum mechanics. While traditional computers employ encoding data in bits(binary digits), the quantum computer goes further, and they are not limited to the two states. Quantum computers use quantum bits or qubits to encode information. The qubits can have the capability of existing in superposition. Qubits have the possibility of being implemented with ions, atoms, electrons, or protons and a control device that operates together to act as a processor and computer memory. In quantum computation and the computation in the quantum circuit model, the quantum logic gate or quantum gate is the primary circuit of quantum that operates on the smaller number of the qubits. Quantum gates are the fundamental of the quantum circuits, as classical logic gates are the building blocks for the conventional digital circuits.

 

(b)(i)The circuit for teleportation protocol

 

The circuit diagram (a) represents the circuit of standard protocol to teleport, |ψA of qubit A to qubit C state. In this diagram, H represents the Hadamard gate, x, and z represent the Pauli matrices σx and σz. The Controlled NOT (CNOT) gate is being represented by the vertical line between the target qubit (⊕) and the control qubit (•).

The circuit diagram (b). in this experiment, the circuit implemented had controlled phase gates, which are shown by the vertical lines between single-qubit rotations R θ ˆ n and the qubits (•).

(ii)

 

#library “library.libq”

……….

void bert(channelEnd[int] c1, qbit stateToTeleportOn) {

int i;

i = recv(c1);

if (i == 1) {

Sigma_z(stateToTeleportOn);

} else if (i == 2) {

Sigma_x(stateToTeleportOn);

} else if (i == 3) {

Sigma_x(stateToTeleportOn);

Sigma_z(stateToTeleportOn);

}

dump_q(stateToTeleportOn);

}

The bert method is declared by //void bert(channelEnd[int] c1, qbit stateToTeleportOn). This method is also capable of receiving a channel end that is used for transferring a qubit and integers as argiments. The qubit must be a particle from the pair of EPR since it is meant to be used for the teleportation. On the second line that is int i;, a variable i of an integer is declared and some value is received as indicated on the next line that is i = recv(c1); from the channel end. Corrections are done as demaned by the protocol of teleportation in the next lines. The last line (dump_q(stateToTeleportOn);) displays the state of the received qubit.

 

(c)

Qiskit is a programming language(python) that allows the user to create and run algorithms for the quantum computer. These algorithms tell the computer the kind of quantum systems to be created, and manipulate them later with gates. The below code of qiskit can be used when the state of the qubits is represented by an integer as the above lanQ code.

From qiskit import QuantumCircuit

from qiskit.extensions.standard import XGate

 

qc = QuantumCircuit(4)

cgate = XGate().control(3, ctrl_state=6)

qc.append(cgate, [0, 1, 2, 3])

 

 

 

 

 

Question 2

(a)

Difference between a functional and an imperative paradigm

There are much difference between the above two paradigms. The discussion below will be concerned with their differences according to style, assignment, source, domain, referential transparency, target, range, and codomain.

In imperative programming, the control flow is very explicit. There is a step by step flow of commands that shows how computation takes place. The computation of global state is affected by each step. On the other hand, in functional programming, there is a combination of function calls to express the control flow rather than an assignment of values to variables.

In imperative programming, values are successfully assigned to variable names. The same name of the variable is associated with other different values. Functional programming only allows a name to be associated with only one value.

Referential transparency can be used in many domains, which include logic, mathematics, philosophy, programming, and linguistics. It has a different meaning in each of the above domains. In functional programming, referential transparency can be defined as an expression that may be replaced by its value without the results in the program changing. The methods used should always return a value that is the same without any effects on the program for the given argument. This concept in functional programming also applies in the imperative programming.

 

(b)

cube : Integer → Integer where cube(n) = n3

The function is total because the argument that is passed into the function of a domain element, and also there is a return value of the passed argument is an element of the codomain.

 

Definition of pure(or uninterpreted) λ – calculus

(i). In terms of identifier

An identifier can be defined as a lambda expression

, for example,  x

(λx.x)

(ii). In terms of application

When there are two lambda expressions, for instance, M and N, the application of M to N can also be called a lambda expression. It can be denoted by (M N)

An example is: ((λx.x) (λy.y))

 

(iii). In terms of abstraction

An abstraction can be  written as (λx.M) with x representing an identifier and M representing a lambda expression is also a lambda expression

 

In BNF grammar rules:

Lambda Expression representsvariable| (M N) | (λx.M)

M represents LambdaExpression

N represents LambdaExpression

 

(c)

Using Lisp

using the following definitions of factorial

n!=1 if n>1

n!=n*(n-1)! If n>1

We can  compute factorials of integers using recursion:

(defun factorial (N)

“Compute the factorial of N.”

{

if (n == 0)

return 1;

return n * factorial(n – 1);

}

 

USER(2): (factorial 4)

0: (FACTORIAL 4)

1: (FACTORIAL 3)

2: (FACTORIAL 2)

3: (FACTORIAL 1)

3: returned 1

2: returned 2

1: returned 6

0: returned 24

24

(d)

Difference between static and dynamic type checking

The main difference between static and dynamic type checking is that in static type checking, the variable type is known before running (compile-time) while in dynamic type checking, the variable type is known while executing(runtime).

 

There are several advantages of static type checking. They include the provision of earlier information on errors, provision of interfaces of components of documentation, elimination of need s for checks type for runtime, and many others. The disadvantage of static type checking is that it may disallow some program that can execute with no error occurring.

 

Dynamic type checking also has several advantages such as there is a faster turnaround since it lacks compile-time, faster to read, it is easy for limping implementation, and many others. The main disadvantage of dynamic type checking is that it may result in a program failure at runtime.

 

(e)

Let f(n) = 3n² – 43n + 16. Show that f(n) = O(n^4).

Choose k = 1. Assuming n > 1

then f(n)/ g(n) = n 2 + 2n + 1 n2 < n 2 + 2n 2 + n 2 n2 = 4 Choose C =4. Note that 2n<2n 2 and 1

  Remember! This is just a sample.

Save time and get your custom paper from our expert writers

 Get started in just 3 minutes
 Sit back relax and leave the writing to us
 Sources and citations are provided
 100% Plagiarism free
error: Content is protected !!
×
Hi, my name is Jenn 👋

In case you can’t find a sample example, our professional writers are ready to help you with writing your own paper. All you need to do is fill out a short form and submit an order

Check Out the Form
Need Help?
Dont be shy to ask