Skip to content

Entanglement Registry

The Entanglement Registry manages quantum entanglement between database entities in Q-Store v4.0.0, enabling automatic relationship synchronization and zero-latency correlation updates.

In Q-Store v4.0.0, the Entanglement Registry provides:

  • Automatic Synchronization: Changes to one entity automatically update correlated entities
  • Zero-Latency Propagation: Instant correlation updates via quantum entanglement
  • Relationship Management: Track and maintain entity correlations
  • Quantum Consistency: Impossible to have stale or inconsistent correlations

Quantum entanglement creates correlations between qubits such that measuring one immediately affects the other, regardless of distance. Q-Store uses this property to maintain database relationships:

Entity A ←──────entangled──────→ Entity B
Update A → Automatically updates B (no lag, no sync delay)
from q_store import QuantumDatabase, DatabaseConfig
config = DatabaseConfig(
enable_quantum=True,
pinecone_api_key="your-key"
)
db = QuantumDatabase(config)
# Create entangled group of related documents
db.create_entangled_group(
group_id='tech_docs',
entity_ids=['doc_1', 'doc_2', 'doc_3'],
correlation_strength=0.85
)
# Update one entity
db.update('doc_1', new_embedding)
# doc_2 and doc_3 automatically reflect the correlation
# No manual sync needed - quantum mechanics handles it!
# Find all entities entangled with doc_1
partners = db.get_entangled_partners('doc_1')
# Returns: ['doc_2', 'doc_3']
# Get correlation strength
strength = db.get_correlation_strength('doc_1', 'doc_2')
# Returns: 0.85

Creates quantum entanglement between multiple entities.

Signature:

create_entangled_group(
group_id: str,
entity_ids: List[str],
correlation_strength: float = 0.8
) -> None

Parameters:

  • group_id: Unique identifier for the entangled group
  • entity_ids: List of entity IDs to entangle
  • correlation_strength: Strength of correlation (0.0-1.0)

Example:

# Entangle portfolio stocks
db.create_entangled_group(
group_id='tech_sector',
entity_ids=['AAPL', 'MSFT', 'GOOGL', 'NVDA'],
correlation_strength=0.85
)

Retrieves all entities entangled with given entity.

Signature:

get_entangled_partners(
entity_id: str
) -> List[str]

Returns: List of entangled entity IDs

Example:

partners = db.get_entangled_partners('AAPL')
# Returns: ['MSFT', 'GOOGL', 'NVDA']

Gets correlation strength between two entangled entities.

Signature:

get_correlation_strength(
entity_a: str,
entity_b: str
) -> float

Returns: Correlation strength (0.0-1.0) or None if not entangled

Example:

0.85
strength = db.get_correlation_strength('AAPL', 'MSFT')
# Create entangled tech stocks
db.create_entangled_group(
group_id='tech_portfolio',
entity_ids=['AAPL', 'MSFT', 'GOOGL', 'NVDA'],
correlation_strength=0.85
)
# Update one stock - others automatically adjust
db.update('AAPL', new_apple_embedding)
# MSFT, GOOGL, NVDA embeddings automatically reflect correlation
# No manual rebalancing needed!

Benefits:

  • Zero-latency correlation updates
  • Impossible to have stale correlations
  • No manual synchronization logic
  • Quantum-guaranteed consistency
# Entangle document versions
db.create_entangled_group(
group_id='doc_v1_v2',
entity_ids=['doc_v1', 'doc_v2'],
correlation_strength=0.9
)
# Update to v2 maintains correlation with v1
db.update('doc_v2', updated_content)
# doc_v1 maintains appropriate correlation distance
OperationTimeNotes
Create entangled group<5msFor 4 entities
Get partners<1msLookup operation
Get correlation<0.5msCached value
  • 0.95+: Identical/duplicate entities
  • 0.80-0.95: Highly correlated (same category)
  • 0.60-0.80: Moderately correlated (related topics)
  • < 0.60: Weakly correlated (use classical relations)
  • 2-5 entities: Optimal performance
  • 6-10 entities: Good performance
  • 11-20 entities: Acceptable with caveats
  • 20+ entities: Consider partitioning into subgroups
  • Qubit constraints: Large groups (>20) require many qubits
  • Mock mode: Entanglement simulation only (not actual quantum)
  • Update overhead: Propagation scales with group size