This document defines all UI components used in the EPP (Entanglement Purification Protocol) system. Components are reusable UI elements that can be composed to build the application interface for quantum simulation.
Description: Provides user interface controls for configuring and running the quantum entanglement purification simulation.
Props:
onNextStep: () => void - Handler for advancing to the next purification steponCompleteRound: () => void - Handler for completing the current purification roundonRunAll: () => void - Handler for running the simulation to completiononReset: () => void - Handler for resetting the simulationonParametersChanged: (params: SimulationParameters) => void - Handler for updating simulation parametersisComplete: boolean - Whether the simulation has completedcurrentRound: number - The current purification roundcurrentStep: PurificationStep - The current step within the purification processpairsRemaining: number - Number of qubit pairs remaining in the simulationaverageFidelity: number - Average fidelity across all pairs (displayed to 3 decimal places)
Example Usage:
<ControlPanel
onNextStep={handleNextStep}
onCompleteRound={handleCompleteRound}
onRunAll={handleRunAll}
onReset={handleReset}
onParametersChanged={handleParametersChanged}
isComplete={simulationComplete}
currentRound={currentRound}
currentStep={purificationStep}
pairsRemaining={pairs.length}
averageFidelity={averageFidelity}
/>Description: Visualizes the collection of qubit pairs and their connections during purification steps.
Props:
pairs: QubitPair[] - Array of qubit pairs to displaypendingPairs?: { controlPairs: QubitPair[], targetPairs: QubitPair[], results?: {...}[] } - Pairs involved in current purification steppurificationStep: string - Current step in the purification process
Example Usage:
<EnsembleDisplay
pairs={simulationState.pairs}
pendingPairs={simulationState.pendingPairs}
purificationStep={simulationState.purificationStep}
/>Description: Visualizes a single entangled qubit pair with both Alice and Bob's qubits.
Props:
pair: QubitPair - The qubit pair data to visualizeisControl: boolean - Whether this pair is a control pair in CNOT operationsisTarget: boolean - Whether this pair is a target pair in CNOT operationswillBeDiscarded: boolean - Whether this pair will be discarded after measurementpartnerId?: number - ID of the partner pair in CNOT operations
Example Usage:
<QubitPair
pair={qubitPair}
isControl={isControlPair(qubitPair)}
isTarget={isTargetPair(qubitPair)}
willBeDiscarded={willBeDiscarded(qubitPair)}
partnerId={getPartnerId(qubitPair)}
/>Description: Visualizes the density matrix of a quantum state.
Props:
matrix: DensityMatrix - The density matrix to visualizesize: number - The display size of the matrix
Example Usage:
<DensityMatrixView
matrix={qubitPair.densityMatrix}
size={100}
/>Description: Modal window that provides educational content about entanglement purification, application usage instructions, and credits.
Props:
isOpen: boolean - Controls the visibility of the modalonClose: () => void - Handler function called when the modal should be closed
Styling: Uses dedicated InfoWindow.css file for component-specific styles and inherits general modal styles from index.css
Example Usage:
<InfoWindow
isOpen={showInfo}
onClose={() => setShowInfo(false)}
/>Description: Floating attribution area that displays creator information and social media links. Positioned next to the help button to provide unobtrusive credit and contact information.
Props: None - Static component with hardcoded creator information
Features:
- Displays "Created by Iftach Yakar" text vertically
- Provides social media links (GitHub, LinkedIn, X/Twitter, Bluesky) with icons
- Floating positioning next to help button with proper spacing
- Responsive design for mobile devices
- Accessibility features with proper ARIA labels
Styling: Uses styles defined in index.css with .attribution-* classes that follow the existing design system
Example Usage:
<Attribution />- App (Root component)
- ControlPanel (Configures and controls simulation)
- EnsembleDisplay (Shows collection of qubit pairs)
- QubitPair (Individual qubit pair display)
- DensityMatrixView (Visualizes quantum state)
- QubitPair (Individual qubit pair display)
- InfoWindow (Educational modal window)
- Attribution (Creator credit and social links)
- Components use dedicated CSS files for component-specific styling
- General styles (modal, buttons, etc.) are defined in
index.css - Component-specific styles are in separate CSS files (e.g.,
InfoWindow.css) - Color scheme:
- Successful operations: Green (#2ecc71)
- Failed operations: Red (#e74c3c)
- CNOT operations: Black (#000000)
- Visual elements should follow quantum circuit diagram conventions where appropriate
- All controls should have appropriate ARIA labels
- Color should not be the only indicator of state (use shapes, patterns, or text as well)
- Input elements should have associated labels
- Simulation steps should be clearly indicated with text descriptions