Mathematical Research Platform
A comprehensive web-based computational platform for modern mathematics, featuring elliptic curve analysis, Galois theory, modular forms, topology, cryptography, and AI pattern recognition.
- Overview
- Features
- Live Demo
- Installation
- Usage Guide
- API Documentation
- Technology Stack
- Project Structure
- Deployment
- Performance & Scaling
- Security
- Contributing
- License
- Acknowledgments
- Support
MathOS is a sophisticated mathematical research platform designed to provide researchers, students, and enthusiasts with powerful computational tools for exploring advanced mathematical concepts. Built with Python and Flask, it combines a user-friendly web interface with robust mathematical engines to deliver real-time analysis and visualization.
| Goal | Description |
|---|---|
| Research Support | Accelerate mathematical research with computational tools |
| Education | Provide an accessible platform for learning advanced mathematics |
| Experimentation | Enable rapid prototyping and testing of mathematical hypotheses |
| Collaboration | Share findings through a web-based interface |
Click to expand details
| Feature | Description |
|---|---|
| Curve Visualization | Analyze curves of the form y^2 = x^3 + ax + b |
| Rank Computation | Compute Mordell-Weil rank (exact or approximate) |
| Torsion Points | Identify torsion subgroups |
| Discriminant | Calculate discriminant and j-invariant |
| Group Structure | Analyze rational points structure |
Example:
POST /api/curve
{
"a": 1,
"b": 1,
"exact_rank": true
}Click to expand details
| Feature | Description |
|---|---|
| Galois Groups | Compute Galois groups of polynomials |
| Field Extensions | Analyze field extensions |
| Pre-built Examples | Common polynomials with known groups |
| Degree Analysis | Determine degree of field extensions |
Supported Polynomials:
| Polynomial | Galois Group |
|---|---|
| x^5 - 2 | F_20 (Frobenius group) |
| x^4 + 1 | V_4 (Klein four-group) |
| x^3 - 2 | S_3 (Symmetric group) |
| x^5 - 4x + 2 | S_5 (Symmetric group) |
Example:
POST /api/galois
{
"polynomial": "x**5 - 2"
}Click to expand details
| Feature | Description |
|---|---|
| Weight & Level | Compute forms of specified weight and level |
| L-Functions | Analyze associated L-functions |
| Fourier Coefficients | Generate and visualize coefficients |
| Eigenforms | Identify Hecke eigenforms |
Example:
POST /api/modular
{
"weight": 2,
"level": 11
}Click to expand details
| Feature | Description |
|---|---|
| Homology Groups | Compute homology groups |
| Euler Characteristic | Calculate topological invariants |
| F-Vectors | Face vector analysis |
| Supported Spaces | Sphere, Torus, Projective Plane, Klein Bottle |
Example:
POST /api/topology
{
"space": "torus",
"dimension": 2
}Click to expand details
| Feature | Description |
|---|---|
| Post-Quantum | Kyber and Dilithium benchmarks |
| ECC | Elliptic curve cryptography |
| Security Analysis | Lattice and ECC security evaluation |
| Key Generation | ECC key pair generation |
Example:
POST /api/crypto
{
"action": "pqc"
}Click to expand details
| Feature | Description |
|---|---|
| Sequence Identification | Identify Fibonacci, primes, squares |
| Recurrence Finding | Detect linear recurrences |
| Pattern Matching | Recognize mathematical patterns |
| Prediction | Extend sequences |
Example:
POST /api/ai
{
"sequence": "1,1,2,3,5,8,13"
}Visit the live application: mathos-ogx3.onrender.com
Note: Free tier may spin down after 15 minutes of inactivity. First request may take approximately 30 seconds to wake up.
| Requirement | Version |
|---|---|
| Python | 3.7+ |
| pip | Latest |
| git | Latest |
| Virtual Environment | Optional but recommended |
git clone https://github.com/Soyebsoyeb/MathOS.git
cd MathOS# Linux/Mac
python -m venv venv
source venv/bin/activate
# Windows
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the root directory:
SECRET_KEY=your-secret-key-here
FLASK_ENV=development# Development mode
python math_research_platform/interfaces/web_app.py
# Production mode (using Gunicorn)
gunicorn --worker-class gthread --threads 4 --timeout 120 --bind 0.0.0.0:5000 math_research_platform.interfaces.web_app:appOpen your browser and navigate to: http://localhost:5000
# Dockerfile
FROM python:3.14-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ENV SECRET_KEY=docker-secret-key
EXPOSE 5000
CMD ["gunicorn", "--worker-class", "gthread", "--threads", "4", "--timeout", "120", "--bind", "0.0.0.0:5000", "math_research_platform.interfaces.web_app:app"]# Build and run
docker build -t mathos .
docker run -p 5000:5000 mathosThe application provides a clean, dark-themed interface with the following modules:
- Welcome screen with navigation
- Quick links to all modules
- Platform overview
- Input parameters
aandb - Compute exact or approximate rank
- View results in JSON format
- Quick examples for common curves
- Input polynomial expression
- Pre-built examples for common polynomials
- Detailed Galois group analysis
- Set weight and level
- Compute form properties
- L-function analysis
- Select space type
- Set dimension
- Compute homology and Euler characteristic
- Select action type
- Benchmark post-quantum algorithms
- ECC operations
- Input comma-separated sequences
- Identify sequence types
- Find recurrences
https://mathos-ogx3.onrender.com/api
No authentication required for public endpoints.
POST /api/curveRequest Body:
{
"a": 1.0,
"b": 1.0,
"exact_rank": false
}Response:
{
"status": "success",
"result": {
"curve": "y^2 = x^3 + 1.0x + 1.0",
"discriminant": -331,
"j_invariant": -3375/31,
"rank": 1,
"torsion": "trivial"
}
}POST /api/galoisRequest Body:
{
"polynomial": "x**5 - 2"
}Response:
{
"status": "success",
"result": {
"polynomial": "x**5 - 2",
"degree": 5,
"galois_group": "F20",
"order": 20
}
}POST /api/modularRequest Body:
{
"weight": 2,
"level": 11
}Response:
{
"status": "success",
"result": {
"weight": 2,
"level": 11,
"dimension": 1,
"coeffs": [0, 1, -2, -1, 2, 1, 2, -2, -1, 2, -2, -1]
}
}POST /api/topologyRequest Body:
{
"space": "torus",
"dimension": 2
}Response:
{
"status": "success",
"result": {
"space": "torus",
"dimension": 2,
"euler_characteristic": 0,
"f_vector": [1, 4, 4, 1]
}
}POST /api/cryptoRequest Body:
{
"action": "benchmark"
}Response:
{
"status": "success",
"result": {
"kyber": { "security": 128, "n": 256, "q": 3329 },
"dilithium": { "security": 256, "n": 256, "q": 8380417 }
}
}POST /api/aiRequest Body:
{
"sequence": "1,1,2,3,5,8,13"
}Response:
{
"status": "success",
"result": {
"sequence": [1, 1, 2, 3, 5, 8, 13],
"identifications": ["Fibonacci sequence"],
"recurrences": {
"linear": "a(n) = a(n-1) + a(n-2)",
"order": 2
}
}
}GET /healthResponse:
{
"status": "healthy",
"service": "MathOS",
"version": "1.0.0"
}All endpoints return consistent error responses:
{
"status": "error",
"error": "Error message description"
}HTTP Status Codes:
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request (invalid input) |
| 500 | Internal Server Error |
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.14 | Core language |
| Flask | 3.1.3 | Web framework |
| Gunicorn | 26.0.0 | Production WSGI server |
| SymPy | 1.14 | Symbolic mathematics |
| NumPy | 2.5.1 | Numerical computing |
| SciPy | 1.18 | Scientific computing |
| Flask-CORS | 6.0.5 | Cross-origin support |
| Technology | Version | Purpose |
|---|---|---|
| Bootstrap | 5.3.0 | UI framework |
| Bootstrap Icons | 1.10.0 | Icon library |
| JavaScript | ES6 | Client-side interactivity |
| HTML5 | - | Structure |
| CSS3 | - | Styling (custom dark theme) |
| Technology | Purpose |
|---|---|
| Render.com | Cloud hosting |
| GitHub | Version control |
| Gunicorn | Production server |
MathOS/
├── math_research_platform/
│ ├── interfaces/
│ │ └── web_app.py # Flask web interface (main app)
│ ├── main.py # Core platform module
│ ├── __init__.py # Package initializer
│ └── [other modules] # Future math modules
├── .gitignore # Git ignore rules
├── requirements.txt # Python dependencies
├── README.md # This file
├── LICENSE # MIT License
└── [configuration files] # Future config files
web_app.py
- Flask application entry point
- Contains all routes and API endpoints
- Implements health checks
- Uses
main.pyfor mathematical computations - Serves HTML pages with Bootstrap interface
main.py
- Core mathematical engine
- Contains all math computation functions
- Exposes platform object with all methods
- Handles elliptic curves, Galois theory, etc.
requirements.txt
- All Python dependencies
- Version-locked for stability
- Used by Render and local installations
-
Create a Render Account
- Visit render.com
- Sign up with GitHub
-
Create New Web Service
- Click "New +" -> "Web Service"
- Connect your GitHub repository
- Select
Soyebsoyeb/MathOS
-
Configure Service
Name: MathOS Environment: Production Language: Python 3 Branch: main Region: Oregon (US West)
-
Set Build Settings
Build Command: pip install -r requirements.txt Start Command: gunicorn --worker-class gthread --threads 4 --timeout 120 --bind 0.0.0.0:$PORT interfaces.web_app:app Root Directory: math_research_platform -
Set Environment Variables
SECRET_KEY = (generate random string)
-
Deploy
- Click "Create Web Service"
- Wait for build and deployment
- Access at:
https://mathos.onrender.com
# Install Heroku CLI
curl https://cli-assets.heroku.com/install.sh | sh
# Create App
heroku create mathos
heroku config:set SECRET_KEY=your-secret-key
git push heroku main
# Scale Dynos
heroku ps:scale web=1# Launch Ubuntu Instance
# SSH into Instance
ssh -i key.pem ubuntu@ec2-ip
# Install Dependencies
sudo apt update
sudo apt install python3-pip nginx -y
pip install -r requirements.txt
# Run with Gunicorn
gunicorn --worker-class gthread --threads 4 --timeout 120 --bind 0.0.0.0:8000 math_research_platform.interfaces.web_app:app| Parameter | Value | Purpose |
|---|---|---|
| Worker Class | gthread | Handles concurrent requests |
| Threads | 4 | Concurrent request handling |
| Timeout | 120s | Long-running computations |
| Memory | 512MB (free) | Sufficient for most operations |
| CPU | 0.1 (free) | Single-core for computations |
Caching
- Implement Redis cache for frequent computations
- Cache API responses for repeated queries
Asynchronous Processing
- Use Celery for long-running tasks
- Implement job queues
Database Integration
- Store computation results
- Cache historical queries
Load Balancing
- Use multiple workers
- Implement horizontal scaling
# Add monitoring middleware
@app.before_request
def before_request():
request.start_time = time.time()
@app.after_request
def after_request(response):
elapsed = time.time() - request.start_time
print(f"Request took {elapsed:.2f}s")
return responseEnvironment Variables
- SECRET_KEY stored in environment
- No hardcoded secrets
CORS Configuration
- Controlled cross-origin access
- Prevents unauthorized API access
Input Validation
- JSON request validation
- Type checking
- Bounds checking
Error Handling
- Proper exception handling
- No sensitive information in errors
Rate Limiting
from flask_limiter import Limiter
limiter = Limiter(app, key_func=lambda: request.remote_addr)
@app.route('/api/curve', methods=['POST'])
@limiter.limit("10 per minute")
def api_curve():
# ...HTTPS Enforce
from flask_talisman import Talisman
Talisman(app)Authentication
from flask_jwt_extended import JWTManager, jwt_required
# Add authentication to sensitive endpointsCode Contributions
- New mathematical modules
- Performance improvements
- Bug fixes
- Test coverage
Documentation
- API documentation
- User guides
- Tutorials
UI/UX
- Responsive design improvements
- Accessibility enhancements
- Theme customizations
-
Fork Repository
git clone https://github.com/your-username/MathOS.git cd MathOS -
Create Branch
git checkout -b feature/AmazingFeature
-
Make Changes
- Write code
- Add tests
- Update documentation
-
Test
python -m pytest
-
Commit
git add . git commit -m "Add some AmazingFeature"
-
Push
git push origin feature/AmazingFeature
-
Create Pull Request
- Open PR on GitHub
- Describe changes
- Wait for review
- Python: PEP 8
- JavaScript: ESLint
- HTML/CSS: Bootstrap conventions
# test_mathos.py
import unittest
from math_research_platform.main import platform
class TestMathOS(unittest.TestCase):
def test_elliptic_curve(self):
result = platform.analyze_elliptic_curve(1, 1)
self.assertEqual(result['rank'], 1)
if __name__ == '__main__':
unittest.main()This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2026 Soyebsoyeb
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- SymPy - Symbolic mathematics engine
- Flask - Web framework
- Bootstrap - UI components
- Gunicorn - Production server
- NumPy / SciPy - Scientific computing
- Mathematical research community
- Open source contributions
- Educational platforms
- Soyebsoyeb - Creator and maintainer
- Render.com - Free tier hosting
| Resource | Link |
|---|---|
| Live Demo | mathos-ogx3.onrender.com |
| GitHub Issues | Issues |
| Source Code | Repository |
| API Documentation | API Docs |
- Check Documentation - Read the README
- Search Issues - Look for similar problems
- Create Issue - Report bugs/feature requests
- Contact - Reach out to maintainers
| Issue | Cause | Solution |
|---|---|---|
| App Takes Long to Load | Free tier spin-down | Wait ~30 seconds for wake-up |
| ModuleNotFoundError | Missing dependencies | Run pip install -r requirements.txt |
| Port Already in Use | Another process on port 5000 | Use different port or kill process |
| CORS Errors | Cross-origin restrictions | Use the API from allowed origins |
- Graph Database - Store and query mathematical structures
- Jupyter Integration - Interactive notebooks
- Visualization - 3D plots and graphs
- Collaboration - Share and discuss results
- More Math Modules - Number theory, algebraic geometry
- Machine Learning - Automated theorem proving
- Mobile App - React Native version
- Cloud Storage - Save and load computations
- Export Options - PDF, LaTeX, Markdown
- Batch Processing - Run multiple computations
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2026-07-19 | Initial release |
| 0.9.0 | 2026-07-15 | Beta testing |
| 0.8.0 | 2026-07-10 | Alpha release |
Made with passion and precision by Soyebsoyeb