SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2008.05089 · 2020

Quaternion Graph Neural Networks

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 2 failures of our instrument; 4 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/2008.05089.json · badge: /api/ran/2008.05089.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
daiquocnguyen/QGNN canonical (classifier label)
classifier basis: census
9 ran · 4 no recorded run
FunctionStatusWhere it lives
get_Adj_matrix Ran
ran on a synthesized input
daiquocnguyen/QGNN/QGNN_pytorch/train_graph_Sup.py
code served (permissive licence) · get_code("bccf348440a4b4f6")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

class Graph:
    def __init__(self, g, edge_mat):
        self.g = g
        self.edge_mat = edge_mat

# Create small stand-in graphs
graph1_nodes = [0, 1, 2]
graph1_edges = np.array([[0, 1], [1, 2]]).T  # Shape (2, 2)

graph2_nodes = [0, 1]
graph2_edges = np.array([[0, 1]]).T  # Shape (2, 1)

graph1 = Graph(graph1_nodes, graph1_edges)
graph2 = Graph(graph2_nodes, graph2_edges)

batch_graph = [graph1, graph2]

ARGS = {
    "batch_graph": batch_graph
}
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 Tensor, shape (5, 5) — shape (5, 5) as a later run recorded it
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
get_batch_data Ran
ran on a synthesized input
daiquocnguyen/QGNN/QGNN_pytorch/train_graph_Sup.py
code served (permissive licence) · get_code("e8053c53d3622187")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

class Graph:
    def __init__(self, node_features, edge_mat, label):
        self.node_features = node_features
        self.edge_mat = edge_mat
        self.label = label
        self.g = list(range(len(node_features)))

# Create first graph
node_features_1 = np.array([[1.0, 2.0, 3.0, 4.0],
                             [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)
edge_mat_1 = np.array([[0, 1], [1, 0]], dtype=np.int64)
graph_1 = Graph(node_features_1, edge_mat_1, 0)

# Create second graph
node_features_2 = np.array([[9.0, 10.0, 11.0, 12.0],
                             [13.0, 14.0, 15.0, 16.0],
                             [17.0, 18.0, 19.0, 20.0]], dtype=np.float32)
edge_mat_2 = np.array([[0, 1, 2], [1, 2, 0]], dtype=np.int64)
graph_2 = Graph(node_features_2, edge_mat_2, 1)

batch_graph = [graph_1, graph_2]

ARGS = {
    'batch_graph': batch_graph
}
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 — 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
get_graphpool Ran
ran; our contract draft was wrong, not the code
daiquocnguyen/QGNN/QGNN_pytorch/train_graph_Sup.py
code served (permissive licence) · get_code("4cae232bef92f0a0")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

class Graph:
    def __init__(self, g):
        self.g = g

# Create batch_graph with 2 graphs
# First graph has 3 nodes, second graph has 2 nodes
graph1 = Graph([1, 2, 3])
graph2 = Graph([4, 5])
batch_graph = [graph1, graph2]

ARGS = {
    'batch_graph': batch_graph
}
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, shape (2, 5) — shape (2, 5) as a later run recorded it
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
label_smoothing Ran
ran on a synthesized input
daiquocnguyen/QGNN/QGNN_pytorch/model_graph_Sup.py
code served (permissive licence) · get_code("2e11b2ec901deb90")
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)

# Construct arguments for label_smoothing function
# The function expects:
# - true_labels: torch.Tensor with class indices
# - classes: int, number of classes
# - smoothing: float between 0 and 1

# Create true_labels tensor: batch size 2, each element is a class index
# Classes should be in range [0, classes-1]
true_labels = torch.tensor([0, 2], dtype=torch.long)

# Number of classes
classes = 4

# Smoothing parameter
smoothing = 0.1

ARGS = {
    "true_labels": true_labels,
    "classes": classes,
    "smoothing": smoothing,
}
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
label_smoothing Ran
ran; our contract draft was wrong, not the code
daiquocnguyen/QGNN/QGNN_tf/model_graph_Sup.py
code served (permissive licence) · get_code("a1da60d33ad42831")
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 EagerTensor, 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
import tensorflow as tf
import numpy as np

torch.manual_seed(0)

# Create a small TensorFlow tensor with shape (2, 4)
# The function calls .get_shape().as_list()[-1] to get the last dimension
inputs = tf.constant(np.random.randn(2, 4).astype(np.float32))

ARGS = {
    "inputs": inputs,
    "epsilon": 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
load_graph_data Ran
ran on a synthesized input
daiquocnguyen/QGNN/QGNN_pytorch/utils_graph_cls.py
code served (permissive licence) · get_code("3d69f09bf7f71547")
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 networkx as nx
import numpy as np
import tempfile
import os

# Create a temporary dataset file
temp_dir = tempfile.mkdtemp()
dataset_dir = os.path.join(temp_dir, 'test_dataset')
os.makedirs(dataset_dir, exist_ok=True)

# Write a minimal dataset file
dataset_file = os.path.join(dataset_dir, 'test_dataset.txt')
with open(dataset_file, 'w') as f:
    # Header: 2 graphs
    f.write('2\n')
    
    # Graph 1: 3 nodes, label 0
    f.write('3 0\n')
    # Node 0: tag=1, degree=1, connected to node 1
    f.write('1 1 1\n')
    # Node 1: tag=2, degree=2, connected to nodes 0 and 2
    f.write('2 2 0 2\n')
    # Node 2: tag=1, degree=1, connected to node 1
    f.write('1 1 1\n')
    
    # Graph 2: 2 nodes, label 1
    f.write('2 1\n')
    # Node 0: tag=2, degree=1, connected to node 1
    f.write('2 1 1\n')
    # Node 1: tag=1, degree=1, connected to node 0
    f.write('1 1 0\n')

# Patch the file reading to use our temp directory
original_open = open

def patched_open(filename, *args, **kwargs):
    if '../dataset/' in filename:
        # Replace the path to use our temp directory
        filename = filename.replace('../dataset/test_dataset/', dataset_dir + '/')
    return original_open(filename, *args, **kwargs)

import builtins
builtins.open = patched_open

ARGS = {
    'dataset': 'test_dataset',
    'degree_as_tag': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy — 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
make_quaternion_mul Ran
ran on a synthesized input
daiquocnguyen/QGNN/QGNN_tf/layers.py
code served (permissive licence) · get_code("b8c3d4feb07d639d")
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 EagerTensor, ndim 2, dtype family float, shape (8, 12) 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 tensorflow as tf

# Create a small kernel tensor
# The function expects to split kernel into 4 parts along axis=1
# So we need shape (batch_size, 4*channels) where it splits into 4 tensors of shape (batch_size, channels)
# Let's use batch_size=2 and channels=3 for clarity
kernel = tf.constant([
    [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
    [13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0]
], dtype=tf.float32)

ARGS = {
    "kernel": kernel
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (8, 12) — shape (8, 12) 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
make_quaternion_mul Ran
ran on a synthesized input
daiquocnguyen/QGNN/QGNN_pytorch/q4gnn.py
code served (permissive licence) · get_code("8bf2d06489b59540")
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 (12, 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)

# The function expects a kernel tensor
# Looking at the code:
# - kernel.size(1) must be divisible by 4 (it's split into 4 parts along dim 1)
# - kernel.size(0) is the first dimension (not modified)
# - The function splits along dim=1, so we need dim=1 to be divisible by 4

# Create a small kernel tensor: shape (3, 4) where 4 is divisible by 4
kernel = torch.randn(3, 4)

ARGS = {
    "kernel": kernel
}
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 (12, 4) — shape (12, 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
sparse_mx_to_torch_sparse_tensor Ran
ran on a synthesized input
daiquocnguyen/QGNN/QGNN_pytorch/train_node_cls.py
code served (permissive licence) · get_code("56364513ade08760")
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. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np
import torch
from scipy import sparse

torch.manual_seed(0)

# Create a small sparse matrix
# Using COO format which has .tocoo(), .row, .col, .data, and .shape attributes
row = np.array([0, 1, 2])
col = np.array([0, 2, 1])
data = np.array([1.0, 2.0, 3.0])
sparse_mx = sparse.coo_matrix((data, (row, col)), shape=(3, 4))

# Convert to different format and back to ensure it has .tocoo() method
sparse_mx = sparse_mx.tocsr().tocoo()

ARGS = {
    "sparse_mx": sparse_mx
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, shape (3, 4) — shape (3, 4) as a later run recorded it
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
dual_quaternion_mul Not yet run
unverified (harvested, no recorded run)
daiquocnguyen/QGNN/QGNN_pytorch/q4gnn.py
code served (permissive licence) · get_code("411bc7ed2673b4e2")
How it ran

no invocation recorded.

quaternion_ffn Not yet run
unverified (harvested, no recorded run)
daiquocnguyen/QGNN/QGNN_tf/layers.py
code served (permissive licence) · get_code("c2d829067e64da22")
How it ran

no invocation recorded.

separate_data Not yet run
unverified (harvested, no recorded run)
daiquocnguyen/QGNN/QGNN_pytorch/utils_graph_cls.py
code served (permissive licence) · get_code("ceb57f4a0332851a")
How it ran

no invocation recorded.

separate_data_idx Not yet run
unverified (harvested, no recorded run)
daiquocnguyen/QGNN/QGNN_pytorch/utils_graph_cls.py
code served (permissive licence) · get_code("44b8b01b4553e03f")
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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
label_smoothing 2 other papers
1 dated earlier, 1 later
1706.03762 (2017-06)
Attention Is All You Need
2022.acl-long.48 (2022 (year only))
Legal Judgment Prediction via Event Extraction with Constraints
get_graphpool 1 other paper
1 dated earlier
1909.11855 (2019-09)
Universal Graph Transformer Self-Attention Networks

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

Recently, graph neural networks (GNNs) have become an important and active research direction in deep learning. It is worth noting that most of the existing GNN-based methods learn graph representations within the Euclidean vector space. Beyond the Euclidean space, learning representation and embeddings in hyper-complex space have also shown to be a promising and effective approach. To this end, we propose Quaternion Graph Neural Networks (QGNN) to learn graph representations within the Quaternion space. As demonstrated, the Quaternion space, a hyper-complex vector space, provides highly meaningful computations and analogical calculus through Hamilton product compared to the Euclidean and complex vector spaces. Our QGNN obtains state-of-the-art results on a range of benchmark datasets for graph classification and node classification. Besides, regarding knowledge graphs, our QGNN-based embedding model achieves state-of-the-art results on three new and challenging benchmark datasets for knowledge graph completion. Our code is available at: \url{https://github.com/daiquocnguyen/QGNN}.

For agents

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

get_harvested_code_for_paper("2008.05089")
get_code_for_paper("2008.05089")
have("2008.05089")

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

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

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

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

Connect an agent — have() is free.