Skip to content

glanzz/QMusicViz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Music Visualization: Technical and Artistic Explanation

Project Concept

The Quantum Music Visualizer transforms audio into visual art using quantum computing techniques. This project explores the question: "How would quantum computers visualize music?" By processing audio through quantum circuits, we create visualizations that could not exist using classical computing alone.

Technical Approach

1. Audio Processing Pipeline

We break down the audio processing into discrete steps:

Second-by-Second Analysis Instead of processing the entire audio file at once, we analyze the audio second by second, creating a time-evolving visualization that follows the music. This approach:

  • Captures the temporal dynamics of the music
  • Shows how quantum processing responds to changing audio features
  • Creates a more engaging visual experience

Spectrogram Generation For each second of audio, we create a mel-spectrogram that represents the frequency content:

  • The y-axis represents frequency bands (using mel scale to better match human perception)
  • The x-axis represents time within that second
  • The intensity represents the energy in each frequency-time bin

2. Quantum Processing with QuantumBlur and Custom Gates

At the heart of our implementation is the QuantumBlur algorithm, which we extend with custom quantum rotation gates to create unique visual effects:

# Core quantum processing
circuits = qb.image2circuits(image)  # Get basic quantum circuits from image
modified_circuits = self.modify_quantum_circuits(circuits, style)  # Apply our custom gates
processed_image = qb.circuits2image(modified_circuits, image.size)  # Convert back to image

Quantum Circuit Customization We modify the quantum circuits by applying specific rotation gates (rx, ry, rz) and entanglement patterns:

# Add rotation gates to each qubit
for q in range(num_qubits):
    # Apply different rotation factors to different frequency ranges
    if q < num_qubits // 3:  # Low frequencies
        qc.rx(np.pi * rx_factor, q)
    elif q < 2 * num_qubits // 3:  # Mid frequencies
        qc.ry(np.pi * ry_factor, q)
    else:  # High frequencies
        qc.rz(np.pi * rz_factor, q)

This approach allows us to:

  1. Apply different quantum operations to different frequency ranges
  2. Create custom entanglement patterns between qubits
  3. Control the intensity of quantum effects through rotation parameters

Quantum Style Parameters We created three quantum "styles" that provide different artistic effects:

  • Harmonic: Light rotation parameters with linear entanglement
  • Resonant: Medium rotation parameters with circular entanglement
  • Chaotic: Strong rotation parameters with full entanglement

Each style produces a distinct visual character while maintaining the quantum nature of the processing.

3. Visual Enhancement

After quantum processing, we apply additional artistic enhancements to create more visually engaging results:

# Apply color palette based on style
cmap = self.color_palettes[style]

# For each channel, apply a different transformation
for c in range(3):
    # ...channel-specific processing...

Each quantum style uses a different color palette:

  • Subtle: Viridis colormap (blue-green-yellow) representing stability
  • Medium: Plasma colormap (purple-orange) representing energy flow
  • Intense: Magma colormap (black-red-yellow) representing intensity

We also offset color channels slightly to create chromatic effects that highlight different aspects of the quantum processing.

4. Video Generation

The individual frames are combined into a video that shows the evolution of the music through quantum processing:

  • Standard speed video at the specified FPS
  • Slow-motion version that allows viewers to appreciate the quantum details

Quantum Thinking in Our Approach

Our project embodies quantum thinking in several ways:

Quantum Interference as Artistic Tool The blurring effect in QuantumBlur comes from quantum interference - the wave-like behavior of quantum systems where amplitudes can add constructively or destructively. We use this interference as an artistic tool to create patterns that classical algorithms cannot produce.

Superposition of Frequency Components In quantum computing, qubits can exist in superpositions of states. Similarly, our visualization places frequency components of the audio in superposition through the quantum circuits, creating visual representations that show multiple potential "interpretations" of the sound simultaneously.

Measurement as Creative Act In quantum mechanics, measurement collapses quantum states into classical outcomes. In our visualization, the measurement process in QuantumBlur becomes a creative act - the moment when quantum possibilities become concrete visual elements.

Entanglement between Audio Features Though not explicitly coded, the QuantumBlur algorithm creates entanglement between different parts of the image data. In our audio context, this means different frequency bands become quantum-entangled, creating visual connections between otherwise separate audio elements.

Artistic Intent

Our artistic intent with this project is to:

  1. Reveal Unseen Dimensions of Music By processing audio through quantum algorithms, we reveal aspects of music that traditional visualizations cannot capture.

  2. Explore Quantum Aesthetics The project explores what a "quantum aesthetic" might look like - embracing uncertainty, interference, and probability as artistic elements.

  3. Create Sensory Bridges We aim to create a bridge between the auditory experience of music and the visual language of quantum phenomena.

Conclusion

Quantum Music Visualizer demonstrates how quantum computing can transform our experience of art. By processing audio through quantum circuits using the QuantumBlur algorithm, we've created visualizations that couldn't exist using classical methods alone.

This project is just a beginning exploration of the artistic potential of quantum computing. As quantum technologies advance, we envision entirely new forms of creative expression that leverage the unique properties of quantum systems.

About

Wanna see how does quantum perceive sounds ? Check this the link below

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors