AI is displacing software engineers, but those in Singapore have the chance to fare better

https://www.straitstimes.com/business/ai-is-displacing-software-engineers-but-those-in-singapore-have-the-chance-to-fare-better?sfnsn=mo

Exploring Quantum Entanglement: CHSH Game Simulator

Have you ever wondered how quantum mechanics and quantum computing defies our everyday intuition? Below is a project I built that demonstrates one of the most mind-bending phenomena in quantum physics: quantum entanglement and its ability to violate classical physics constraints.

Live Demo

๐ŸŽฎ Try the CHSH Game Simulator

๐Ÿ“‚ View on GitHub

What is the CHSH Game?

The CHSH (Clauser-Horne-Shimony-Holt) game is a fascinating thought experiment that reveals the strange power of quantum entanglement. Itโ€™s a cooperative game between two players, Alice and Bob, who cannot communicate with each other but share a special resource.

The Game Rules

  1. A referee sends random bits x and y to Alice and Bob respectively
  2. Alice outputs a bit a based on her input x
  3. Bob outputs a bit b based on his input y
  4. They win if: (a + b) mod 2 = x ร— y

The fascinating part? With classical strategies (no quantum physics), the maximum win rate is 75%. But with quantum entanglement, Alice and Bob can achieve approximately 85.4% – seemingly breaking the laws of classical physics!

Key Features

๐ŸŽฏ Interactive Visualization

The app features a real-time p5.js visualization that shows:

  • Entangled State: Two qubits in a maximally entangled Bell state
  • After Aliceโ€™s Measurement: How Aliceโ€™s measurement affects both qubits
  • After Bobโ€™s Measurement: The final collapsed state after both measurements

Each stage includes:

  • Colored measurement basis quadrants (red, blue, orange, green)
  • Clear labels showing measurement outcomes (0 and 1)
  • Visual indication of quantum correlation (parallel or orthogonal)

๐Ÿงช Four Bell States

The simulator supports all four maximally entangled Bell states:

  1. |ฮฆ+โŸฉ = (|00โŸฉ + |11โŸฉ)/โˆš2
  2. |ฮฆ-โŸฉ = (|00โŸฉ – |11โŸฉ)/โˆš2
  3. |ฮจ+โŸฉ = (|01โŸฉ + |10โŸฉ)/โˆš2
  4. |ฮจ-โŸฉ = (|01โŸฉ – |10โŸฉ)/โˆš2

Each Bell state uses carefully optimized measurement angles to maximize the CHSH violation and achieve the theoretical ~85% win rate.

๐ŸŽฎ Strategy Comparison

Switch between:

  • Classical Strategy: Always outputs 0, achieving the theoretical 75% maximum
  • Quantum Strategy: Uses entangled qubits to beat classical limits

๐ŸŽฒ Flexible Input Controls

Choose input bits for Alice (x) and Bob (y):

  • Random: Simulates realistic random inputs
  • Fixed (0 or 1): Test specific measurement configurations

๐Ÿ“Š Real-Time Statistics

Track performance with:

  • Total rounds played
  • Wins and losses
  • Win percentage that converges to theoretical predictions

๐Ÿ”„ Round History Navigation

Navigate through previous rounds to review specific outcomes and understand the quantum measurement process better.

The Science Behind It

Bellโ€™s Inequality and CHSH

In 1964, physicist John Bell proved that no local hidden variable theory could reproduce all predictions of quantum mechanics. The CHSH inequality is a specific formulation of Bellโ€™s theorem:

Classical limit: S โ‰ค 2

Quantum mechanics: S = 2โˆš2 โ‰ˆ 2.828

This violation proves that quantum entanglement exhibits correlations that cannot be explained by any classical mechanism, even with shared randomness!

Measurement Angles

The key to achieving the quantum advantage lies in choosing the right measurement angles. For the standard |ฮฆ+โŸฉ Bell state:

  • Aliceโ€™s bases: 0ยฐ (x=0), 45ยฐ (x=1)
  • Bobโ€™s bases: 22.5ยฐ (y=0), -22.5ยฐ (y=1)

The probability that Alice and Bob get the same outcome is:

P(same) = cosยฒ(ฮด)

where ฮด is the relative angle between their measurement bases. This quantum correlation is what allows them to beat the 75% classical limit.

Orthogonal vs Parallel Correlation

Different Bell states exhibit different correlation patterns:

  • Parallel correlation (|ฮฆ+โŸฉ, |ฮจ+โŸฉ): Qubits tend to give the same measurement outcome
  • Orthogonal correlation (|ฮฆ-โŸฉ, |ฮจ-โŸฉ): One qubit is rotated 90ยฐ relative to the other

The simulator accounts for these differences and adjusts the probability calculations accordingly.

Try It Yourself!

You can try the simulator and explore:

  1. Start with the Classical strategy and run 100 rounds – youโ€™ll see it converge to ~75%
  2. Switch to Quantum with the |ฮฆ+โŸฉ Bell state – watch it reach ~85%
  3. Try different Bell states and input combinations
  4. Use the round navigation to review specific outcomes

Future Enhancements

  • 3D Bloch Sphere Visualization: Show quantum states on the Bloch sphere using Three.js
  • Animated Transitions: Step-by-step animation of the measurement process
  • Educational Tutorial: Guided walkthrough explaining each concept
  • Mathematical Deep Dive: Optional panel with detailed probability calculations
  • Mobile Optimization: Touch-friendly controls and responsive layout

Open Source

The complete source code is available on GitHub. Feel free to:

  • Explore the code
  • Report issues
  • Suggest improvements
  • Fork and build your own quantum visualizations!

Conclusion

The CHSH game beautifully demonstrates that quantum entanglement isnโ€™t just mathematical abstraction – it has measurable, observable consequences that defy classical intuition. This simulator makes that phenomenon interactive and accessible.

Whether youโ€™re a physics student, educator, or simply curious about quantum mechanics, I hope this tool helps you develop an intuition for one of natureโ€™s most fascinating phenomena.


Built with: React, p5.js, and Claude Code

Try it now: https://myhlow.github.io/chsh-game-simulator

Source code: https://github.com/myhlow/chsh-game-simulator


Have questions or suggestions? Leave a comment below or open an issue on GitHub!

The CEO Magazine: David Ellis: Why AI makes new graduates more valuable than ever

https://amp.theceomagazine.com/business/innovation-technology/david-ellis/

Ellis sees a different future. Rather than eliminating graduate positions, IBM Consulting is actively increasing them.

“So, for example, we are increasing, not decreasing, the number of graduate hires that weโ€™re making here in Australia,” he says.

Investing in the future
The reasoning is both strategic and generational. Todayโ€™s graduates enter the workforce with a crucial advantage โ€“ theyโ€™ve been using AI longer than most experienced workers.

“We have people entering the workforce that have perhaps been using AI longer than many others. Maybe theyโ€™ve been using it through their studies. Maybe theyโ€™ve just got a deeper affinity to it,” Ellis explains.

When properly equipped and trained, these AI-native workers can be a huge asset to organizations.

“We can skill them, we can equip them, we can give them the confidence to be much more effective than you or I might have been at the beginning of our careers,” he says.

How To Create Software Diagrams With ChatGPT and Claude – The New Stack

https://thenewstack.io/how-to-create-software-diagrams-with-chatgpt-and-claude/