The algorithm to prepare an arbitrary vector of length 2n takes roughly that many gates. (e.g. 23≈10)
wires =[0,1,2] defcircuit(x): qml.AmplitudeEmbedding(x, wires) dev = qml.device("default.qubit", wires=wires) qnode = qml.QNode(circuit, dev) # Random vector of length 8 (for 3 qubits) x = np.random.rand(8) # Normalize the vector to have unit length (required for quantum states) x = x/np.sqrt(np.sum(x**2)) qml.draw_mpl(qnode)(x); qml.draw_mpl(qml.transforms.decompose(qnode), decimals=3)(x);
from pytket.circuit import StatePreparationBox from pytket.circuit.display import render_circuit_jupyter as draw state_circ = pytket.circuit.Circuit(3) # Example 3-qubit state to prepare w_state =1/ np.sqrt(3)* np.array([0,1,1,0,1,0,0,0]) w_state_box = StatePreparationBox(w_state) state_circ.add_gate(w_state_box,[0,1,2]) draw(state_circ) pytket.transform.Transform.DecomposeBoxes().apply(state_circ) draw(state_circ)
Basis encoding maps each classical bit to a qubit, with 0 mapped to ∣0⟩ and 1 mapped to ∣1⟩.
To encode 1011, we need X gates on qubits 0, 2, and 3 (assuming qubit 0 is the most significant bit).
Applying an H gate (Hadamard gate) to each qubit puts the system in a uniform superposition over all basis states.
Amplitude encoding of an arbitrary vector of size 2n generally requires O(2n) gates.
In angle encoding, each classical value xi becomes the rotation angle of an RY gate on the i-th qubit.
Using the binary conversion formula, the decimal number 5 maps to ∣101⟩ for 3 qubits.
In short, in quantum addition, the sum is an XOR operation, and the carry is an AND operation.
A quantum half-adder must keep the original inputs to remain reversible and maintain its unitary nature.
The Toffoli gate is defined as: ∣a⟩∣b⟩∣c⟩↦∣a⟩∣b⟩∣c⊕a⋅b⟩.
A full-adder should produce a carry-out as follows: cout=a⋅b⊕a⋅cin⊕b⋅cin.
The following operation is reversible: ∣a⟩∣b⟩∣c⟩↦∣a⟩∣a⊕b⟩∣c⊕a⋅b⟩.
For addition "in superposition," measuring the output register yields exactly one of the partial sums, chosen probabilistically.
The MAJ circuit computes the majority function as: a⋅b⊕a⋅c⊕b⋅c.
The QASM snippet for a half-adder uses ccx q[0], q[1], q[2] to compute the carry (a⋅b) and a cx q[0], q[1] (or cx q[1], q[0]) gate to compute the sum (a⊕b).
Quantum multiplication can be implemented via conditional addition, one per multiplier bit.
OPENQASM2.0; qreg q[2]; creg c[2]; // Prepare Bell pair h q[0]; cx q[0],q[1]; // Alice's encoding // For message 11: apply X and Z x q[0]; z q[0]; // Alice sends q[0] to Bob (in simulation, we just proceed) // Bob's decoding cx q[0],q[1]; h q[0]; // Measure both qubits measure q[0]-> c[0]; measure q[1]-> c[1];
# Alice's encoding for message '11' superdense.x(0) superdense.z(0) superdense.draw()
# Bob unentangles the two qubits (reverses the entangling gate) superdense.cx(0,1) superdense.h(0) # The measurement pattern is `measure(qubit to measure, classical bit to store result)` superdense.measure(0,0) superdense.measure(1,1) superdense.draw()
from qiskit.providers.basic_provider import BasicSimulator sim = BasicSimulator() # run the circuit on the simulator with 1 shot (execute the circuit once) result = sim.run(superdense, shots=1).result().get_counts() print(result) # {'11': 1}
import pennylane as qml defentangle(): qml.Hadamard(wires=0) qml.CNOT(wires=[0,1]) print(qml.draw(entangle)()) device = qml.device("default.qubit", wires=[0,1]) # Wrap the quantum function as a QNode entangle_qnode = qml.QNode(my_circuit, device) # Set the number of shots to 10 entangle_qnode = qml.set_shots(entangle_qnode, shots=10)
import numpy as np state = np.array([1,1j], dtype=complex) state = state / np.linalg.norm(state)
defteleport(state): # Ensure "state" is loaded into the first qubit # (otherwise qubits would start in |0>) qml.StatePrep(state, wires=0) # Shared entanglement between qubits 1 and 2 qml.Hadamard(wires=1) qml.CNOT(wires=[1,2]) # Alice's operation: # CNOT from Alice's input qubit to her half of the Bell pair, # then Hadamard on the input qubit qml.CNOT(wires=[0,1]) qml.Hadamard(wires=0) # Measurement (store the classical outcomes) m0 = qml.measure(0) m1 = qml.measure(1) # Bob's conditional correction operations qml.cond(m1, qml.PauliX)(wires=2) qml.cond(m0, qml.PauliZ)(wires=2) # Return Bob's qubit as a density matrix return qml.density_matrix(wires=2) print(qml.draw(teleport)(state))
In superdense coding, by sending only one qubit and using pre-shared entanglement, Alice can transmit two classical bits of information.
The operation Xn∣a⟩=∣a⊕(nmod2)⟩ correctly defines the effect of applying the X gate n times.
The tensor product of two identity operators is the identity operator on the composite space. In symbols, where the subscript is the dimension: I2⊗I2=I4.
The state ∣ϕ⟩=21(∣0⟩+∣1⟩) is an eigenstate of the Pauli-X gate with eigenvalue +1.
In the teleportation protocol, the classical communication channel is used to transmit two classical bits from Alice to Bob.
Three qubits are required for quantum teleportation.
After the teleportation protocol completes, Bob has a qubit in the state ∣ψ⟩.
Of QASM, Qiskit, Cirq, and PennyLane, PennyLane is the only quantum language that spells out the full name of the Hadamard gate for its built-in gates.
connected systems of people working together toward shared objectives, often through internal teams and external partners such as suppliers, universities, accelerators, customers, and startups.
operator basis: a set of matrices that can be used to express any matrix as a linear combination of the basis matrices
(acbd)=a∣0⟩⟨0∣+b∣0⟩⟨1∣+c∣1⟩⟨0∣+d∣1⟩⟨1∣
One of the basis elements is: ∣0⟩⟨0∣⊗∣0⟩⟨0∣=∣00⟩⟨00∣
Similarly ∣0⟩⟨0∣⊗∣0⟩⟨1∣=∣00⟩⟨01∣
In total, the tensor products yields 4×4=16 basis elements for the space of 4×4 matrices: {∣00⟩⟨00∣,∣00⟩⟨01∣,∣00⟩⟨10∣,∣00⟩⟨11∣,∣01⟩⟨00∣,∣01⟩⟨01∣,…,∣11⟩⟨11∣}.
When gates act independently, it doesn't matter the order in which they are apply with the understanding that if only a single gate is applied, identity acts on the other qubits.
(U1⊗U2)=(I⊗U2)(U1⊗I)=(U1⊗I)(I⊗U2)
Example: Apply X to qubit 1 and H to qubit 2, starting with ∣00⟩:
a process by which new innovations and technological advancements ("creative")
desmantle long-standing economic structures, practices, and organizations ("destruction")
while creating new markets and opportunities
Disruptive Innovation
a process where a smaller company successfully challenges estabilished businesses bgy offering simpler, more affordable, or more accessible products or services.
low-cast, low-performance, alternative, improve over time and displace established playwers
Innovator's Dilemma
successful, well-managed companies often fail when disuptive technologies emerge
even when they do everything "right" according to traditional management principles.
Sustaining Innovation
Disruptive Innovation
Improves existing products
Creates new markets or value
Higher margins
Initially lower margins
High-end customers
Low-end market segments
Sustaining Innovation: Tesla improving battery range
Innovation can create benefits (growth, efficiency, solutions) but also risks (inequality, pollution, privacy loss).
Responsible Innovation is about developing new techonologies, products, or services in a way that is ethically acceptatble, socially desirable, and environmentally sustainable, while actively considering their potential impacts on society.
Anticipation: Exploring possible risks, unintended consequences, and long-term effects.
Reflexivity: Innovators reflecting on their own values, assumptions, and biases.
Inclusion: Engaging stakeholders (citizens, users, regulators, communities), not just engineers or investors shaping outcomes.
Responsiveness: Ability to change direction if concerns arise.
Product questions
Process questions
Purpose questions
How will the risks and benefits be distributed?
How should standards be drawn up and applied?
Why are researchers doing it?
What other impacts can we anticipate?
How should risks and benefits be defined and measured?
Are these motivations transparent and in the public interest?
Threat of New Entrants: Profitable industries that yield high returns will attract new firms. New entrants eventually will decrease profitability for other firms in the industry.
Threat of Substitutes: A substitute product uses a different technology to try to solve the same economic need.
Bargaining Power of Customers: The market outputs. The ability of customers to put the firm under pressure, which also affects the customer's sensitivity to price changes.
Bargaining Power of Suppliers: The market inputs. Suppliers of raw materials, components, labor, and services (such as expertise) to the firm can be a source of power over the firm when there are few substitutes.
Competitive rivalry: For most industries the intensity of competitive rivalry is the major determinant of the competitiveness of the industry.
Expected (Basic or Must-be) Attribute: whose presence doesn't directly increase satisfaction, but their absence causes extreme dissatisfaction.
car: a functioning brake is a must be quality
hotel: providing a clean room is a basic necessity
One-Dimensional (Performance) Attribute: can both satisfy and dissatisfy customers depending on their execution.
car: acceleration
hotel: waiting service at a hotel
Attractive (Delight) Attribute: differentiate products and services, creating a "wow factor" and delighting customers when present, but causing no dissatisfaction when absent.
car: advanced parking sensor
hotel: providing free food
Indifferent Attribute
car: the color of the car
hotel: highly polite speacking and very prompt responses not be necessary to satisfy customers
Reverse Attribute
web: auto-playing videos/audio
venue: unnecessary security checks at the entrance of a venue
As customer expectations change with the level or performance from competing products, attributes can move from delighter to performance need and then to basic need.