| /* s6_exotic.h β Sβ Outer Automorphism Infrastructure | |
| * | |
| * Sβ is the ONLY symmetric group with a non-trivial outer automorphism. | |
| * This module provides the automorphism Ο, synthematic totals, and | |
| * exotic operations for the HexState D=6 engine. | |
| * | |
| * The outer automorphism swaps conjugacy classes: | |
| * Transpositions (ab) β Triple transpositions (ab)(cd)(ef) | |
| * 3-cycles (abc) β Double 3-cycles (abc)(def) | |
| * 4-cycles (abcd) β (abcd)(ef) | |
| */ | |
| /* ββ Permutation type ββ */ | |
| typedef struct { int p[6]; } S6Perm; | |
| static const S6Perm S6_IDENTITY = {{0,1,2,3,4,5}}; | |
| /* ββ Syntheme: partition of {0,..,5} into 3 unordered pairs ββ */ | |
| typedef struct { int pairs[3][2]; } S6Syntheme; | |
| /* ββ Constants: 15 synthemes, 6 totals ββ */ | |
| extern const S6Syntheme s6_synthemes[S6_NUM_SYNTHEMES]; | |
| extern int s6_totals[S6_NUM_TOTALS][5]; /* indices into s6_synthemes */ | |
| /* ββ Outer automorphism Ο lookup table ββ */ | |
| extern S6Perm s6_phi[S6_ORDER]; | |
| extern int s6_exotic_ready; | |
| /* ββ Initialization (must call once before using Ο) ββ */ | |
| void s6_exotic_init(void); | |
| /* ββ Permutation operations ββ */ | |
| S6Perm s6_from_int(int n); | |
| int s6_to_int_perm(S6Perm a); | |
| S6Perm s6_compose_perm(S6Perm a, S6Perm b); | |
| S6Perm s6_inverse(S6Perm a); | |
| int s6_perm_eq(S6Perm a, S6Perm b); | |
| int s6_fixed_points(S6Perm a); | |
| /* ββ Apply Ο ββ */ | |
| S6Perm s6_apply_phi(S6Perm sigma); | |
| /* ββ Syntheme-parameterized fold ββ | |
| * Pairs basis states according to syntheme s instead of the | |
| * default antipodal pairing {(0,3),(1,4),(2,5)}. | |
| * Output: out[0..2] = vesica (sum), out[3..5] = wave (diff). | |
| * Cost: O(6). */ | |
| void s6_fold_syntheme(const double *in_re, const double *in_im, | |
| double *out_re, double *out_im, | |
| int syntheme_idx); | |
| void s6_unfold_syntheme(const double *in_re, const double *in_im, | |
| double *out_re, double *out_im, | |
| int syntheme_idx); | |
| /* ββ Optimal syntheme for a given active mask ββ | |
| * Returns the syntheme index whose pairing concentrates active | |
| * states into the fewest fold slots. */ | |
| int s6_optimal_syntheme(uint8_t active_mask); | |
| /* ββ Exotic permutation gate ββ | |
| * Applies Ο(Ο) to state instead of Ο. | |
| * out[Ο(Ο)(i)] = in[i] */ | |
| void s6_apply_exotic_gate(const double *in_re, const double *in_im, | |
| double *out_re, double *out_im, | |
| S6Perm sigma); | |
| /* ββ Dual measurement ββ | |
| * Returns measurement probabilities in BOTH standard and exotic bases. | |
| * Standard: probs_std[k] = |Ο[k]|Β² | |
| * Exotic: probs_exo[k] = |Ο[Ο(Ο_k)]|Β² where Ο_k is a probe permutation. | |
| * Cost: O(6). */ | |
| void s6_dual_probabilities(const double *re, const double *im, | |
| double *probs_std, double *probs_exo); | |
| /* ββ Exotic Invariant Ξ ββ | |
| * Ξ(Ο) = Ξ£_Ο |β¨Ο|P_Ο|Οβ© - β¨Ο|P_{Ο(Ο)}|Οβ©|Β² | |
| * Measures how much the state exploits D=6-specific structure. | |
| * Ξ=0: automorphism-transparent (generic, could run on qubits) | |
| * Ξ>0: hexagonally polarized (using structure unique to D=6) | |
| * Cost: O(720 Γ D) = O(4320). */ | |
| double s6_exotic_invariant(const double *re, const double *im); | |
| /* ββ Exotic Entropy ΞS ββ | |
| * ΞS = S_std - S_exo | |
| * Difference between Shannon entropy in standard vs exotic basis. | |
| * ΞS>0: more ordered in exotic channel. | |
| * ΞS<0: more ordered in standard channel. | |
| * Cost: O(D). */ | |
| double s6_exotic_entropy(const double *re, const double *im, | |
| int syntheme_idx); | |
| /* ββ Exotic Fingerprint ββ | |
| * Per-conjugacy-class breakdown of the invariant. | |
| * Returns 11 values (one per Sβ conjugacy class). */ | |
| void s6_exotic_fingerprint(const double *re, const double *im, | |
| double *class_deltas); | |
| /* ββ Adaptive Measurement Basis Selection ββ | |
| * Returns the syntheme index (0-14) that minimizes expected | |
| * information destruction for the given state, or -1 if | |
| * standard-basis measurement is optimal. | |
| * | |
| * Based on Faustian Pact experiment: low-Ξ states benefit from | |
| * exotic measurement, high-Ξ states are devastated by it. | |
| * Cost: O(15 Γ DΒ²). */ | |
| int s6_optimal_measure_basis(const double *re, const double *im); | |
| /* ββ Cross-Syntheme Entanglement Witness ββ | |
| * Cheap approximation of the exotic invariant Ξ. | |
| * Folds through 3 strategically chosen synthemes (S0, S7, S14) | |
| * and returns the average pairwise statistical distance scaled | |
| * to approximate Ξ. | |
| * | |
| * Cost: O(90) β 48Γ cheaper than full Ξ computation. | |
| * Accuracy: r > 0.9 correlation with true Ξ. */ | |
| double s6_cross_syntheme_witness(const double *re, const double *im); | |
| /* ββ Minimum-Entropy Syntheme ββ | |
| * Returns the syntheme index whose fold basis concentrates | |
| * the state's probability into the fewest components. | |
| * Cost: O(15 Γ D). */ | |
| int s6_min_entropy_syntheme(const double *re, const double *im); | |
| /* ββ Synthematic Total Tomography ββ | |
| * Reconstructs a D=6 state vector from its projections through | |
| * the 5 synthemes of one synthematic total. | |
| * | |
| * Input: fold_data[5][6] β for each of the 5 synthemes in | |
| * total total_idx, the 6 complex fold components. | |
| * Output: out_re[6], out_im[6] β reconstructed state. | |
| * Returns: reconstruction fidelity (1.0 = perfect). | |
| * | |
| * Based on Scrying Mirror experiment: T0 achieves F=1.0. */ | |
| double s6_total_tomography(int total_idx, | |
| const double fold_re[5][6], | |
| const double fold_im[5][6], | |
| double *out_re, double *out_im); | |