Skip to content

Commit

Permalink
Revert "dual_variable and penalty_weight in Constraint message …
Browse files Browse the repository at this point in the history
…for QUBO (#144)" (#149)

This reverts commit a0d0707 #144 

- The strategy for implementing QUBO and PUBO conversion has been
changed to use #146, which conflicts with #144
  • Loading branch information
termoshtt authored Nov 19, 2024
1 parent 12fbe2e commit 912bf96
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 93 deletions.
13 changes: 0 additions & 13 deletions proto/ommx/v1/constraint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,6 @@ message Constraint {

// Detail human-readable description of the constraint.
optional string description = 7;

// Temporal value for the Lagrangian dual variable of this constraint.
//
// This field is intended to use for storing the temporal dual variable value during the optimization process.
// This will be different from the optimal dual variable value.
//
// This field is also allowed to use for modified dual variable like appearing augmented Lagrangian method,
// which uses modified Lagrangian and thus the dual variable is also modified.
//
optional double dual_variable = 9;

// Weight of the penalty term for the constraint.
optional double penalty_weight = 10;
}

// A constraint evaluated with a state
Expand Down
16 changes: 0 additions & 16 deletions python/ommx/ommx/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,14 +1210,6 @@ def add_parameters(self, parameters: dict[str, str]) -> Constraint:
self.raw.parameters.update(parameters)
return self

def set_dual_variable(self, value: float) -> Constraint:
self.raw.dual_variable = value
return self

def set_penalty_weight(self, value: float) -> Constraint:
self.raw.penalty_weight = value
return self

@property
def function(self) -> Function:
return Function(self.raw.function)
Expand Down Expand Up @@ -1246,14 +1238,6 @@ def subscripts(self) -> list[int]:
def parameters(self) -> dict[str, str]:
return dict(self.raw.parameters)

@property
def dual_variable(self) -> float:
return self.raw.dual_variable

@property
def penalty_weight(self) -> float:
return self.raw.penalty_weight

def __repr__(self) -> str:
if self.raw.equality == Equality.EQUALITY_EQUAL_TO_ZERO:
return f"Constraint({self.function.__repr__()} == 0)"
Expand Down
20 changes: 10 additions & 10 deletions python/ommx/ommx/v1/constraint_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 0 additions & 39 deletions python/ommx/ommx/v1/constraint_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions rust/ommx/src/mps/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ fn convert_constraints(mps: &Mps, name_id_map: &HashMap<ColumnName, u64>) -> Vec
parameters: HashMap::new(),
name: Some(row_name.0.clone()),
description: None,
dual_variable: None,
penalty_weight: None,
})
}
constrs
Expand Down
13 changes: 0 additions & 13 deletions rust/ommx/src/ommx.v1.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 912bf96

Please sign in to comment.