Monthly commit counts provide a visual view of project activity over time.
A consistent or increasing commit frequency suggests healthy development.
A sudden drop, such as a 50% decrease in commits within a month, may signal the departure of key contributors or a shift in project focus.
A sustained decline over 6-12 months suggests a loss of team momentum, while periodic spikes followed by stagnation may indicate a batch-style release pattern.
In one real-world case, a CTO recognized from a commit velocity chart that a specific point in time aligned with the departure of a senior engineer.
This data reflects not just code activity, but team dynamics.
After applying H gates to the input and scratch registers, we get
∣00⋯0⟩→2n1(∣00⋯0⟩+∣00⋯1⟩+⋯+∣11⋯1⟩)
The input register is in a superposition of a computational states containing all possible inputs to n-bit string.
The last qubit hasn't changed from n=1 case, so it is in the state ∣−⟩.
H∣1⟩=∣−⟩
The definition of the oracle was generic for any bit string:
Uf∣x⟩∣−⟩=(−1)f(x)∣x⟩∣−⟩
The phase-kickback puts a phase in front of each term in the input register that depends on the output of the function f:
2n1((−1)f(00…0)∣00…0⟩+⋯+(−1)f(11…1)∣11…1⟩)
The scratch qubit remains in ∣−⟩, so we can ignore it for the rest of the algorithm.
Constant case
if f is constant, then all the phases are the same, either +1 or −1:
f(00⋯0)=f(00⋯1)=⋯=f(11⋯1)=0
f(00⋯0)=f(00⋯1)=⋯=f(11⋯1)=1
The phse in front of every computational state is the same, Either +1 or −1.
Before the second application of the H gates, the state of the input register is:
±2n1(∣00⋯0⟩+∣00⋯1⟩+⋯+∣11⋯1⟩)
In measurement, in either case, the probability to obtain P(00⋯0)=1
A constant function deterministically returns all zeros with a single query.
Balanced case
we are promised the function is either constant or balanced, so there are equal number of +1 and −1 phases. so we don't need to consider this case.
If the measurement produces anything but all zeros, we know with certainty the function is not constant, so it must be balanced.
There are a lot of balanced function, but half the terms in the superposition will exactly have a −1 phase.
It's clearly orthogonal to the state with all ones in superposition.
Appllying H's will change the state to some other superpostiion, or perhaps a unique computational state.
But, orthogonality to ∣00⋯0⟩ must remain.
A balenced function deterministically returns a state with at least one entry as 1, with a single query.
One quantum query vs 2n−1+1 classical queries.
It is an algorithm that puts all inputs into superposition at once, encodes the function values as phases, and then uses interference to distinguish between constant and balanced functions.
build Uf that applies X to the output qubit exactly when f(x)=1.
if n=2, the multi-controlled X gate is a Toffoli gate.
x=11 is the only input that gives f(x)=1, so we can use a Toffoli gate with controls on the first two qubits and target on the output qubit.
This is because the Toffoli gate will flip the output qubit if and only if both control qubits are ∣1⟩, which corresponds to the input x=11.
if x=00 is the only input that gives f(x)=1, we can use an anti-controlled Toffoli gate, which applies X to the target qubit if both control qubits are ∣0⟩.
This is because the anti-controlled Toffoli gate will flip the output qubit if and only if both control qubits are ∣0⟩, which corresponds to the input x=00.
Applying X gates to the two control qubits, then applying a Toffoli gate, and then applying X gates again to the control qubits will effectively create an anti-controlled Toffoli gate.
A multi-controlled X gates (CnX) flips the target only all control qubits are ∣1⟩.
To target a specific input x:
Place X gates on each qubit i where xi=0. (anti-control)
Apply CnX.
Undo the X gates.
For n qubits, it can be generalized to perform an X gate (or any U) with n control qubits, requireing n−1 extra scratch qubits and 2(n−1) Toffoli gates.
Whenever scratch qubits are invoked, always see a symmetric pattern of gates.
Uf8Uf1∣x⟩∣y⟩=∣x⟩∣y⊕f1(x)⊕f8(x)⟩=∣x⟩∣y⊕f9(x)⟩
The computation is done using the scratch qubits.
The answer is copied to the target or output register
The computation is inverted to reset the scratch qubits to ∣0⟩.
called "uncomputation", ensures the scratch qubits are returned to their initial state.
no input or output qubits are entangled with the scratch qubits at the end of the algorithm.
There are 22n possible Boolean functions from {0,1}n to {0,1}.
A Boolean function is balanced if it outputs 1 on exactly half of the inputs, that is, on 2n−1 out of the 2n possible inputs.
In Deutsch’s algorithm with n=1, only 1 quantum query is needed to distinguish a constant function from a balanced function.
A quantum oracle for f is defined as the unitary
Uf:∣x⟩∣y⟩↦∣x⟩∣y⊕f(x)⟩.
Every XOR-based function of the form f(x)=xj⊕xk⊕⋯ that depends on at least one input bit is balanced.
Using multi-controlled X gates, together with anti-controls when needed, we can implement an oracle for any Boolean function.
The phase kickback multiplies the state by the phase factor (−1)f(x), so the phase changes exactly when f(x)=1.
If these questions were stored in a Python list called questions, then the 8th question would be questions[7].
Applying Hadamard gates to n qubits initialized in ∣0⟩ produces an equal superposition over all 2n computational basis states.
In Deutsch–Jozsa for n>1, measuring all input qubits as 0 means that f is constant.
Bernstein–Vazirani solves the hidden-string problem f(x)=s⋅x with 1 quantum query.
A multi-controlled X gate with 3 controls can be implemented using scratch qubits and 4 Toffoli gates.
Applying Uf1 followed by Uf2 yields an oracle whose action on the scratch qubit corresponds to f1(x)⊕f2(x).
Uncomputation resets scratch qubits to their initial states by applying the inverse of the computation, which means reversing the order of the steps.
Multi-controlled gates with more than one control can be decomposed into simpler gates, but in general this requires more than just CX and X; single-qubit gates are also needed.
Padding is used to control the spatial size of the output feature maps.
Negative values at the edges can naturally arise because of padding, and they usually are not a big problem because activation functions and later layers come afterward.
it is an iterative approach for error correction in a machene learning model
Find w and b that will minimize GD(w,b) (requires Loss/Cost function)
Initialize w and b
Perform Forward pass operation/calculations
Compute Loss/Cost function L(a,y)
Compute change in w and b (Take the partial derivative of the cost function with respect to Weights and bias dw and db)
Update w and b (w:=w−αdw and b:=b−αdb)
Repeat from Step 2 with new values of w and b for 'n' number of iterations.
α is the learning rate (hyperparameter) that controls how much we are adjusting the weights and bias of our model with respect to the loss gradient. It is a small positive value (e.g., 0.01, 0.001) that determines the step size at each iteration while moving toward a minimum of the loss function.
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.
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⟩: