Skip to main content

R SDK

R 4.0+ integration for Zeq OS. Use HulyaSync for local temporal synchronization; call the REST API for operator computation. Built for statistical analysis and scientific visualization.

Installation

# Install dependencies
install.packages(c("httr2", "jsonlite"))

# Install from source
devtools::install("sdk/r")

Authentication

library(httr2)

BASE <- "http://localhost"

zeq_login <- function(equation) {
request(paste0(BASE, "/api/users/login")) |>
req_body_json(list(equation = equation)) |>
req_perform() |>
resp_body_json() |>
(\(d) d$token)()
}

token <- zeq_login("x^2 + sin(y*pi) + phi")

Quick Start

library(httr2)
library(jsonlite)

BASE <- "http://localhost"
TOKEN <- "your-jwt-token"

# 1. Browse operators — public, no auth
ops_data <- request(paste0(BASE, "/api/zeq/operators")) |>
req_perform() |> resp_body_json()
for (op in head(ops_data$operators, 3)) {
cat(sprintf("%-6s %-30s %s\n", op$id, op$name, op$equation))
}
# QM1 Schrödinger Equation iℏ ∂ψ/∂t = −ℏ²/2m ∂²ψ/∂x² + Vψ
# NM18 Newton's Second Law F = ma
# GR31 Einstein Field Equations G_μν + Λg_μν = 8πT_μν

# 2. HulyaPulse phase — no auth
phase <- request(paste0(BASE, "/api/zeq/phase")) |>
req_perform() |> resp_body_json()
cat(sprintf("Phase: %.4f KO42: %.6f Zeqond: %d\n",
phase$phase, phase$ko42, phase$zeqond))

# 3. Execute operator — requires account
result <- request(paste0(BASE, "/api/zeq/operators/execute?operator=NM21")) |>
req_auth_bearer_token(TOKEN) |>
req_body_json(list(params = list(G = 6.674e-11, m1 = 5.97e24, m2 = 7.35e22, r = 3.84e8))) |>
req_perform() |> resp_body_json()
cat(sprintf("F = %.3e N\n", result$value))

# 4. 7-Step Wizard — requires account
state <- request(paste0(BASE, "/api/7step/run")) |>
req_auth_bearer_token(TOKEN) |>
req_body_json(list(
query = "gravitational time dilation near Earth",
operators = list("KO42", "GR37"),
mode = "basic"
)) |>
req_perform() |> resp_body_json()
cat("Operators:", paste(state$selected_operators, collapse = ", "), "\n")
cat("Master sum:", state$master_sum, "\n")

HulyaSync (Local)

library(zeqos)

sync <- HulyaSync$new()

# All local — no server, no auth
cat(sprintf("Phase: %.4f\n", sync$current_phase()))
cat(sprintf("Zeqond: %d\n", sync$get_zeqond()))
cat(sprintf("KO42: %.6f\n", sync$ko42_automatic()))

# Zeq Equation: R(t) = S(t) × [1 + α·sin(2πft)]
cat(sprintf("g mod: %.6f\n", sync$modulate(9.80665)))
cat(sync$daemon_tick(), "\n")

Visualization

library(ggplot2)
library(zeqos)

# Plot one full Zeqond of HulyaPulse modulation
sync <- HulyaSync$new()
t <- seq(0, 0.777, length.out = 1000)
g <- 9.80665
mods <- sapply(t, function(ti) g * (1 + 0.00129 * sin(2 * pi * 1.287 * ti)))

ggplot(data.frame(t = t, g = mods), aes(x = t, y = g)) +
geom_line(colour = "#06b6d4") +
labs(title = "HulyaPulse Modulation (1 Zeqond = 0.777 s)",
x = "Time (s)", y = "g modulated (m/s²)") +
theme_minimal()

Framework Equations

Zeq Equation:   R(t) = S(t) × [1 + α × sin(2π × 1.287 × t)]
KO42: α × sin(2π × 1.287 × t)
HULYAS: □(φ) − μ²(r)φ − λφ³ − exp(−φ/φ_c) + φ₄₂ × Σ(Cₖ(φ)) = T^μ_μ + βF·F + J_ext

REST API Reference

EndpointAuthDescription
POST /api/users/loginLogin with equation
GET /api/zeq/phaseHulyaPulse phase + KO42
GET /api/zeq/operatorsAll operators + equations (public)
POST /api/zeq/operators/execute?operator=IDRequiredExecute operator
POST /api/7step/runRequired7-Step Wizard

Architecture

sdk/r/
├── DESCRIPTION
├── R/
│ ├── hulya_sync.R # Local HulyaSync (R6)
│ ├── zeq_client.R # REST API client (httr2)
│ └── constants.R # Physical constants
└── tests/testthat/