Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/Test-CI-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
--extra-index-url https://pypi.org/simple
python -m pip install -U -r requirements_tests.txt \
--extra-index-url https://pypi.org/simple
python -m pip install qiskit # 👈 Added line to install Qiskit
python -m pip install imbalanced-learn

- name: Install couenne solver
env:
Expand Down
31 changes: 5 additions & 26 deletions .github/workflows/Test-CI-main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: "Test Library CI (main)"

# This workflow always run in the context of Classiq/classiq-library (base repo) but might use a branch from a fork to test its contribution
# PRs from users (should be from a fork) need to targePrint repository namet `main` branch which runs against `prod` environment

on:
push: # Trigger the workflow on push to the specific branch
push:
branches:
- main
pull_request_target: # Trigger the workflow on pull requests targeting the specific branch
# Note: `pull_request_target` ensures that the tests run in the context of the `main` branch, not in the user's fork.
pull_request_target:
branches:
- main

workflow_dispatch:

defaults:
Expand All @@ -37,12 +32,9 @@ jobs:
id: checkout
run: |
set -ex

# Debugging: initial git status
echo "==== Git status before checkout ===="
git status

# Handle different GitHub Actions events
if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
echo "Handling pull_request_target event"
echo "SHOULD_TEST_ALL_FILES=false" >> $GITHUB_ENV
Expand All @@ -51,7 +43,7 @@ jobs:
echo "PR from a fork detected. Checking out the fork's branch."
git remote add fork https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git
git fetch fork ${{ github.event.pull_request.head.ref }}
git checkout -B ci-testing-branch FETCH_HEAD # Tested code is comming from this branch (contributer's)
git checkout -B ci-testing-branch FETCH_HEAD
else
echo "PR from the same repository detected. Checking out the branch."
git fetch origin ${{ github.event.pull_request.head.ref }}
Expand All @@ -71,7 +63,6 @@ jobs:
exit 1
fi

# Debugging: final git status
echo "==== Git status after checkout ===="
git status

Expand All @@ -88,8 +79,6 @@ jobs:
run: |
echo "LATEST_CLASSIQ_VERSION=$(pip index versions classiq 2>/dev/null | grep classiq | cut -d '(' -f2 | cut -d ')' -f1)" >> $GITHUB_OUTPUT

# The caching we do follows from
# https://stackoverflow.com/questions/59127258/how-can-i-use-pip-cache-in-github-actions
- uses: actions/cache@v4
id: cache-pip
with:
Expand All @@ -98,7 +87,6 @@ jobs:
restore-keys: |
${{ runner.os }}-venv-

# Configure AWS credentials
- name: Configure AWS Credentials
uses: aws-actions/[email protected]
with:
Expand All @@ -112,6 +100,8 @@ jobs:
python -m pip install -U pip
python -m pip install -U -r requirements.txt
python -m pip install -U -r requirements_tests.txt
python -m pip install qiskit # 👈 Added line to install Qiskit
python -m pip install imbalanced-learn

- name: Install couenne solver
env:
Expand All @@ -126,35 +116,24 @@ jobs:
gzip -dc "$COUENNE_FILE" >"${LOCAL_BIN}/couenne"
chmod ugo+x "${LOCAL_BIN}/couenne"

#
# Setup Environment
#
# Set authentication with M2M token
- name: Set authentication
run: .github/scripts/get_m2m_token.sh
env:
IS_DEV: "false"
M2M_SECRET_ARN: "${{ secrets.PROD_M2M_SECRET_ARN }}"

#
# Propagate CI information to python tests
#
- name: Get changed notebook files
id: changed-files-ipynb
uses: tj-actions/[email protected]
with:
files: |
**/*.ipynb

# Run Notebook Tests
- name: Run Notebooks
run: python -m pytest --log-cli-level=INFO --durations=0 tests
env:
# to disable a warning in Jupyter notebooks
JUPYTER_PLATFORM_DIRS: "1"
# Passing which notebooks changed
SHOULD_TEST_ALL_FILES: "${{ env.SHOULD_TEST_ALL_FILES }}"
LIST_OF_IPYNB_CHANGED: "${{ steps.changed-files-ipynb.outputs.all_changed_files }}"
# Passing environment information
CLASSIQ_IDE: "https://platform.classiq.io"
CLASSIQ_HOST: "https://api.classiq.io"
78 changes: 78 additions & 0 deletions community/classiq_challenge_qaoa/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Implementation of a Hybrid Quantum-Classical System for Drug Discovery

## Description
This project focuses on developing a hybrid quantum-classical system that enhances drug-target interaction (DTI) prediction by leveraging quantum feature selection techniques (QAOA/VQE) alongside classical machine learning models (Neural Networks, SVM, Random Forest). The integration of quantum computing aims to improve computational efficiency and accuracy in feature selection for drug discovery.

---

## Objective
Develop a hybrid quantum-classical system for optimizing drug-target interaction prediction by:
- Utilizing Quantum Approximate Optimization Algorithm (QAOA) and Variational Quantum Eigensolver (VQE) for feature selection.
- Training classical machine learning models on quantum-selected features.
- Benchmarking quantum-enhanced feature selection against traditional techniques.

---

## Background
Predicting DTI plays a critical role in drug discovery, identifying potential drug candidates efficiently. Traditional computational methods rely on feature selection techniques that can be computationally expensive. Quantum computing offers an alternative by optimizing molecular feature selection, potentially leading to:
- Improved accuracy
- Enhanced computational efficiency
- Better representation of molecular descriptors

---

## Technical Approach
### 1. Data Preparation
- **Dataset Acquisition:** Utilize publicly available datasets such as PDBbind or DrugBank containing molecular descriptors and binding affinities.
- **Data Preprocessing:** Handle missing values, normalize numerical features, and encode categorical variables.
- **Feature Extraction:** Represent molecular structures numerically using descriptors such as:
- Extended Connectivity Fingerprints (ECFP)
- Mordred descriptors

### 2. Quantum Feature Selection (QAOA/VQE)
- **Problem Formulation:** Define feature selection as an optimization problem using a cost Hamiltonian:
\[ H = w z z + b z \]
- **Ansatz Selection:** Utilize a parameterized quantum circuit optimized for QAOA or VQE.
- **Quantum Circuit Construction:** Implement circuits on quantum platforms, optimizing:
- CX gate count
- Circuit depth

### 3. Hybrid Model Integration
- **Classical-Quantum Hybrid Model:**
- Use QAOA/VQE-selected features to train classical ML models (Neural Networks, Random Forest, SVM).
- Compare quantum-selected features with traditional methods (PCA, LASSO, RFE).
- **Training and Optimization:**
- Classical models trained using gradient descent.
- Quantum models optimized via QAOA/VQE optimizers.

### 4. Model Evaluation and Validation
- **Performance Metrics:**
- Accuracy
- Precision
- Recall
- F1-score
- **Benchmarking:** Compare quantum-enhanced feature selection with classical methods based on:
- Prediction accuracy
- Feature selection efficiency
- Computational complexity

---

## References
1. **J. K. Lim, D. G. Dickson, J. A. Black et al.**, "Hybrid Quantum-Classical System for Drug Discovery," National Library of Medicine, vol. 13, no. 8, pp. 1-10, Aug. 2022. [PMC9333455](https://pmc.ncbi.nlm.nih.gov/articles/PMC9333455/)
2. **Perdomo-Ortiz, N. Dickson, M. Drew-Brook, G. Rose, and A. Aspuru-Guzik**, "Finding Low-Energy Conformations of Lattice Protein Models by Quantum Annealing," Phys. Rev. Lett., vol. 111, no. 13, pp. 130505, Sep. 2013.
3. **K. S. Kumar, S. S. S. R. Depuru, and S. Arumugam**, "Drug Target Interaction Prediction Using Variational Quantum Classifier," 2022 IEEE International Conference on Quantum Computing and Engineering (QCE), Broomfield, CO, USA, 2022, pp. 1-8.

---

## Summary
This project explores the integration of quantum computing in drug discovery by combining quantum feature selection with classical machine learning models. By leveraging QAOA and VQE algorithms, the study aims to optimize molecular descriptor selection for improved drug-target interaction predictions. The project benchmarks quantum feature selection against classical techniques like PCA, RFE, and mutual information-based selection to evaluate efficiency, accuracy, and computational complexity.

Key focus areas include:
- **Feature selection efficiency**
- **Prediction accuracy**
- **Quantum circuit depth**
- **CX-gate count optimization**

The findings of this research will contribute to understanding quantum computing’s role in drug discovery and its potential for enhancing predictive modeling in drug repurposing efforts.

Binary file not shown.
21 changes: 21 additions & 0 deletions community/classiq_challenge_qaoa/drug_discovery_qubo.qmod
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"algorithm": {
"name": "vqe",
"params": {
"hamiltonian": [
{ "pauli": ["I", "I", "I", "I", "I", "I", "I", "I", "I", "I", "I", "I", "I", "I", "I"], "coefficient": -0.082 },
{ "pauli": ["I", "I", "I", "I", "I", "Z", "I", "I", "I", "I", "I", "I", "I", "I", "I"], "coefficient": -0.0035 },
{ "pauli": ["I", "I", "Z", "I", "I", "I", "I", "I", "I", "I", "I", "I", "I", "I", "I"], "coefficient": -0.0018 },
{ "pauli": ["I", "I", "I", "I", "I", "I", "I", "I", "I", "I", "Z", "I", "I", "I", "I"], "coefficient": -0.0051 }
],
"maximize": false,
"initial_point": [0.0, 0.0, 0.0, 0.0],
"optimizer": "COBYLA",
"max_iteration": 50,
"tolerance": 0.0,
"step_size": 0.0,
"skip_compute_variance": false,
"alpha_cvar": 0.7
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"constraints": {
"max_gate_count": {},
"optimization_parameter": "no_opt"
},
"preferences": {
"machine_precision": 8,
"custom_hardware_settings": {
"basis_gates": [
"y",
"s",
"x",
"id",
"cz",
"p",
"sdg",
"sx",
"rx",
"rz",
"cy",
"sxdg",
"cx",
"u",
"r",
"ry",
"tdg",
"h",
"u1",
"t",
"z",
"u2"
],
"is_symmetric_connectivity": true
},
"debug_mode": true,
"synthesize_all_separately": false,
"optimization_level": 3,
"output_format": [
"qasm"
],
"pretty_qasm": true,
"transpilation_option": "auto optimize",
"timeout_seconds": 300,
"random_seed": 3694275409
}
}
Loading
Loading