Algorithm guide · protocol
Quantum secret sharing (HBB)
Alice shares a random key bit with Bob, Charlie and Diana. All three recipients must cooperate to reconstruct it.
Circuit size: 4 qubits; dealer + 3 recipients
Four-qubit GHZ · X/Y bases · XOR parity and private shares
Review quantum fundamentals →Notation used in this lesson
- |ψ⟩ and ⟨ψ|
- A state vector (ket) and its conjugate transpose (bra). ⟨a|b⟩ is their inner product.
- α, β and i
- α and β are complex amplitudes; i²=−1. A probability is the squared magnitude |α|².
- XOR, · and ⊗
- XOR adds bits modulo two. In s·x, multiply corresponding bits and XOR them. ⊗ combines registers or operations on different wires.
- U†, Σ and Tr
- U† is the adjoint (inverse for a unitary). Σ sums terms. Tr is the matrix trace, the sum of diagonal entries.
- Probability, shots and angles
- Ideal probabilities describe the model; measured shot frequencies fluctuate. Angles inside trigonometric expressions are in radians unless explicitly labeled turns.
1. The problem
Generate a random classical key bit for a dealer, Alice, so three recipients must combine their shares to reconstruct it. This four-party HBB variant is classical-key sharing assisted by quantum correlations.
2. How it works
The GHZ state fixes a joint parity, while each proper subset of recipient outcomes remains insufficient to determine Alice’s bit. Public basis choices identify which rounds have the required deterministic parity.
Prepare GHZ+
Alice q3 and recipients Bob q2, Charlie q1, Diana q0 share (|0000⟩+|1111⟩)/√2.
Choose local bases
Each participant measures X or Y.
Sift
Keep only settings with an even number of Y bases.
Reconstruct
Combine all three recipient bits and the known basis-dependent parity offset.
3. The mathematics, one idea at a time
Two Y measurements introduce one minus sign; four introduce two. Odd-Y settings do not give a fixed reconstruction parity.
This is the dealer’s bit reconstructed by the full recipient group.
Work this through by hand
4. All four participants measure X
Four fixed qubits: dealer plus three recipients.
Choose XXXX. There are no Y bases, so the offset is zero.
| Stage | Calculation or state | What it means |
|---|---|---|
| Basis offset | #Y=0 ⇒ offset=0 | This setting is accepted. |
| One possible record | ABCD=1010 | Its total XOR is 0. |
| Recipients reconstruct | b XOR c XOR d = 0 XOR 1 XOR 0=1=a | All three shares reproduce Alice’s random bit. |
Expected outcomes for this example
These are ideal predictions for the stated configuration, not a result already measured by your browser. Rows describing alternative modes or combined events are labeled explicitly.
| Outcome or event | Ideal probability | Interpretation |
|---|---|---|
| 0000,0011,0101,0110,1001,1010,1100,1111 | 12.5% each ideally | The eight even-parity records. |
5. Load the worked example in Composer
The worked example can use smaller or simpler inputs than the gallery defaults. The button below loads the exact circuit used in this lesson.
- Alice basis
- X
- Bob basis
- X
- Charlie basis
- X
- Diana basis
- X
- Save any current circuit you want to keep, then open the worked example. Loading it does not execute a paid hardware job.
- Trace the preparation, main operations and measurements against the worked table. Check the gate editor for controls, targets and angles.
- Start with an ideal noiseless simulator compatible with the circuit. Mid-circuit measurement, reset and feed-forward require support from the chosen backend.
- Inspect the live preview. For a recorded experiment, open Execute, set the available backend options and shots, and Run. Sign in when prompted to retain it in My Jobs.
- Read the output as described below before changing one setting and repeating. The guide describes the original example; edits can change the answer.
6. Read the output correctly
The joint c3c2c1c0 label reads Alice/Bob/Charlie/Diana. The decoder evaluates reconstruction from actual counts.
The simulator can display all shares, but a real recipient is not allowed this omniscient record. Any one or two recipient shares alone leave Alice’s bit unbiased in the ideal accepted round.
A bit label is a register value; its bar height is a probability or count. For S shots and observed count k, the sampled frequency is k/S. A typical sampling scale for probability p is √[p(1−p)/S]; this is not a strict error bound. Finite samples do not have to match the ideal percentages exactly.
7. Common mistakes & limits
- This does not encode an arbitrary unknown quantum state into three quantum shares.
- Odd-Y rounds must be discarded, not forced into the even-Y reconstruction formula.
8. Check your understanding
For bases XXYY and recipient bits b,c,d=0,1,0, what is Alice’s bit?
Reveal the reasoning
#Y=2, offset=1. Alice=0 XOR 1 XOR 0 XOR 1=0.
9. Further study
The lesson’s register mappings, supported inputs and loadable example follow Quantket’s implemented circuit. A reference may use different wire names, bit order or resource conventions.
Gallery reference: defaults, definitions & implementation notes
Inputs & default settings
These are the gallery defaults. The worked example above may override them. Configure the card to change the inputs before loading its editable circuit.
- Alice basis
- Default: X · Choices for the current settings: X; Y.
- Bob basis
- Default: X · Choices for the current settings: X; Y.
- Charlie basis
- Default: X · Choices for the current settings: X; Y.
- Diana basis
- Default: X · Choices for the current settings: X; Y.
Implementation notes
The HBB four-particle GHZ+ variant generates a shared classical key bit: Alice (q3) is the dealer, Bob (q2), Charlie (q1) and Diana (q0) are the three recipients. Every participant measures X or Y locally. With an even number of Y bases, Alice's bit equals Bob XOR Charlie XOR Diana XOR (#Y/2 mod 2). Odd-Y rounds are discarded. Bases may be public; in an ideal accepted round any one or two recipient shares are independent of Alice's bit, while all three reconstruct it. Alice already knows her own bit. The simulator's full ABCD record is an omniscient teaching view, not a recipient's allowed information. This demonstrates random classical-key sharing, not encoding an arbitrary unknown quantum state or a complete secure distribution session.
Default example: predictions & circuit facts
These values describe the unedited default setup. They are predictions and circuit properties, not measured results from your saved execution.
- Basis choice
- XXXX
- Sharing round
- Usable
- Reconstruction
- a = b XOR c XOR d XOR 0
Read your saved result
Check the submitted circuit, measured register and execution settings in Run details. Exact results give computed probabilities; sampled results show frequencies from the recorded shots. Edited circuits and noise can change the expected outcome. The algorithm label records the circuit's origin; it does not certify an edited circuit or a measured result.