{
 "dev_metadata": {
  "author": "",
  "description": "# pylibqe \u2014 Python bindings for libqe\n\nnanobind bindings that expose the libqe modules as a `pylibqe` Python package,\nbuilt with CMake + scikit-build-core.\n\n## API reference\n\nAll matrix arguments are 2-D `numpy.ndarray` with `dtype=float64`, C-contiguous.\nAll vector arguments are 1-D `numpy.ndarray` with `dtype=float64`.\nReturn values are always freshly allocated numpy arrays owned by Python.\n\n### `pylibqe.adjacency`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `choose_two(n)` | `int` | n \u00d7 (n-1) / 2 |\n| `connection_indices(len, row=-1)` | `2 \u00d7 n_pairs ndarray[int64]` | Upper-tri (i, j) pairs. `row=-1` both rows, `0` row-only, `1` col-only |\n| `code_connections(v)` | `1-D ndarray` | Pairwise products of a code vector \u2192 connection vector |\n| `fold_directed_network(v)` | `1-D ndarray` | n\u00b2 directed vector \u2192 upper-tri (symmetric pairs summed) |\n| `network_to_vector(x, full=True)` | `1-D ndarray` | Matrix \u2192 flat vector. `full=True` \u2192 n\u00b2, `False` \u2192 upper-tri |\n| `connection_names(names)` | `list[str]` | `\"A & B\"` pair labels for every upper-tri position |\n\n### `pylibqe.normalization`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `normalize_networks(m)` | `2-D ndarray` | Row-wise L2 normalization. Zero rows left unchanged. |\n| `scale_networks(m)` | `2-D ndarray` | Max-norm scaling: divide all rows by the largest row L2 norm. |\n\n### `pylibqe.modeling`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `center_points(values)` | `2-D ndarray` | Subtract column means. |\n| `mean_ci(points, conf_level=0.95)` | `n_dims \u00d7 3 ndarray` | `[mean, ci_lower, ci_upper]` \u2014 matches rENA `t.test` exactly. |\n| `outlier_ci(points, iqr_factor=1.5)` | `n_dims \u00d7 2 ndarray` | `[lower, upper]` symmetric around 0 \u2014 matches rENA IQR formula. |\n| `ena_correlation(points, centroids, conf_level=0.95)` | `n_units \u00d7 3 ndarray` | Pearson r with CI: `[r, ci_lower, ci_upper]`. |\n| `node_positions(adj_mats, t, num_dims)` | `NodePositions` | Undirected ENA node positions. |\n| `directed_node_positions(line_weights, points, num_dims)` | `NodePositions` | Directed ENA node positions. |\n| `directed_node_positions_combine_pairs(line_weights, points, num_dims)` | `NodePositions` | Directed positions \u2014 paired ground+response rows combined before solve. |\n| `group_stats(g1, g2)` | `GroupStatsResult` | Per-dimension Welch t-test + Wilcoxon rank-sum. See fields below. |\n\n`NodePositions` fields: `.nodes`, `.centroids`, `.weights`, `.points` (all 2-D ndarray).\n\n#### `GroupStatsResult` fields\n\n| Field | Type | Notes |\n|-------|------|-------|\n| `n1`, `n2` | `int` | Sample sizes |\n| `t` | `ndarray (n_dims,)` | Welch t-statistic per dimension |\n| `df` | `ndarray (n_dims,)` | Welch\u2013Satterthwaite degrees of freedom |\n| `pvalue_t` | `ndarray (n_dims,)` | Two-tailed p-values (t-test) |\n| `cohens_d` | `ndarray (n_dims,)` | Cohen's d (pooled SD, group1 \u2212 group2) |\n| `means` | `2 \u00d7 n_dims ndarray` | Row 0 = group1, row 1 = group2 |\n| `sds` | `2 \u00d7 n_dims ndarray` | Sample standard deviations |\n| `U` | `ndarray (n_dims,)` | Wilcoxon U for group 1 (= R's W) |\n| `pvalue_u` | `ndarray (n_dims,)` | Two-tailed p-values (normal approx, tie + continuity correction) |\n| `effect_r` | `ndarray (n_dims,)` | Rank-biserial: 1 \u2212 2\u00b7U / (n1\u00b7n2) |\n| `medians` | `2 \u00d7 n_dims ndarray` | Row 0 = group1, row 1 = group2 |\n\n### `pylibqe.accumulation`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `connection_matrix(ground, response, response_weight=1.0, ordered=True)` | `2-D ndarray` | Core adjacency math for one ground+response event pair. |\n| `accumulate_stanza(codes, window_back=1, window_forward=0, binary=True, ordered=False)` | `2-D ndarray` | Stanza-window accumulation. `ordered=False`: undirected upper-tri \u2192 `n_rows \u00d7 choose_two(n_codes)`. `ordered=True`: directed \u2192 `n_rows \u00d7 n_codes\u00b2`. |\n| `row_connections(codes, binary=True)` | `2-D ndarray` | Per-row upper-tri co-occurrence without windowing. |\n| `rolling_window_sum(codes, window_size=1)` | `2-D ndarray` | Rolling backward sum of raw code values. |\n| `flat_index(indices, dims)` | `int` | Column-major linear index. `indices` and `dims` are **0-based**. |\n| `accumulate_unit(codes, unit_rows, decay_fn, ordered=False)` | `UnitNetworks` | tma ground/response accumulation. `unit_rows` 0-based int list. `decay_fn(dists) -> weights`. |\n| `accumulate_unit_with_rows(codes, unit_rows, decay_fn, ordered=False)` | `UnitNetworks` | Like `accumulate_unit` + per-response-row networks. |\n| `apply_tensor_unit(tensor, dims, ...)` | `TensorNetworks` | Tensor-based multi-modal accumulation (tma). |\n\n`UnitNetworks` fields: `.networks`, `.row_networks`.\n`TensorNetworks` fields: `.connection_counts`, `.row_connection_counts`.\n\n### `pylibqe.rotation`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `ena_svd(points)` | `RotationResult` | SVD-based ENA rotation. |\n| `deflate(data, axis)` | `2-D ndarray` | Project out a single unit axis from `data`. |\n| `orthogonal_svd(points, fixed_axes)` | `RotationResult` | SVD constrained to be orthogonal to fixed axes. |\n| `complete_rotation(points, axes)` | `RotationResult` | Fix named axes first, fill remaining dims with SVD. |\n| `means_rotation(points, groups)` | `RotationResult` | Means rotation (MR) \u2014 rotate toward group mean difference. |\n| `generalized_means_rotation(V, x_model, x_target, ...)` | `RotationResult` | GMR with Lasso covariate adjustment \u2014 mirrors rENA's `ena.rotate.by.generalized()`. |\n\n`RotationResult` fields: `.rotation`, `.eigenvalues`, `.column_names`.\n\n### `pylibqe.door`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `lookback_block(block, lookback_size=20, aggregate_mean=False, weighting_linear=False, segment_ids=[])` | `2-D ndarray` | Lookback pooling over one unit block; matches ETM missing-value behavior. |\n| `ema_block(block, alpha=0.1, segment_ids=[])` | `2-D ndarray` | EMA smoothing over one unit block; missing current values carry the prior smoothed value. |\n\n### `pylibqe.trajectory`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `fit_poly(points, t=None, max_degree=3, fixed_degree=0, criterion=\"loocv\", basis=\"orthogonal\")` | `dict` | Fit a 2D polynomial trajectory; default basis matches R `stats::poly` predictions. |\n| `eval_curve(coeffs_x, coeffs_y, t_eval)` | `2-D ndarray` | Evaluate fitted trajectory coordinates. |\n| `eval_derivatives(coeffs_x, coeffs_y, t_eval)` | `dict` | Velocity, acceleration, speed, heading rate, and curvature. |\n| `integrated_distance(...)` | `float` | Integrated Euclidean distance between curves. |\n| `lagged_distance(...)` | `float` | Normalized follower/leader lagged curve distance. |\n| `signed_turn_lag(...)` / `sweep_signed_turn_lags(...)` | `dict` | Discrete signed turn-lag distance metrics. |\n| `dist_dist_correlation(X, Y)` | `float` | Correlation between pairwise distance structures. |\n\n## Build dependencies\n\n- Python \u2265 3.9\n- numpy\n- armadillo (system or conda-forge / homebrew)\n- nanobind \u2265 1.9 (`pip install nanobind` or `brew install nanobind`)\n- scikit-build-core \u2265 0.4 (`pip install scikit-build-core`)\n- cmake \u2265 3.18\n\n## Install (development)\n\n```bash\ncd libqe/python\npip install -e \".[dev]\"\n```\n\nOr build a wheel:\n\n```bash\npip wheel .\n```\n\n## Run tests\n\n```bash\ncd libqe/python\npytest tests/\n```\n\n## Usage example\n\n```python\nimport numpy as np\nfrom pylibqe import adjacency, normalization, modeling, accumulation\n\n# Pair names for 3 codes\nprint(adjacency.connection_names([\"X\", \"Y\", \"Z\"]))\n# ['X & Y', 'X & Z', 'Y & Z']\n\n# Stanza-window accumulation\ncodes = np.array([[1,1,0],[1,0,1],[0,1,1]], dtype=float)\nco = accumulation.accumulate_stanza(codes, window_back=2, binary=True)\nprint(co)\n\n# Sphere normalization\nnormed = normalization.normalize_networks(codes)\n\n# Two-group comparison\ng1 = np.random.randn(20, 2)\ng2 = np.random.randn(18, 2) + 0.5\nr = modeling.group_stats(g1, g2)\nprint(r.pvalue_t)   # per-dimension two-tailed p-values\n```",
  "description_content_type": "text/markdown",
  "license": "",
  "name": "pylibqe",
  "project_urls": [
   [
    "Homepage",
    "https://github.com/epistemic-analytics/libqe"
   ],
   [
    "Documentation",
    "https://qe-libs.org/py/"
   ],
   [
    "Repository",
    "https://github.com/epistemic-analytics/libqe"
   ],
   [
    "Bug Tracker",
    "https://github.com/epistemic-analytics/libqe/issues"
   ]
  ],
  "requires_dist": [
   "numpy",
   "pytest; extra == \"dev\"",
   "numpy; extra == \"dev\""
  ],
  "requires_python": ">=3.9",
  "summary": "Python bindings for libqe \u2014 low-level QE math including ENA, accumulation, door, and trajectory kernels",
  "version": "0.1.6.9000"
 },
 "dev_metadata_from": "0.1.6.9000",
 "files": {
  "pylibqe-0.1.4-cp311-cp311-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "e691c8173113808398d87465b46a30687ccdc42e96bbcad3f4a84b6123e9cacf",
   "size": 246501,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/e691c8173113808398d87465b46a30687ccdc42e96bbcad3f4a84b6123e9cacf/pylibqe-0.1.4-cp311-cp311-macosx_26_0_arm64.whl",
   "version": "0.1.4"
  },
  "pylibqe-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "a9469a4a96f194f9197721000646535658080ec0269017a8171b29bef5c65041",
   "size": 43315728,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/a9469a4a96f194f9197721000646535658080ec0269017a8171b29bef5c65041/pylibqe-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.4"
  },
  "pylibqe-0.1.4-cp312-cp312-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "3b0f96e4b41f25f8c59533640e11564dcd1a28ec4371cc9b9667f3909421dd9e",
   "size": 245709,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/3b0f96e4b41f25f8c59533640e11564dcd1a28ec4371cc9b9667f3909421dd9e/pylibqe-0.1.4-cp312-cp312-macosx_26_0_arm64.whl",
   "version": "0.1.4"
  },
  "pylibqe-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "d63219653e1eccf5927ff3b2d239d1021497a792cf345b6e9d42fa43bd117c75",
   "size": 43315297,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/d63219653e1eccf5927ff3b2d239d1021497a792cf345b6e9d42fa43bd117c75/pylibqe-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.4"
  },
  "pylibqe-0.1.4-cp313-cp313-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "62cfdcc6a49740f5e5c3ddd9cdd4262b23d69518e448f5a773f1f79916d90740",
   "size": 245735,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/62cfdcc6a49740f5e5c3ddd9cdd4262b23d69518e448f5a773f1f79916d90740/pylibqe-0.1.4-cp313-cp313-macosx_26_0_arm64.whl",
   "version": "0.1.4"
  },
  "pylibqe-0.1.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "0eae2a1170cf5ae8aad82308f7241e6db8e84dc3a3020052e84d6db95f2beb93",
   "size": 43315205,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/0eae2a1170cf5ae8aad82308f7241e6db8e84dc3a3020052e84d6db95f2beb93/pylibqe-0.1.4-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.4"
  },
  "pylibqe-0.1.4.tar.gz": {
   "published": null,
   "sha256": "151e300adebd4af90e09550360519fff71ef61e062e28641e6252006d909d1f1",
   "size": 35280,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/151e300adebd4af90e09550360519fff71ef61e062e28641e6252006d909d1f1/pylibqe-0.1.4.tar.gz",
   "version": "0.1.4"
  },
  "pylibqe-0.1.5-cp311-cp311-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "9266ca16767d7e01f00e5f2ed7fd0d01760eb11c2a037dde6525fc291203eea1",
   "size": 246503,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/9266ca16767d7e01f00e5f2ed7fd0d01760eb11c2a037dde6525fc291203eea1/pylibqe-0.1.5-cp311-cp311-macosx_26_0_arm64.whl",
   "version": "0.1.5"
  },
  "pylibqe-0.1.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "2ae1cf7b4e1380ce070f7e13401d40cbddcb9446f6075f1606df9f0fcfbe5362",
   "size": 43318252,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/2ae1cf7b4e1380ce070f7e13401d40cbddcb9446f6075f1606df9f0fcfbe5362/pylibqe-0.1.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.5"
  },
  "pylibqe-0.1.5-cp312-cp312-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "71946cd75a313ee7554975d913715f0403b8d158957c5085cbce2da39c1fcb71",
   "size": 245712,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/71946cd75a313ee7554975d913715f0403b8d158957c5085cbce2da39c1fcb71/pylibqe-0.1.5-cp312-cp312-macosx_26_0_arm64.whl",
   "version": "0.1.5"
  },
  "pylibqe-0.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "d48a1c9415504add0bdcadd0e0430921c13684f786b172ae948796059b03440b",
   "size": 43317879,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/d48a1c9415504add0bdcadd0e0430921c13684f786b172ae948796059b03440b/pylibqe-0.1.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.5"
  },
  "pylibqe-0.1.5-cp313-cp313-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "24ddf83cb30891a336fcfa1c92bddc6df61dea972991efdd8ff8c46538a8b128",
   "size": 245735,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/24ddf83cb30891a336fcfa1c92bddc6df61dea972991efdd8ff8c46538a8b128/pylibqe-0.1.5-cp313-cp313-macosx_26_0_arm64.whl",
   "version": "0.1.5"
  },
  "pylibqe-0.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "087df64c16e25365185c23537eacf9b19b2584e0eb1239bddb0dfbc7b9986d5d",
   "size": 43317864,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/087df64c16e25365185c23537eacf9b19b2584e0eb1239bddb0dfbc7b9986d5d/pylibqe-0.1.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.5"
  },
  "pylibqe-0.1.5.tar.gz": {
   "published": null,
   "sha256": "893e988cac0592b1b04e507b9b781df8ede062bda62e3591dc303f3546dcc823",
   "size": 36735,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/893e988cac0592b1b04e507b9b781df8ede062bda62e3591dc303f3546dcc823/pylibqe-0.1.5.tar.gz",
   "version": "0.1.5"
  },
  "pylibqe-0.1.6-cp311-cp311-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "9bb566b44722071cb033cf6b1d5cc5288a60f2527955dc206c5ba8b6a97d3083",
   "size": 250155,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/9bb566b44722071cb033cf6b1d5cc5288a60f2527955dc206c5ba8b6a97d3083/pylibqe-0.1.6-cp311-cp311-macosx_26_0_arm64.whl",
   "version": "0.1.6"
  },
  "pylibqe-0.1.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "cfe439ac68f2b83befdbbc9632da8866a758c0f26dd5d8fcf4e1df724f0b547a",
   "size": 43321964,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/cfe439ac68f2b83befdbbc9632da8866a758c0f26dd5d8fcf4e1df724f0b547a/pylibqe-0.1.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.6"
  },
  "pylibqe-0.1.6-cp312-cp312-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "e6df43314cfd9bc137359271a649a3eab11fe7014fb7d9052e48428b5a64d4aa",
   "size": 249331,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/e6df43314cfd9bc137359271a649a3eab11fe7014fb7d9052e48428b5a64d4aa/pylibqe-0.1.6-cp312-cp312-macosx_26_0_arm64.whl",
   "version": "0.1.6"
  },
  "pylibqe-0.1.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "54620203b7c6906fb133c1dcd6dc52a0294a3a2ec3abf158ba1ccb6b1b5919b1",
   "size": 43321647,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/54620203b7c6906fb133c1dcd6dc52a0294a3a2ec3abf158ba1ccb6b1b5919b1/pylibqe-0.1.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.6"
  },
  "pylibqe-0.1.6-cp313-cp313-macosx_26_0_arm64.whl": {
   "published": null,
   "sha256": "6a1e8fd0a3e04096a477f348194f6eccbd348b759129651490836c1287ba0b79",
   "size": 249377,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/6a1e8fd0a3e04096a477f348194f6eccbd348b759129651490836c1287ba0b79/pylibqe-0.1.6-cp313-cp313-macosx_26_0_arm64.whl",
   "version": "0.1.6"
  },
  "pylibqe-0.1.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "84642614a89c00f250cdbe7debcdd56405a05da66b81f9f9099a79a9870420fe",
   "size": 43321547,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/84642614a89c00f250cdbe7debcdd56405a05da66b81f9f9099a79a9870420fe/pylibqe-0.1.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.6"
  },
  "pylibqe-0.1.6.9000-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "f6b3ebcf36ab4b74ee1a35cf83d8f69cbde55058e45b4de7936736325c7d5791",
   "size": 12222744,
   "version": "0.1.6.9000"
  },
  "pylibqe-0.1.6.9000-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "cb80b2f871f06cc18092cef7de1a805ebd65f9da2f3e45f0eec816b317e21af6",
   "size": 12222434,
   "version": "0.1.6.9000"
  },
  "pylibqe-0.1.6.9000-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": null,
   "sha256": "cbabbd1dec5eb08dc656f0c19c7c3db0fbef392f3cf63b7c9033c24cd524ba5b",
   "size": 12222339,
   "version": "0.1.6.9000"
  },
  "pylibqe-0.1.6.9000.tar.gz": {
   "published": null,
   "sha256": "2859b59bb88168737af32f044488a6565d441a2b4b8df07997b2c4135231df4c",
   "size": 37762,
   "version": "0.1.6.9000"
  },
  "pylibqe-0.1.6.tar.gz": {
   "published": null,
   "sha256": "2d8c968701e32773cab6078c517824c86eef325671dcfe03038ac9349a20bf0e",
   "size": 37304,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/2d8c968701e32773cab6078c517824c86eef325671dcfe03038ac9349a20bf0e/pylibqe-0.1.6.tar.gz",
   "version": "0.1.6"
  }
 },
 "metadata": {
  "author": "",
  "description": "# pylibqe \u2014 Python bindings for libqe\n\nnanobind bindings that expose the libqe modules as a `pylibqe` Python package,\nbuilt with CMake + scikit-build-core.\n\n## API reference\n\nAll matrix arguments are 2-D `numpy.ndarray` with `dtype=float64`, C-contiguous.\nAll vector arguments are 1-D `numpy.ndarray` with `dtype=float64`.\nReturn values are always freshly allocated numpy arrays owned by Python.\n\n### `pylibqe.adjacency`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `choose_two(n)` | `int` | n \u00d7 (n-1) / 2 |\n| `connection_indices(len, row=-1)` | `2 \u00d7 n_pairs ndarray[int64]` | Upper-tri (i, j) pairs. `row=-1` both rows, `0` row-only, `1` col-only |\n| `code_connections(v)` | `1-D ndarray` | Pairwise products of a code vector \u2192 connection vector |\n| `fold_directed_network(v)` | `1-D ndarray` | n\u00b2 directed vector \u2192 upper-tri (symmetric pairs summed) |\n| `network_to_vector(x, full=True)` | `1-D ndarray` | Matrix \u2192 flat vector. `full=True` \u2192 n\u00b2, `False` \u2192 upper-tri |\n| `connection_names(names)` | `list[str]` | `\"A & B\"` pair labels for every upper-tri position |\n\n### `pylibqe.normalization`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `normalize_networks(m)` | `2-D ndarray` | Row-wise L2 normalization. Zero rows left unchanged. |\n| `scale_networks(m)` | `2-D ndarray` | Max-norm scaling: divide all rows by the largest row L2 norm. |\n\n### `pylibqe.modeling`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `center_points(values)` | `2-D ndarray` | Subtract column means. |\n| `mean_ci(points, conf_level=0.95)` | `n_dims \u00d7 3 ndarray` | `[mean, ci_lower, ci_upper]` \u2014 matches rENA `t.test` exactly. |\n| `outlier_ci(points, iqr_factor=1.5)` | `n_dims \u00d7 2 ndarray` | `[lower, upper]` symmetric around 0 \u2014 matches rENA IQR formula. |\n| `ena_correlation(points, centroids, conf_level=0.95)` | `n_units \u00d7 3 ndarray` | Pearson r with CI: `[r, ci_lower, ci_upper]`. |\n| `node_positions(adj_mats, t, num_dims)` | `NodePositions` | Undirected ENA node positions. |\n| `directed_node_positions(line_weights, points, num_dims)` | `NodePositions` | Directed ENA node positions. |\n| `directed_node_positions_combine_pairs(line_weights, points, num_dims)` | `NodePositions` | Directed positions \u2014 paired ground+response rows combined before solve. |\n| `group_stats(g1, g2)` | `GroupStatsResult` | Per-dimension Welch t-test + Wilcoxon rank-sum. See fields below. |\n\n`NodePositions` fields: `.nodes`, `.centroids`, `.weights`, `.points` (all 2-D ndarray).\n\n#### `GroupStatsResult` fields\n\n| Field | Type | Notes |\n|-------|------|-------|\n| `n1`, `n2` | `int` | Sample sizes |\n| `t` | `ndarray (n_dims,)` | Welch t-statistic per dimension |\n| `df` | `ndarray (n_dims,)` | Welch\u2013Satterthwaite degrees of freedom |\n| `pvalue_t` | `ndarray (n_dims,)` | Two-tailed p-values (t-test) |\n| `cohens_d` | `ndarray (n_dims,)` | Cohen's d (pooled SD, group1 \u2212 group2) |\n| `means` | `2 \u00d7 n_dims ndarray` | Row 0 = group1, row 1 = group2 |\n| `sds` | `2 \u00d7 n_dims ndarray` | Sample standard deviations |\n| `U` | `ndarray (n_dims,)` | Wilcoxon U for group 1 (= R's W) |\n| `pvalue_u` | `ndarray (n_dims,)` | Two-tailed p-values (normal approx, tie + continuity correction) |\n| `effect_r` | `ndarray (n_dims,)` | Rank-biserial: 1 \u2212 2\u00b7U / (n1\u00b7n2) |\n| `medians` | `2 \u00d7 n_dims ndarray` | Row 0 = group1, row 1 = group2 |\n\n### `pylibqe.accumulation`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `connection_matrix(ground, response, response_weight=1.0, ordered=True)` | `2-D ndarray` | Core adjacency math for one ground+response event pair. |\n| `accumulate_stanza(codes, window_back=1, window_forward=0, binary=True, ordered=False)` | `2-D ndarray` | Stanza-window accumulation. `ordered=False`: undirected upper-tri \u2192 `n_rows \u00d7 choose_two(n_codes)`. `ordered=True`: directed \u2192 `n_rows \u00d7 n_codes\u00b2`. |\n| `row_connections(codes, binary=True)` | `2-D ndarray` | Per-row upper-tri co-occurrence without windowing. |\n| `rolling_window_sum(codes, window_size=1)` | `2-D ndarray` | Rolling backward sum of raw code values. |\n| `flat_index(indices, dims)` | `int` | Column-major linear index. `indices` and `dims` are **0-based**. |\n| `accumulate_unit(codes, unit_rows, decay_fn, ordered=False)` | `UnitNetworks` | tma ground/response accumulation. `unit_rows` 0-based int list. `decay_fn(dists) -> weights`. |\n| `accumulate_unit_with_rows(codes, unit_rows, decay_fn, ordered=False)` | `UnitNetworks` | Like `accumulate_unit` + per-response-row networks. |\n| `apply_tensor_unit(tensor, dims, ...)` | `TensorNetworks` | Tensor-based multi-modal accumulation (tma). |\n\n`UnitNetworks` fields: `.networks`, `.row_networks`.\n`TensorNetworks` fields: `.connection_counts`, `.row_connection_counts`.\n\n### `pylibqe.rotation`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `ena_svd(points)` | `RotationResult` | SVD-based ENA rotation. |\n| `deflate(data, axis)` | `2-D ndarray` | Project out a single unit axis from `data`. |\n| `orthogonal_svd(points, fixed_axes)` | `RotationResult` | SVD constrained to be orthogonal to fixed axes. |\n| `complete_rotation(points, axes)` | `RotationResult` | Fix named axes first, fill remaining dims with SVD. |\n| `means_rotation(points, groups)` | `RotationResult` | Means rotation (MR) \u2014 rotate toward group mean difference. |\n| `generalized_means_rotation(V, x_model, x_target, ...)` | `RotationResult` | GMR with Lasso covariate adjustment \u2014 mirrors rENA's `ena.rotate.by.generalized()`. |\n\n`RotationResult` fields: `.rotation`, `.eigenvalues`, `.column_names`.\n\n### `pylibqe.door`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `lookback_block(block, lookback_size=20, aggregate_mean=False, weighting_linear=False, segment_ids=[])` | `2-D ndarray` | Lookback pooling over one unit block; matches ETM missing-value behavior. |\n| `ema_block(block, alpha=0.1, segment_ids=[])` | `2-D ndarray` | EMA smoothing over one unit block; missing current values carry the prior smoothed value. |\n\n### `pylibqe.trajectory`\n\n| Function | Returns | Notes |\n|----------|---------|-------|\n| `fit_poly(points, t=None, max_degree=3, fixed_degree=0, criterion=\"loocv\", basis=\"orthogonal\")` | `dict` | Fit a 2D polynomial trajectory; default basis matches R `stats::poly` predictions. |\n| `eval_curve(coeffs_x, coeffs_y, t_eval)` | `2-D ndarray` | Evaluate fitted trajectory coordinates. |\n| `eval_derivatives(coeffs_x, coeffs_y, t_eval)` | `dict` | Velocity, acceleration, speed, heading rate, and curvature. |\n| `integrated_distance(...)` | `float` | Integrated Euclidean distance between curves. |\n| `lagged_distance(...)` | `float` | Normalized follower/leader lagged curve distance. |\n| `signed_turn_lag(...)` / `sweep_signed_turn_lags(...)` | `dict` | Discrete signed turn-lag distance metrics. |\n| `dist_dist_correlation(X, Y)` | `float` | Correlation between pairwise distance structures. |\n\n## Build dependencies\n\n- Python \u2265 3.9\n- numpy\n- armadillo (system or conda-forge / homebrew)\n- nanobind \u2265 1.9 (`pip install nanobind` or `brew install nanobind`)\n- scikit-build-core \u2265 0.4 (`pip install scikit-build-core`)\n- cmake \u2265 3.18\n\n## Install (development)\n\n```bash\ncd libqe/python\npip install -e \".[dev]\"\n```\n\nOr build a wheel:\n\n```bash\npip wheel .\n```\n\n## Run tests\n\n```bash\ncd libqe/python\npytest tests/\n```\n\n## Usage example\n\n```python\nimport numpy as np\nfrom pylibqe import adjacency, normalization, modeling, accumulation\n\n# Pair names for 3 codes\nprint(adjacency.connection_names([\"X\", \"Y\", \"Z\"]))\n# ['X & Y', 'X & Z', 'Y & Z']\n\n# Stanza-window accumulation\ncodes = np.array([[1,1,0],[1,0,1],[0,1,1]], dtype=float)\nco = accumulation.accumulate_stanza(codes, window_back=2, binary=True)\nprint(co)\n\n# Sphere normalization\nnormed = normalization.normalize_networks(codes)\n\n# Two-group comparison\ng1 = np.random.randn(20, 2)\ng2 = np.random.randn(18, 2) + 0.5\nr = modeling.group_stats(g1, g2)\nprint(r.pvalue_t)   # per-dimension two-tailed p-values\n```",
  "description_content_type": "text/markdown",
  "license": "",
  "name": "pylibqe",
  "project_urls": [
   [
    "Homepage",
    "https://github.com/epistemic-analytics/libqe"
   ],
   [
    "Documentation",
    "https://qe-libs.org/py/"
   ],
   [
    "Repository",
    "https://github.com/epistemic-analytics/libqe"
   ],
   [
    "Bug Tracker",
    "https://github.com/epistemic-analytics/libqe/issues"
   ]
  ],
  "requires_dist": [
   "numpy",
   "pytest; extra == \"dev\"",
   "numpy; extra == \"dev\""
  ],
  "requires_python": ">=3.9",
  "summary": "Python bindings for libqe \u2014 low-level QE math including ENA, accumulation, door, and trajectory kernels",
  "version": "0.1.6"
 },
 "metadata_from": "0.1.6",
 "name": "pylibqe"
}
