Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ommx.v1.ParametericInstance and Instance.penalty_method in Python SDK #200

Merged
merged 19 commits into from
Dec 12, 2024
Merged
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
21 changes: 21 additions & 0 deletions python/ommx/ommx/_ommx_rust.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ class Function:
def mul_quadratic(self, quadratic: Quadratic) -> Function: ...
def mul_polynomial(self, polynomial: Polynomial) -> Function: ...

class Instance:
@staticmethod
def from_bytes(bytes: bytes) -> Instance: ...
def to_bytes(self) -> bytes: ...
def validate(self) -> None: ...
def as_pubo_format(self) -> dict: ...
def as_qubo_format(self) -> tuple[dict, float]: ...
def penalty_method(self) -> ParametricInstance: ...

class Linear:
@staticmethod
def single_term(id: int, coefficient: float) -> Linear: ...
Expand All @@ -112,6 +121,18 @@ class Linear:
def add_scalar(self, scalar: float) -> Linear: ...
def mul_scalar(self, scalar: float) -> Linear: ...

class Parameters:
@staticmethod
def from_bytes(bytes: bytes) -> Parameters: ...
def to_bytes(self) -> bytes: ...

class ParametricInstance:
@staticmethod
def from_bytes(bytes: bytes) -> ParametricInstance: ...
def to_bytes(self) -> bytes: ...
def validate(self) -> None: ...
def with_parameters(self, parameters: Parameters) -> Instance: ...

class Polynomial:
@staticmethod
def decode(bytes: bytes) -> Polynomial: ...
Expand Down
Loading
Loading