A TypeScript/React implementation of the 6-vertex model with Domain Wall Boundary Conditions (DWBC), based on the paper "Numerical study of the 6-vertex model with DWBC" by David Allison & Reshetikhin (2005).
- Interactive Simulation: Real-time Monte Carlo simulation with configurable parameters
- Multiple Visualization Modes: Path flow, arrow directions, and vertex type displays
- DWBC Configurations: Support for both High and Low boundary conditions
- Debug Tools: Step-through flip operations and ice rule validation
- Performance Optimized: Efficient simulation engine with Web Workers support
- Comprehensive Testing: Full test suite ensuring physics accuracy
- Node.js 18+ and npm
- Modern web browser with Canvas API support
# Clone the repository
git clone https://github.com/DavidAllison/6v-simulator.git
cd 6v-simulator
# Install dependencies
cd client
npm install
# Start development server
npm run devVisit http://localhost:5173 to see the simulator in action.
cd client
npm run build
# Output will be in client/dist/The 6-vertex model is a statistical mechanics model originally developed to describe ice and ferroelectric materials. Each vertex represents a molecular configuration with the "ice rule" constraint: exactly 2 arrows point in and 2 arrows point out.
The model has six allowed vertex configurations:
- a₁, a₂: Source/sink configurations
- b₁, b₂: Straight-through configurations
- c₁, c₂: Turn configurations
DWBC creates specific boundary arrow patterns that lead to interesting Arctic phenomena:
- DWBC High: Arrows in from top/right, out to bottom/left
- DWBC Low: Opposite pattern with diagonal Arctic regions
6v-simulator/
├── client/ # React application
│ ├── src/
│ │ ├── lib/six-vertex/ # Physics engine
│ │ ├── components/ # React components
│ │ ├── routes/ # Application pages
│ │ └── App.tsx # Main application
│ └── tests/ # Test suite
├── docs/ # Documentation
│ ├── development/ # Development guides
│ └── reference/ # Research papers
└── CLAUDE.md # AI assistant instructions
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
npm run typecheck # TypeScript type checking
npm test # Run test suite/- Main simulator interface/dwbc-verify- DWBC pattern verification/flip-debug- Step-through flip operations/performance- Performance testing tools
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow the coding standards in CLAUDE.md
- Ensure all tests pass
- Submit a pull request
The project includes comprehensive tests for:
- Vertex type mappings
- Ice rule preservation
- DWBC pattern generation
- Flip transformations
- Monte Carlo dynamics
Run tests with:
cd client
npm testThe simulator is optimized for:
- Small lattices (N ≤ 20): Real-time animation at 60 FPS
- Medium lattices (N ≤ 50): Smooth interaction with slight delays
- Large lattices (N > 50): Batch processing with Web Workers
- Allison, David & Reshetikhin, N. (2005). "Numerical study of the 6-vertex model with DWBC". arXiv:cond-mat/0502314v1
- Original C implementation available in
docs/reference/attached_assets/main.c
This project is licensed under the MIT License - see the LICENSE file for details.
- Original research by David Allison and N. Reshetikhin
- Physics consultation and validation from the statistical mechanics community
- Built with React, TypeScript, and Vite
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check the troubleshooting guide
- Review the development documentation
