SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.09048 · 2023

MiDi: Mixed Graph and 3D Denoising Diffusion for Molecule Generation

arXiv · PDF · Open in the Atlas

Code that ran

8 of 13 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; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 3 failures of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2302.09048.json · badge: /api/ran/2302.09048.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
cvignac/midi canonical (classifier label)
classifier basis not recorded on the link
8 ran · 5 no recorded run
FunctionStatusWhere it lives
check_stability Ran
ran on a synthesized input
cvignac/midi/midi/analysis/rdkit_functions.py
code served (permissive licence) · get_code("2f2b4dc88b682898")
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

torch.manual_seed(0)

# Build a minimal Molecule class with required attributes
class Molecule:
    def __init__(self, atom_types, bond_types, charges, device='cpu'):
        self.atom_types = atom_types
        self.bond_types = bond_types
        self.charges = charges

# Build a minimal dataset_info class with atom_decoder
class DatasetInfo:
    def __init__(self):
        # Map atom type indices to atom symbols
        self.atom_decoder = {0: 'H', 1: 'C', 2: 'N', 3: 'O', 4: 'F', 5: 'S'}

# Create a small molecule with 4 atoms
# Atom types: [H, C, N, O] represented as indices [0, 1, 2, 3]
atom_types = torch.tensor([0, 1, 2, 3], dtype=torch.long)

# Bond types: 4 atoms means we need edge info. 
# Shape should be (4, 4) for a complete edge matrix, or we sum over edges per atom
# Let's create bond_types that will be summed per atom to get valencies
# For 4 atoms, edge_types shape (4, 4) where edge_types[i] sums to valency of atom i
bond_types = torch.tensor([
    [0, 1, 0, 0],  # atom 0 (H): 1 bond
    [1, 0, 2, 1],  # atom 1 (C): 4 bonds total
    [0, 2, 0, 1],  # atom 2 (N): 3 bonds total
    [0, 1, 1, 0]   # atom 3 (O): 2 bonds total
], dtype=torch.float)

# Charges: one per atom
charges = torch.tensor([0, 0, 0, 0], dtype=torch.long)

# Create molecule instance
molecule = Molecule(
    atom_types=atom_types,
    bond_types=bond_types,
    charges=charges
)

# Create dataset_info
dataset_info = DatasetInfo()

ARGS = {
    'molecule': molecule,
    'dataset_info': dataset_info,
    'debug': False,
    'atom_decoder': None,
    'smiles': None
}
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 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
effective_batch_size Ran
ran, honoured the contract we drafted
cvignac/midi/midi/datasets/adaptive_loader.py
code served (permissive licence) · get_code("6dcb1a7a685a56a3")
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 int, ndim 0, dtype family int, 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 math

def effective_batch_size(max_size, reference_batch_size, reference_size=20, sampling=False):
    x = reference_batch_size * (reference_size / max_size) ** 2
    return math.floor(1.8 * x) if sampling else math.floor(x)

ARGS = {
    "max_size": 100,
    "reference_batch_size": 32,
    "reference_size": 20,
    "sampling": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
load_pickle Ran
ran; our contract draft was wrong, not the code
cvignac/midi/midi/analysis/analyse_charges.py
code served (permissive licence) · get_code("70db7c9cbe9e680d")
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) and returned dict. 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 pickle
import tempfile
import os

# Create a temporary file with pickled data
temp_dir = tempfile.mkdtemp()
temp_path = os.path.join(temp_dir, "test.pkl")

# Create some sample data to pickle
sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

# Write the pickled data to the temporary file
with open(temp_path, 'wb') as f:
    pickle.dump(sample_data, f)

ARGS = {
    "path": temp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
masked_softmax Ran
ran on a synthesized input
cvignac/midi/midi/models/layers.py
code served (permissive licence) · get_code("35df91e0cf6e7565")
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 (2, 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

torch.manual_seed(0)

# Create a small tensor for the input
x = torch.randn(2, 4)

# Create a mask tensor with the same shape
# mask should have values 0 and 1, where 1 indicates valid positions
mask = torch.tensor([[1, 1, 0, 1],
                     [1, 0, 1, 1]], dtype=torch.float32)

ARGS = {
    'x': x,
    'mask': mask,
    'dim': 1
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
maybe_subset Ran
ran on a synthesized input
cvignac/midi/midi/datasets/abstract_dataset.py
code served (permissive licence) · get_code("12573f6a644aba8f")
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 Subset. 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
from torch.utils.data import TensorDataset

torch.manual_seed(0)

# Create a minimal dataset with __len__ support
class SimpleDataset:
    def __init__(self, size=10):
        self.data = torch.randn(size, 4)
        self.labels = torch.randint(0, 2, (size,))
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx], self.labels[idx]

# Create a small dataset instance
ds = SimpleDataset(size=10)

ARGS = {
    'ds': ds,
    'random_subset': 0.5,
    'split': 'train'
}
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 Subset — a Subset 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
plot_molecule3d Ran
ran on a synthesized input
cvignac/midi/midi/analysis/visualization.py
code served (permissive licence) · get_code("3e1c2c62a1bf6189")
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 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 torch
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

torch.manual_seed(0)

# Create a 3D axes object
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# positions: tensor of shape (num_atoms, 3) with x, y, z coordinates
# Using 5 atoms for variety
positions = torch.randn(5, 3)

# atom_types: tensor or list of atom type indices (integers)
# Using 5 atoms with types from 0 to 3
atom_types = torch.tensor([0, 1, 2, 3, 1], dtype=torch.long)

# edge_types: tensor of shape (num_atoms, num_atoms) indicating edge presence
# entry [i, j] > 0 means there's an edge from atom i to atom j
edge_types = torch.tensor([
    [0, 1, 0, 1, 0],
    [1, 0, 1, 0, 1],
    [0, 1, 0, 1, 0],
    [1, 0, 1, 0, 1],
    [0, 1, 0, 1, 0]
], dtype=torch.long)

# alpha: transparency value
alpha = 0.7

# hex_bg_color: color for edges (hex format string or matplotlib color)
hex_bg_color = '#808080'

# num_atom_types: number of distinct atom types
num_atom_types = 4

ARGS = {
    'ax': ax,
    'positions': positions,
    'atom_types': atom_types,
    'edge_types': edge_types,
    'alpha': alpha,
    'hex_bg_color': hex_bg_color,
    'num_atom_types': num_atom_types
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, mpl_toolkits, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
remove_mean_with_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cvignac/midi/midi/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from mninniri/GrIDDD, is pointer only (licence: NONE) · get_code("250da8c7f72b64ed")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mninniri/GrIDDD, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

setup_wandb Ran
ran; our contract draft was wrong, not the code
cvignac/midi/midi/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from mninniri/GrIDDD, is pointer only (licence: NONE) · get_code("be7738474afcfd15")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mninniri/GrIDDD, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

build_xae_molecule Not yet run
unverified (harvested, no recorded run)
cvignac/midi/midi/analysis/baselines_evaluation.py
code served (permissive licence) · get_code("537165607cf63f8e")
How it ran

no invocation recorded.

geom_predictor Not yet run
unverified (harvested, no recorded run)
cvignac/midi/midi/analysis/baselines_evaluation.py
pointer only (licence: MIT); the stored copy get_code serves, from mninniri/GrIDDD, is pointer only (licence: NONE) · get_code("ab8617fd28b92b3c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mninniri/GrIDDD, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_bond_order Not yet run
unverified (harvested, no recorded run)
cvignac/midi/midi/analysis/baselines_evaluation.py
pointer only (licence: MIT); the stored copy get_code serves, from mninniri/GrIDDD, is pointer only (licence: NONE) · get_code("8472ecb13cf2144c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mninniri/GrIDDD, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

remove_hydrogens Not yet run
unverified (harvested, no recorded run)
cvignac/midi/midi/datasets/dataset_utils.py
code served (permissive licence) · get_code("43b3ed740aac1a3c")
How it ran

no invocation recorded.

to_dense Not yet run
unverified (harvested, no recorded run)
cvignac/midi/midi/utils.py
code served (permissive licence) · get_code("c431df61de63102e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 6 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 6 later) and 7 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
load_pickle 9 other papers
4 dated earlier, 5 later
1907.00456 (2019-07)
Way Off-Policy Batch Deep Reinforcement Learning of Implicit Human Preferences in Dialog
2005.03545 (2020-05)
MISA: Modality-Invariant and -Specific Representations for Multimodal Sentiment Analysis
and 6 more not named here
geom_predictor 2 other papers
2 later
2305.07508 (2023-05)
MolDiff: Addressing the Atom-Bond Inconsistency Problem in 3D Molecule Diffusion Generation
2506.15725 (2025-06)
Graph Diffusion that can Insert and Delete
get_bond_order 2 other papers
2 later
2305.07508 (2023-05)
MolDiff: Addressing the Atom-Bond Inconsistency Problem in 3D Molecule Diffusion Generation
2506.15725 (2025-06)
Graph Diffusion that can Insert and Delete
effective_batch_size 1 other paper
1 later
2406.17341 (2024-06)
Generative Modelling of Structurally Constrained Graphs
remove_mean_with_mask 1 other paper
1 later
2506.15725 (2025-06)
Graph Diffusion that can Insert and Delete
setup_wandb 1 other paper
1 later
2506.15725 (2025-06)
Graph Diffusion that can Insert and Delete

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-22.

Repositories linked to this paper

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

Abstract

This work introduces MiDi, a novel diffusion model for jointly generating molecular graphs and their corresponding 3D arrangement of atoms. Unlike existing methods that rely on predefined rules to determine molecular bonds based on the 3D conformation, MiDi offers an end-to-end differentiable approach that streamlines the molecule generation process. Our experimental results demonstrate the effectiveness of this approach. On the challenging GEOM-DRUGS dataset, MiDi generates 92% of stable molecules, against 6% for the previous EDM model that uses interatomic distances for bond prediction, and 40% using EDM followed by an algorithm that directly optimize bond orders for validity. Our code is available at github.com/cvignac/MiDi.

For agents

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

get_harvested_code_for_paper("2302.09048")
get_code_for_paper("2302.09048")
have("2302.09048")

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

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

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

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

Connect an agent — have() is free.