SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.17163 · ICLR · 2025

Port-Hamiltonian Architectural Bias for Long-Range Propagation in Deep Graph Networks

Davide Bacciu, Alessio Gravina, Claudio Gallicchio, Alessandro Trenta, Simon Heilig

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2405.17163.json · badge: /api/ran/2405.17163.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
simonheilig/porthamiltonian-dgn canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
eval_ap Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
simonheilig/porthamiltonian-dgn/graph_prop_pred/train_GraphProp.py
code served (permissive licence) · get_code("adcdf6d3cfdc929c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create sample data for eval_ap
# y_true: binary labels (samples x tasks)
# y_pred: predicted scores (samples x tasks)
# We need at least some positive and negative labels per task to avoid the error

num_samples = 10
num_tasks = 3

# Create y_true with both positive and negative labels per task
y_true = np.array([
    [1, 0, 1],
    [0, 1, 0],
    [1, 1, 1],
    [0, 0, 0],
    [1, 0, 1],
    [0, 1, 0],
    [1, 1, 0],
    [0, 0, 1],
    [1, 0, 0],
    [0, 1, 1],
], dtype=int)

# Create y_pred as continuous scores between 0 and 1
y_pred = np.array([
    [0.9, 0.1, 0.8],
    [0.2, 0.8, 0.3],
    [0.85, 0.75, 0.9],
    [0.1, 0.2, 0.15],
    [0.95, 0.3, 0.7],
    [0.15, 0.85, 0.25],
    [0.8, 0.7, 0.4],
    [0.25, 0.35, 0.88],
    [0.88, 0.12, 0.2],
    [0.3, 0.9, 0.92],
], dtype=float)

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_uninitialized_parameter Ran
ran, violated the contract we drafted
simonheilig/porthamiltonian-dgn/graph_prop_pred/models/phdgn_utils.py
code served (permissive licence) · get_code("4c8636912cd02526")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.nn.parameter import UninitializedParameter

torch.manual_seed(0)

# The function checks if x is an instance of torch.nn.parameter.UninitializedParameter
# We need to pass a value for the parameter 'x'

# Create a valid UninitializedParameter if available
if hasattr(torch.nn.parameter, 'UninitializedParameter'):
    x = UninitializedParameter()
else:
    # Fallback: pass a regular tensor if UninitializedParameter is not available
    x = torch.tensor([1.0, 2.0, 3.0, 4.0])

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (harness:RuntimeError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
line_graph Ran
ran; our contract draft was wrong, not the code
simonheilig/porthamiltonian-dgn/graph_transfer_task/graph_transfer_data.py
code served (permissive licence) · get_code("7cf0c0aa4c265cb4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Data. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "distance": 5,
    "channels": 3,
    "seed": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Data — a Data output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reset_bias_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
simonheilig/porthamiltonian-dgn/graph_prop_pred/models/phdgn_utils.py
code served (permissive licence) · get_code("171608f792ff5805")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch_geometric.nn import inits

torch.manual_seed(0)

# Create a small bias tensor
bias = torch.zeros(4)

# in_channels: positive integer
in_channels = 4

# initializer: can be None, 'zeros', or other string
initializer = 'zeros'

ARGS = {
    'bias': bias,
    'in_channels': in_channels,
    'initializer': initializer,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reset_weight_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
simonheilig/porthamiltonian-dgn/graph_prop_pred/models/phdgn_utils.py
code served (permissive licence) · get_code("37dc8fcbfe178a3d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch_geometric.nn import inits
import math

torch.manual_seed(0)

# Create a weight tensor with shape (4, 3) - small, distinct dimensions
weight = torch.randn(4, 3, dtype=torch.float32)

# Define in_channels as a positive integer
in_channels = 3

# Define initializer - test with one of the supported options
initializer = 'glorot'

ARGS = {
    'weight': weight,
    'in_channels': in_channels,
    'initializer': initializer,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 3) — shape (4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ring_transfer_graph Ran
ran; our contract draft was wrong, not the code
simonheilig/porthamiltonian-dgn/graph_transfer_task/graph_transfer_data.py
code served (permissive licence) · get_code("57358b1aca0d6ae1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Data. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "distance": 3,
    "channels": 4,
    "add_crosses": True,
    "seed": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Data — a Data output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
simonheilig/porthamiltonian-dgn/minesweeper/model_selection.py
code served (permissive licence) · get_code("67cf67f9cfc213a8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# y is the target variable for supervised learning
# It needs to be array-like with length, and contain class labels for stratification
y = np.array([0, 1, 0, 1, 0, 1, 0, 1])

ARGS = {
    'y': y,
    'eval_size': 0.25,
    'n_splits': 2,
    'seed': 9
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train Ran
ran; our contract draft was wrong, not the code
simonheilig/porthamiltonian-dgn/graph_prop_pred/train_GraphProp.py
code served (permissive licence) · get_code("ccdff96dde8c6510")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Define a minimal model that accepts a batch object and returns output
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, batch):
        # batch has x and y attributes
        return self.linear(batch.x)

# Define a minimal batch class
class Batch:
    def __init__(self, x, y):
        self.x = x
        self.y = y
        self.batch = torch.tensor([0, 1], dtype=torch.long)  # batch indices
    
    def to(self, device):
        self.x = self.x.to(device)
        self.y = self.y.to(device)
        self.batch = self.batch.to(device)
        return self

# Define a minimal criterion that accepts output, target, and batch indices
class MinimalCriterion(nn.Module):
    def __init__(self):
        super().__init__()
        self.mse = nn.MSELoss()
    
    def forward(self, out, target, batch_indices):
        return self.mse(out, target)

# Create model
model = MinimalModel()

# Create optimizer
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

# Create tiny dataloader with 2 batches
batch1 = Batch(
    x=torch.randn(2, 4, dtype=torch.float32),
    y=torch.randn(2, 3, dtype=torch.float32)
)
batch2 = Batch(
    x=torch.randn(2, 4, dtype=torch.float32),
    y=torch.randn(2, 3, dtype=torch.float32)
)
dataloader = [batch1, batch2]

# Create criterion
criterion = MinimalCriterion()

# Set device and dtype
device = 'cpu'
dtype = torch.float32

ARGS = {
    'model': model,
    'optimizer': optimizer,
    'dataloader': dataloader,
    'criterion': criterion,
    'device': device,
    'dtype': dtype
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
update_csv Ran
ran; our contract draft was wrong, not the code
simonheilig/porthamiltonian-dgn/graph_transfer_task/utils.py
code served (permissive licence) · get_code("51c5c74c2f169b4a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import pandas
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory for the CSV file
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, "results.csv")

# Initialize an empty dataframe list (the function appends dicts to it)
df = []

# Scalar loss values
best_train_loss = 0.125
best_val_loss = 0.234
best_test_loss = 0.289
best_epoch = 42

# Model parameters dict
model_params = {
    'hidden_dim': 128,
    'num_layers': 3,
    'dropout': 0.5,
    'activation': 'relu'
}

# Experiment arguments dict
exp_args = {
    'learning_rate': 0.001,
    'batch_size': 32,
    'optimizer': 'adam',
    'dataset': 'synthetic',
    'seed': 0
}

ARGS = {
    'df': df,
    'best_train_loss': best_train_loss,
    'best_val_loss': best_val_loss,
    'best_test_loss': best_test_loss,
    'best_epoch': best_epoch,
    'model_params': model_params,
    'exp_args': exp_args,
    'path': csv_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cliquepath_transfer_graph Not yet run
unverified (harvested, no recorded run)
simonheilig/porthamiltonian-dgn/graph_transfer_task/graph_transfer_data.py
code served (permissive licence) · get_code("9e23c0bf026e8677")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 4 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
eval_ap 2 other papers
1 dated earlier, 1 later
2312.01538 (2023-12)
Recurrent Distance Filtering for Graph Representation Learning
2601.11135 (2026-01)
Context-aware Graph Causality Inference for Few-Shot Molecular Property Prediction
is_uninitialized_parameter 1 other paper
1 later
2512.17762 (2025-12)
Can You Hear Me Now? A Benchmark for Long-Range Graph Propagation
reset_bias_ 1 other paper
1 later
2512.17762 (2025-12)
Can You Hear Me Now? A Benchmark for Long-Range Graph Propagation
reset_weight_ 1 other paper
1 later
2512.17762 (2025-12)
Can You Hear Me Now? A Benchmark for Long-Range Graph Propagation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The dynamics of information diffusion within graphs is a critical open issue that heavily influences graph representation learning, especially when considering longrange propagation. This calls for principled approaches that control and regulate the degree of propagation and dissipation of information throughout the neural flow. Motivated by this, we introduce port-Hamiltonian Deep Graph Networks, a novel framework that models neural information flow in graphs by building on the laws of conservation of Hamiltonian dynamical systems. We reconcile under a single theoretical and practical framework both non-dissipative long-range propagation and non-conservative behaviors, introducing tools from mechanical systems to gauge the equilibrium between the two components. Our approach can be applied to general message-passing architectures, and it provides theoretical guarantees on information conservation in time. Empirical results prove the effectiveness of our port-Hamiltonian scheme in pushing simple graph convolutional architectures to state-of-the-art performance in long-range benchmarks.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2405.17163")
get_code_for_paper("2405.17163")
have("2405.17163")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2405.17163.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2405.17163.svg)](https://syntology.ai/paper/2405.17163)

Connect an agent — have() is free.