- Introduction
- Features
- Technologies Used
- System Architecture
- Machine Learning Model
- Prerequisites
- Installation
- Configuration
- Running the Application
- API Documentation
- Frontend Structure
- Backend Structure
- Data Flow
- Troubleshooting
- Future Enhancements
- Contributing
- License
QuantumWaste is an innovative project that leverages quantum-inspired algorithms and machine learning to simulate and optimize the recycling process for complex polymers. This cutting-edge application combines quantum computing concepts with materials science to explore new frontiers in sustainable waste management.
- Quantum-inspired optimization algorithm for polymer recycling
- Machine learning model for predicting recycling difficulty
- Interactive 3D visualization of polymer structures
- Real-time simulation of recycling processes
- Dynamic charts displaying recycling difficulty and feature importances
- Responsive web design for various device sizes
-
Frontend:
- React.js
- Three.js (for 3D visualization)
- Material-UI
- Recharts (for data visualization)
-
Backend:
- Flask (Python)
- PennyLane (for quantum-inspired algorithms)
- Scikit-learn (for machine learning models)
- NumPy (for numerical computations)
- Joblib (for model serialization)
-
Development Tools:
- Git & GitHub (version control)
- npm (package management)
- Visual Studio Code (recommended IDE)
QuantumWaste consists of two main components:
- Frontend: A React-based web application that provides an interactive interface for visualizing polymer structures and simulation results.
- Backend: A Flask server that handles quantum-inspired simulations, polymer modeling, and machine learning predictions.
These components interact as follows:
- The frontend sends simulation parameters to the backend.
- The backend processes these parameters using quantum-inspired algorithms and the machine learning model.
- The results are sent back to the frontend for visualization.
The QuantumWaste project uses a Random Forest Regressor to predict the recycling difficulty of polymers. Here are the key aspects of the model:
- Model Type: Random Forest Regressor
- Features:
- Polymer length
- Composition (A, B, C components)
- Average bond strength
- Temperature
- Pressure
- Target: Recycling difficulty score
- Data Generation: Synthetic data is generated to train the model
- Data Preprocessing: StandardScaler is used to normalize the input features
- Model Parameters:
- Number of estimators: 200
- Max depth: 10
- Model Persistence: The trained model and scaler are saved using joblib for quick loading
The model provides not only the recycling difficulty prediction but also the feature importances, giving insights into which factors most significantly affect the recycling process.
Before you begin, ensure you have the following installed:
- Python 3.7+
- Node.js 14+
- npm 6+
- Git
-
Clone the repository:
git clone https://github.com/ascender1729/QuantumWaste.git cd QuantumWaste
-
Set up the backend:
cd src/backend python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` pip install -r requirements.txt
-
Set up the frontend:
cd ../../src/frontend npm install
-
Backend Configuration:
- Create a
.env
file in thesrc/backend
directory with any necessary environment variables.
- Create a
-
Frontend Configuration:
- If your backend is running on a different port or host, update the API URL in
src/frontend/src/config.js
.
- If your backend is running on a different port or host, update the API URL in
-
Start the backend:
cd src/backend source venv/bin/activate # On Windows use `venv\Scripts\activate` python app.py
-
Start the frontend (in a new terminal):
cd src/frontend npm start
-
Open your browser and navigate to
http://localhost:3000
to view the application.
The backend provides the following API endpoints:
POST /simulate
: Run a quantum-inspired simulation and get recycling difficulty predictionGET /model_info
: Retrieve information about the current machine learning model
For detailed API documentation, refer to the comments in the app.py
file.
The frontend is organized as follows:
src/
components/
: React componentsPolymerVisualizer.js
: 3D visualization componentSimulationForm.js
: Form for inputting simulation parametersResultsDisplay.js
: Component for displaying simulation results
App.js
: Root componentindex.js
: Entry point
The backend is structured as follows:
app.py
: Flask application and route definitionsquantum_algorithm.py
: Implementation of quantum-inspired algorithmspolymer_simulator.py
: Polymer structure simulation logicmodels/
: Directory for machine learning modelsrecycling_model.py
: Random Forest model for recycling difficulty prediction
- User inputs simulation parameters in the frontend
- Parameters are sent to the backend via API call
- Backend runs quantum-inspired simulation
- Machine learning model predicts recycling difficulty
- Results (including prediction and feature importances) are sent back to the frontend
- Frontend updates the 3D visualization and charts
- If the frontend fails to connect to the backend, ensure the backend is running and the API URL is correct in
config.js
. - For issues with the 3D visualization, check the browser console for Three.js-related errors.
- If the quantum simulation fails, verify that PennyLane is properly installed and configured.
- If the model fails to load, ensure that the
recycling_model.joblib
andscaler.joblib
files exist in the correct directory.
- Implement more complex quantum algorithms
- Add support for a wider range of polymer types
- Integrate with real-world recycling data
- Develop an API for external integrations
- Implement user authentication for saving simulations
- Enhance the machine learning model with more features and real-world data
We welcome contributions to QuantumWaste! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.