Miles Mathis' Charge Field
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Miles Periodic Table with Standard Periodic Table reference

5 posters

Page 8 of 12 Previous  1, 2, 3 ... 7, 8, 9, 10, 11, 12  Next

Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Jun 25, 2023 3:00 am

LongtimeAirman wrote:.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Hepme10

Hi Cr6, I loaded ‘20230624Physics.bak’ in the

C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Backup
folder. From the Restore command options I selected ‘20230624Physics.bak’ as the backup, then did the restore and refresh.

I do not see the tables in your image, and the Query,
SELECT * FROM
[Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]

Is in error - the table name is an “invalid object name”

Am I doing something wrong? Do you see any option error or other from the two images?

/////\\\\\/////\\\\\/////\\\\\

Having just logged in to post the above - I see '20230624Physics.bak' is bad.

Ok, I downloaded the second "current" 726M, 20230624PhysicsVersion2.bak file.

I'll attempt to restore Physics to it tomorrow.
.

Hi LTAM,

You might want to use this at the very top of any new queries in SSMS 18+:  
USE Physics                      (or the database name you restored to)
SELECT * FROM TableName  

-----
With that error, sometimes you can connect to "master" or another database by default.  Adding the "USE DatabaseName" at the top of a script can get it to work. Also you may want to restore "Overwrite the existing database with Replace" in the selections. Restoring only the log with an existing database can cause errors.... so avoid "Restore Tail Log" selections.

Sorry, I should have made this updated stored procedure a few months ago to simplify things:  
CREATE PROCEDURE [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds] just to consolidate the table builds.

This version still needs more validation. It may also require adding back "CanBind=1" in a query to see binding per allowed configurations. Something like the sql SELECT statement below. I may need to add more logic and cases for allowed 'A1, A2, A3' type Slots. Also still need to set the Hook slots for non-reuse. I planned on using the "IsValid" flag for logic to include/exclude particular binding cases for slots. The stored procedure has an UPDATE statement to set the flag based on multiple updates for conditional logic. It helps get rid of too many "OR" statements which can allow logic to overlap for different conditions.  Right now it is set for excluded bonds like the statement below:
(
PRINT 'Set IsValid = 0 for Invalid Configs'

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE  A.SlotDirectionElectronBond  in ( 'TRTL', ' TLTR', 'BRBL', 'BRTR','BRTL' ) ;
)  :
-----

Code:

USE Physics
GO
/****** Script for SelectTopNRows command from SSMS  ******/
SELECT Distinct [ZFormula]
      ,[ZID]

      ,[Formula]
      ,[CurrentAtom]
      ,[NextAtom1]
      ,[NextAtom2]
      ,[NextAtom3]
      ,[NextAtom4]
      ,[NextAtom5]
      ,[NextAtom6]
      ,[LTAMKeySrc]
      ,[LTAMKeyDest]
      ,[AtomicNumberSrc]
      ,[AtomicNumberDest]
      ,[ElementSrc]
      ,[ElementDest]
      ,[CanBindSrc]
      ,[CanBindDest]
      ,[AlphaTypeSrc]
      ,[AlphaTypeDest]
      ,[SlotNumberSrc]
      ,[SlotNumberDest]
      ,[SlotSpinSrc]
      ,[SlotSpinDest]
      ,[AlphaTypeRemainderSrc]
      ,[AlphaTypeRemainderDest]
      ,[CarouselAlphaTypeSrc]
      ,[CarouselAlphaTypeDest]
      ,[AtomicSymbolSrc]
      ,[AtomicSymbolDest]
      ,[SlotOrienSrc]
      ,[SlotOrienDest]
      ,[NeutronsSrc]
      ,[NeutronsDest]
      ,[ElectronsSrc]
      ,[ElectronsDest]
      ,[ProtonsMMSrc]
      ,[ProtonsMMDest]
      ,[ProtonsSrc]
      ,[ProtonsDest]
      ,[PXSrc]
      ,[PYSrc]
      ,[PZSrc]
      ,[P2P3Src]
      ,[P12Src]
      ,[PESrc]
      ,[p1xSrc]
      ,[p1ySrc]
      ,[p1zSrc]
      ,[p2xSrc]
      ,[p2ySrc]
      ,[p2zSrc]
      ,[p3xSrc]
      ,[p3ySrc]
      ,[p3zSrc]
      ,[p4xSrc]
      ,[p4ySrc]
      ,[p4zSrc]
      ,[p5xSrc]
      ,[p5ySrc]
      ,[p5zSrc]
      ,[p6xSrc]
      ,[p6ySrc]
      ,[p6zSrc]
      ,[N1N2Src]
      ,[N1Src]
      ,[N2Src]
      ,[N3Src]
      ,[N4Src]
      ,[N5Src]
      ,[N6Src]
      ,[n1xSrc]
      ,[n1ySrc]
      ,[n1zSrc]
      ,[n2xSrc]
      ,[n2ySrc]
      ,[n2zSrc]
      ,[n3xSrc]
      ,[n3ySrc]
      ,[n3zSrc]
      ,[n4xSrc]
      ,[n4ySrc]
      ,[n4zSrc]
      ,[n5xSrc]
      ,[n5ySrc]
      ,[n5zSrc]
      ,[n6xSrc]
      ,[n6ySrc]
      ,[n6zSrc]
      ,[e1xSrc]
      ,[e1ySrc]
      ,[e1zSrc]
      ,[e2xSrc]
      ,[e2ySrc]
      ,[e2zSrc]
      ,[e3xSrc]
      ,[e3ySrc]
      ,[e3zSrc]
      ,[e4xSrc]
      ,[e4ySrc]
      ,[e4zSrc]
      ,[e5xSrc]
      ,[e5ySrc]
      ,[e5zSrc]
      ,[e6xSrc]
      ,[e6ySrc]
      ,[e6zSrc]
      ,[SlotDirectionElectronBond]
      ,[IsValid]
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
  where
        CanBindSrc   = 1
  and CanBindDest = 1
  and IsValid=1
--Show Hydrogen
  and
Case when (AtomicNumberSrc = 1 or AtomicNumberDest =1) then 1
else
Case when (SlotNumberSrc <> 1 and SlotNumberDest <> 1) then 1 else 0 end
end =1
  order by Formula  

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by BasedPhysics Sun Jun 25, 2023 3:53 pm

Airman, I'll add the pycache to the gitignore. Was busy this past week, but I put a little more work into my relativity article. Getting back to chemistry study today Smile I took a look at the threejs project you linked - looks like something we could use, but looks like more of a visual effect than a rigorous particle simulator. I'll do some research and put some thought into modeling the force of the emission cones in aggregate.

Cr6, thanks for the welcome and update. I'll take a looked at your database -- I haven't really grokked that part of the project yet.

BasedPhysics

Posts : 12
Join date : 2023-06-08

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Jun 25, 2023 5:35 pm

LTAM,

Let me upload a new version with the recovery type set to Simple instead of Full. Looks like the database had a big log file with version 2.

Here's the new database file with a Log shrunk near 0% and Simple Recovery mode-- instead of a Log at 200 GBs and Full Recovery mode.
Explanation of issue: https://karaszi.com/large-transaction-log-file

The data file is 723 MBs.  Should be easier to restore with this one. My apologies if this was an issue earlier  geek :  

https://mega.nz/file/6wEAWBBL#zegKx9ZB8tiFG7vKU8mgdgK74BmIak1jAT8wsF4XBe4

By the way, this is what I'm starting to build out in a tool called Hackolade for Graph DB modeling.  I plan to import this into an OrientDB and share it here so that a real Transversal from atom to atom per Miles can lead to Molecular bonds with fidelity https://hackolade.com/help/Gettingstarted.html
at this point it is really a matter of what is allowed/disallowed with bonds per the LTAMKey:...we can create Edges with Nodes-Vertexes with this. Vertex is the entity and the Edge is the relationship. https://hackolade.com/help/Createmodelforgraphdatabases.html

Miles Periodic Table with Standard Periodic Table reference - Page 8 Hackol10

By the way, with the most recent file, I'm still looking at why "Gold" Ag dropped out of this configuration...Oxygen and Chromium link apparently fine:

Ag2CrO4

Code:
USE Physics
GO
/****** Script for SelectTopNRows command from SSMS  ******/
SELECT Distinct [ZFormula]
      ,[ZID]

      ,[Formula]
      ,[CurrentAtom]
      ,[NextAtom1]
      ,[NextAtom2]
      ,[NextAtom3]
      ,[NextAtom4]
      ,[NextAtom5]
      ,[NextAtom6]
      ,[LTAMKeySrc]
      ,[LTAMKeyDest]
      ,[AtomicNumberSrc]
      ,[AtomicNumberDest]
      ,[ElementSrc]
      ,[ElementDest]
      ,[CanBindSrc]
      ,[CanBindDest]
      ,[AlphaTypeSrc]
      ,[AlphaTypeDest]
      ,[SlotNumberSrc]
      ,[SlotNumberDest]
      ,[SlotSpinSrc]
      ,[SlotSpinDest]
      ,[AlphaTypeRemainderSrc]
      ,[AlphaTypeRemainderDest]
      ,[CarouselAlphaTypeSrc]
      ,[CarouselAlphaTypeDest]
      ,[AtomicSymbolSrc]
      ,[AtomicSymbolDest]
      ,[SlotOrienSrc]
      ,[SlotOrienDest]
      ,[NeutronsSrc]
      ,[NeutronsDest]
      ,[ElectronsSrc]
      ,[ElectronsDest]
      ,[ProtonsMMSrc]
      ,[ProtonsMMDest]
      ,[ProtonsSrc]
      ,[ProtonsDest]
      ,[PXSrc]
      ,[PYSrc]
      ,[PZSrc]
      ,[P2P3Src]
      ,[P12Src]
      ,[PESrc]
      ,[p1xSrc]
      ,[p1ySrc]
      ,[p1zSrc]
      ,[p2xSrc]
      ,[p2ySrc]
      ,[p2zSrc]
      ,[p3xSrc]
      ,[p3ySrc]
      ,[p3zSrc]
      ,[p4xSrc]
      ,[p4ySrc]
      ,[p4zSrc]
      ,[p5xSrc]
      ,[p5ySrc]
      ,[p5zSrc]
      ,[p6xSrc]
      ,[p6ySrc]
      ,[p6zSrc]
      ,[N1N2Src]
      ,[N1Src]
      ,[N2Src]
      ,[N3Src]
      ,[N4Src]
      ,[N5Src]
      ,[N6Src]
      ,[n1xSrc]
      ,[n1ySrc]
      ,[n1zSrc]
      ,[n2xSrc]
      ,[n2ySrc]
      ,[n2zSrc]
      ,[n3xSrc]
      ,[n3ySrc]
      ,[n3zSrc]
      ,[n4xSrc]
      ,[n4ySrc]
      ,[n4zSrc]
      ,[n5xSrc]
      ,[n5ySrc]
      ,[n5zSrc]
      ,[n6xSrc]
      ,[n6ySrc]
      ,[n6zSrc]
      ,[e1xSrc]
      ,[e1ySrc]
      ,[e1zSrc]
      ,[e2xSrc]
      ,[e2ySrc]
      ,[e2zSrc]
      ,[e3xSrc]
      ,[e3ySrc]
      ,[e3zSrc]
      ,[e4xSrc]
      ,[e4ySrc]
      ,[e4zSrc]
      ,[e5xSrc]
      ,[e5ySrc]
      ,[e5zSrc]
      ,[e6xSrc]
      ,[e6ySrc]
      ,[e6zSrc]
      ,[SlotDirectionElectronBond]
      ,[IsValid]
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
  where
  --      CanBindSrc  = 1
  --and CanBindDest = 1
  --and
  IsValid=1
  and Formula = 'Ag2CrO4'
--Show Hydrogen
--  and
--Case when (AtomicNumberSrc = 1 or AtomicNumberDest =1) then 1
--else
--Case when (SlotNumberSrc <> 1 and SlotNumberDest <> 1) then 1 else 0 end
--end =1
  order by Formula 

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Jun 26, 2023 9:14 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Diffta10

Hi Cr6, I’m whelmed over and a bit punch drunk. On 24 June you announced having just uploaded an updated Physics database, including the download link and an screenshot of SSMS Object Explorer’s view of your Physics database showing the top ten tables – all of which included: dbo.AtomicMilesMathis … , which I copied in the left side image above. I downloaded and restored the Physics database to that bak file. After which, my Physics database was unchanged, remaining the same as shown on the right. There are no dbo.AtomicMilesMathis … , titled table names in my Physics database. Looks like you’ve renamed all the tables but my restore failed.

I asked if I’d done something wrong. For one thing, you indicated I should have done a restore with replacement. So I did that, or I think I did.

Your next post included a link to a different bak file 20230624PhysicsVersion2.bak. I downloaded it and restored to it, taking the opportunity to again review all the database’s tables, views and graph tables. This index is getting a little neater each time.

Code:

# Rechecking on 25 June
/////////////////////////////
# Graph Tables.
gAtom.118 rows for 118 elements. 9 Cols: $node code, AtomicNumber,AtomicSymbol,Element, OrbitalGroup,Protons, Neutrons, GroupNumber, Period.
gAtomPeriodicTableAtom. single row, the $node code and eight col labels.
gMathisAtomPeriodicTableAtomLTAMKeyEdge. 721,095 rows. Including [FromLTAMKey] to [ToLTAMKey]
gMathisPeriodicTableAtomLTAM. 1,179 rows, 17 cols. Familiar data with $node schema info/code
gPeriodicTableAtom. Single row, 38 cols. the $node code and eight col labels.
gPeriodicTableSlots. 1,710 rows, 8 cols. [$node_...],[SlotKey], [LTAMKey], [SlotNumber], [AlphaType],[SlotSpin],[SlotOrientation],[CanBind]
/////////////////////////////////
# Tables.
AllTable.  335 rows -  4 cols. Quantity, Value, Uncertainty, Unit.
 No primary key. 355 atomic constants and relationships.
AtomicOrbital. 21,161 rows 46 cols. ID ZMolecule ZItem ZFormula ... .
AtomicOrbital1. 372,821 rows. 46 cols.  ID ZMolecule ZItem ZFormula, … , 9p. 11 seconds to output.
AtomicOrbitalsinMilesDetailSummary. 41,431 rows, 172 columns.
    CurrentAtom, NextAtom1, ... , e6zDest. The query took 4 secs.
AtomicRDKit. 92 rows -  38 cols. Each atom’s (1-92) select atomic values.
AtomicSourcesRDKit. 26 rows -  5 cols (PropertyID, property, notes, units and source).
Chemspider. Was 62,670 rows. 5 cols. Chemspider moleculae ID list.  (Property, notes, units and source).  
Circle. 36001 rows - 360 degrees in hundredths. Cols x y and z are NULL.  Just a guess, his table might be used in rotation calculations to replace the sin and cos functions with a lookup table.
Compounds. 262 rows - 3 cols. No, Compound, Formula.
CompoundsSmiles. 1351 rows - 6 cols. SMILES info(PID, id, EntryName, SMILES, MW, Selectivity Index).
ElementAbundance. 78 rows – 9 cols. 78 Elements’ crustal abundances.
ElementsPositions. 1710 rows – 87 cols. 19 rows x 90 elements. Like the csv version, this one includes a the atomic tuple. A primary key has been added.
EnergyLevel. 6 rows – 7 cols. EnergyLevel,ShellLetter,ElectronCapacity,s,p,d,f.
FormulaSuperConductor. 176 rows of FormulaSuperConductors
GraphMilesAtomNode – 157 rows - Through Atomic number 162. 8 columns (AtomicNumber, AtomicSymbol, Element,
GraphTempAtomNode. 90 rows, Up to Thorium. 8 columns (AtomicNumber, AtomicSymbol, Element, OrbitalGroup, Protons, Neutrons, GroupNumber, Period).
Ions. 64 rows – 5 cols. IonID,Ion,Charge,AlphaNm,Name
Mathis. 1282 rows – 5 cols. UID, AtomicNumber,Position,SlotNumber,AlphaType
MilesMathis. 12 rows – 4 cols. ID,Description,RawCalculation, Set2. Miles calcs.
MilesMathisPeriodicTable. 2983 rows – 18 cols. 163 Atomic numbers x 19 slots.
MilesMathisPeriodicTableOLD. 2983 rows – 18 cols. 163 Atomic numbers x 19 slots. Missing slotlayouts.
MilesMathisPeriodicTableOLD2. 2993 rows, 18 columns.
nci. 150 rows – 2 cols. Compoundid, smiles.
Numbers. 65,536 rows – 1col, Number. Rows 1 to 65536 containing Number 0 to 65,535.
Orbital1. 344 rows – 27 cols. Atomic electron orbital info.
OrbitalMatrix. 157 rows – 30 cols. 163 elements with atomic electron orbital info.
Orbitals. 172 rows – 13 cols. 172 elements’ atomic electron orbital info.
PeriodicTable. 118 rows – 74 cols. 118 elements’ atomic data.
PeriodicTableGrouping. 110 rows – 30 cols. 110 elements’ atomic data.
PeriodicTableState. 112 rows – 12 cols. 112 elements’ atomic data.      
PeriodType. 10 rows – 2 cols. Period, PeriodTypeDescription - Atomic types, alkaki metals to noble gases.      
Species. Now 103,218 rows – 4 cols. ID, Molecule, Formula, Detail. Most every row of Species is a unique molecule,
 not limited (as the AtomicSummary is) to single bond rows. I’m surprised to see atomic ions are also present.
 Species appears to contain  unused but available collections of special case molecules.      
Species_Stg. 1998 rows – 3 cols. Molecule, Formula, Detail.      
Species20230212. 103,185 rows. 4 cols. ID, Molecule, Formula, Detail. 1 Sec.
sqlmol_bond_type. 0 rows. btid symbol.    
sqlmol_compound. 150 rows. compoundid, smiles  cols.    
sqlmol_compound_bonds. 0 rows. cbid, compoundid, btid, ceid1, ceid2.  
sqlmol_compound_elements. 0 rows. ceid, compoundid, atom, nodeid.    
sqlmol_compound_hfbonds. 0 rows. compoundid, chbid, ceid, cbid, btid, parseid.
sqlmol_element_type. 0 rows. symbol.                                
sqlmol_hfbond_type. 0 rows. btid, symbol.                                
sqlmol_symbol. 28 rows. 3 cols, code, type, Aromaticity.                              
STG_Orbital. 172 rows. 28 cols. 172 elements’ electron orbital data.
/////////////////////////////////
# Views.
AtomicOrbitalBonds. 9028 rows. 53 cols. Atomic details and orbitals. All ZmoleculeOrder values equal 1.
AtomicPivotedByAtomicNumber. 9,993 rows. 92 cols. Atom1-Atom90 cols. 12 secs. 
Function_Assist_GETDATE. 1 row. 1 col, GetDate. Gives the date and time of the query function.
Function_Assist_RAND. 1 row. 1 col, RAND. Returns a random value between 0 and 1.  
MathisEdgesGraphML. 141,518 rows. 6 cols. RowN, Source, Target, srcElement, trgElement, edges. 10 secs.  
MathisNodesEdgesAllBinds. 0 rows. 43 cols. AtomicNumberSrc, … , Color. Columns Acting buggy.  
MathisNodesEdgesGraphML. 1000 rows. 1000 nodes.      
MilesMathisCalculus. 50 rows. 5 cols. Z, 2z, z3, NextNumber, MathisCalculus.      
vwAllTable. 335 rows. 4 cols. FloatValue, Quantity, Value, Uncertainty.        
vwAtomic. 385,015 rows. 160 cols. 44 seconds.
vwAtomicOrbital. 34,465 rows. 47 cols. ID, ZMolecule, Zitem, … , 9p.
vwAtomicOrbitalBonds. 13,848 rows. 56 cols. ZMoleculeOrder, CurrentAtom, ... , ZID.
 Atomic details and orbitals. All Zmolecule, Order values equal 1.
vwAtomicOrbitalPerm. 21,161 rows. 46 cols. ZID, ZMolecule, ZItem, … , 9p.
vwAtomicOrbitalsAllMiles. 2,610 rows. 7 cols. CurrentAtom, NextAtom1, … , Formula. 39 seconds.
vwAtomicOrbitalsinMiles. Was 1778, now 2,608 rows. 7 cols. CurrentAtom, NextAtom1, … , Formula. 23 secs.
vwAtomicOrbitalsinMilesDetail. 11,857 rows. 170 cols. 3 Minutes 1 second.  
vwAtomicOrbitalsinMilesDetailAllBonds. 41,431 rows. 173 cols. CurrentAtom, NextAtom1, … , Formula.
 Took 7 minutes 03 seconds to run this query, longest by far.
vwAtomicOrbitalsinMilesDetailCarbonFilteredOut. 9,378 rows. 170 cols. CurrentAtom, NextAtom1, … , Formula. Took 3 minutes 14 seconds.
vwAtomicOrbitalsinMilesDetailSummary. 35,978 Rows, 172 cols.  CurrentAtom, NextAtom1, … , e6zDest. 5 seconds.
vwAtomicOrbitalsinMilesDetailSummaryPeriodicDetail. 71,914 rows and 323 columns. 12 seconds. A lot of info.
vwAtomicOrbitalsinMilesDetailSuperConductors. 3,424 rows, 170 cols, CurrentAtom, NextAtom1, … , e6zDest.
vwAtomicOrbitalsNotinMiles. 545 rows. 8 cols. CurrentAtom, NextAtom1, … , Formula. Took 40 seconds to run this query.
vwAtomicOrbitalsNotinMilesAll. 40 seconds. 827 rows and 9 cols. With reasons: SlotOrientation and BindLogic. 32 secs.
vwAtomicOrbitalsNotinMilesBySlotOrientation. 789 rows and 170 cols.
vwAtomicPeriodicTableLTAMSpins. 34,399 rows 177 cols. ID, ZMolecule, … , SL4. Took 5 secs to run this query.
vwAtomicPivoted. 34,399. 92 cols. ID, ZMolecule,  … , MolOrder. Took 4 secs to run this query.
vwCircle. 36001 rows. 1 col. Degree. Looks like random rotations (with select *) between zero
 and sequential rotations when using the select top 1000 values.
vwDeutrium. 14 rows. 4 col. ID, Molecule, Formula, Detail.
vwElementsPositions. 1710 rows. 88 cols. AtomicNumber, AtCurrentAtom, NextAtom1, … , Formula. 0 seconds.
 Element, AtomicTuple, … , SL4,LTAMKey
vwMathisLTAMMolecules. 397,328 rows. 119 cols. ZID, ZMolecule, … , 9p. 14 seconds. Ties electrons and electron orbitals together?
vwMathisMaxSlotPivoted. 90 rows. 28 cols. AtomicNumber, AtomicSymbol, … , Slot19.
vwMathisMoleculesBindLogic. 35509 rows. 162 cols. AtomicNumberSrc, AtomicNumber Dest, … , e6zDest. The query took 3 secs.
vwMathisMoleculesBindLogicXYZ. 24,318 rows. 164 cols. AtomicNumberSrc, AtomicNumber Dest, … , e6zDest. The query took 2 secs.
vwMathisMoleculesFullBindLogic. 989,012 rows. 255 cols. BondType, AtomicNumber, AtomicSymbol Dest, … , e6zDest. The query took 1 minute 26 secs.
vwMilesMathisElectronBondingMapped, 2983 rows. 179 cols. UID, mOrbitalGroup, mProtons,mNeutrons, , ZSeqNo, ZItem, ZElement, ZFormula, … , 9p.
 From 35 to 1 second runtime. Resembling AtomicOrbitalBonds with plenty of potential ml atomic attributes.
vwMilesMathisPeriodicTable. 2,983 rows. 17 cols. UID, AtomicNumber, AtomicSymbol, … , Color. The query took 8 secs.
vwMilesMathisPeriodicTablePivoted. 2,983 rows. 34 cols. UID, AtomicNumber, AtomicSymbol, … , Color.
vwMolecule. 815,528 rows. 8 cols. ID, Molecule, Formula,  Item, RW, ASCIINum, Number, CharPlaceType. 32 secs.
vwMoleculeAtomicWeight. 13,848 rows. 7 cols. ID, MolecularWeight, Formula,  Molecule, Number, NistLookup, ChemspiderLookup ,Total1stIonization. 2 Seconds.
vwNumbers. 2,476,099 rows. 1 col. n. 0-2,476,099. 8 Seconds.
vwPeriodicTable. 157 rows. 153 cols. RemainderAlphaLevel1, REM2, REM3, … , 9p.
vwProtonBalanceMathis. 157 rows. 12 cols. Carousel, AlphaProtonCarouselRemainder, Alphas, Element, AtomicSymbol, Period, … , AlphaTypeRemainder.

Miles Periodic Table with Standard Periodic Table reference - Page 8 Lastre10

Your latest post indicated I should download and restore to a newer backup with smaller log backup memory requirements. 20230625PhysicsV2.bak. I believe I have done so. The Restore Database – Physics  image shows the last restore done earlier today, Monday morning 10:36 AM on 26 June. Does it look correct to you? Is it enough information? My Backup folder contains all the previous bak files.  
My Physics tables’ titles remain the same. Do I have a problem or not?

At some point or other I’ll likely be begging you include all the location data for all of a molecules’ constituent Particles and particleGroups.

I'll check out Hackolade for Graph DB modeling 

Hi BasedPhysics. First thing this morning I received notice of your Pull Request. Logged into github, quick reviewed and merged your last two days’ changes to the main. Surprised at all the code you’ve added to the gitignore file alone, maybe 35 working lines(?), where I just had two – more below. Glad to see the py cache changes are gone as quick as they came.

I believe you’ve made all your notebook python code changes to just AB3. I’m grateful, and very much looking forward to recreating some of those changes (16 June and earlier) to the three sub-directory notebook files (AB, AB2, mB).

After my bombing Sourcetree, … , and cloning the repository my first priority was to try and correct the gitignore file to include ipynb_checkpoints like it used to; don’t recall when it stopped working, suppose it was when I added 3 notebooks to the sub-directory.

After this morning’s merge I made three separate gitignore commit changes/pushes before the notebook checkpoints were finally gone. Amounting to such a small change, hard to believe.
Changed:
**/.ipynb_checkpoint/
to:
*/.ipynb_checkpoint/*

I still don’t see any AB3 renderings, but that can wait, I also saw the requirements.txt is now down to four lines. More later.

AB3 has a bigger problem I needed to bring to your attention. Previously, I included notebook operating instructions: run all the cells down to and including both the Periodic table and ipywidget gui, make a selection on either of them, then run all the cells below. Those directions don’t work anymore. I was unable to select an atom from either AB3’s gui or periodic table. Of course I know where I used to hard code a desired atom if I needed to; but I don’t know if that still works now or not. A fix may require some discussion(?) 

That’s all I got. What a week. Thanks guys, I need another couple of days off for recovery.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Mon Jun 26, 2023 9:22 pm

Hi LTAM,

Yeah it looks like you are on the right path. The version2 is usable with a smaller log file. Thanks for the feedback. You can always right click the physics db and do Tasks >shrink database>Shrink Log if it consumes too much space. The log should be a few gig instead of a 100s a gigs.

By the way, I got Au and Ag mixed up. Actually it looks like Ag2CrO4 is fairly solid. geek

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Jun 27, 2023 6:59 pm

.
Cr6, I should have mentioned this yesterday, the Create Procedure Query below will not run, due to an 'incorrect syntax'.

Code:
USE Physics
CREATE PROCEDURE [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]

Msg 102, Level 15, State 1, Procedure spBuildAtomicMilesMathisOrbitalsDetailAllBonds, Line 2 [Batch Start Line 0]
Incorrect syntax near 'spBuildAtomicMilesMathisOrbitalsDetailAllBonds'.

Completion time: 2023-06-27T11:53:17.3485409-07:00
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by BasedPhysics Tue Jun 27, 2023 7:23 pm

LTAM, I'll see if I can recreate that bug. It seemed to be working for me, but perhaps I broke something. I'll try to fix it. We'll want to figure out a way to eliminate the need to run cells / make a selection in a particular order. The best option would probably be to include an element selection dropdown in each cell that has an animation. We can keep the periodic table as an initial selector, but we'll want some way to update the selected value dynamically without having to rerun cells.

BasedPhysics

Posts : 12
Join date : 2023-06-08

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Jun 27, 2023 8:42 pm

.
Good discussion BasedPhysics. I believe a fixed Periodic table up front and a dynamic gui elsewhere would be an improvement.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Wed Jun 28, 2023 2:12 am

Hi LTAM,

Try this for making any updates.  It is good to save a .sql of a current build before doing any changes.
Basically, Step 1 is dropping the existing.  Step 2 is CREATE PROCEDURE with the newer adjusted SQL.  This is more of an admin step on objects to adjust them.

Miles Periodic Table with Standard Periodic Table reference - Page 8 Dropcr10

If it builds successfully it should allow you to run: EXEC [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]
(takes 20-40 minutes depending on system performance-SQL Server setup).
------
Current build script:
Code:
USE [Physics]
GO

/****** Object:  StoredProcedure [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]    Script Date: 6/28/2023 1:04:06 AM ******/
DROP PROCEDURE [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]
GO

/****** Object:  StoredProcedure [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]    Script Date: 6/28/2023 1:04:06 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]

AS

BEGIN
PRINT 'dbo.AtomicMilesMathisOrbitalParsed'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisOrbitalParsed;
END

BEGIN
SELECT TOP 100 PERCENT
 Z.ID
 ,Z.Molecule AS ZMolecule
 ,
 --Z.SeqNo as ZSeqNo,
 Z.Item AS ZItem
 ,
 --Z.Element as ZElement,
 Z.[Formula] AS ZFormula
 ,Cast(CASE
 WHEN Z.Number = ''
 THEN 1
 ELSE Z.Number
 END AS INT) AS ZElementNum
 ,AtomicNumber
 ,AtomicSymbol
 ,AtomicWeight
 ,PT.Element
 ,OrbitalGroup
 ,PositiveIon
 ,NegativeIon
 ,Protons
 ,Electrons
 ,Neutrons
 ,PercDiff1stIonization
 ,Ions
 ,GroupNumber
 ,OldGroupNumber
 ,[Period]
 ,[1s]
 ,[2s]
 ,[2p]
 ,[3s]
 ,[3p]
 ,[3d]
 ,[4s]
 ,[4p]
 ,[4d]
 ,[4f]
 ,[5s]
 ,[5p]
 ,[5d]
 ,[5f]
 ,[5g]
 ,[6s]
 ,[6p]
 ,[6d]
 ,[6f]
 ,[7s]
 ,[7p]
 ,[7d]
 ,[8s]
 ,[8p]
 ,[9s]
 ,[9p]
 ,ID as ZID
INTO dbo.AtomicMilesMathisOrbitalParsed

FROM (
 SELECT X.ID
 ,X.Molecule
 ,S.*
 ,dbo.UDF_ParseAlphaChars(S.Item) AS Element
 ,dbo.UDF_ParseNumeric(S.Item) AS Number
 ,[Formula]
 FROM (
 --SELECT [ID]
 -- ,Molecule
 -- ,dbo.[UDF_ParseAlphaCharsChem]([Formula]) AS Form
 -- ,[Formula]
 ----  REPLACE([Formula],PATINDEX('%[^A-Z]%'),'|')
 --FROM [Physics].[dbo].[Species]
 --WHERE [Formula] NOT LIKE '%(%)%'
 -- AND Formula NOT LIKE 'C%H%'
 SELECT distinct Chemspiderid as [ID] ,
 Molecule,
 dbo.[UDF_ParseAlphaCharsChem]([Formula]) AS Form,
 Formula
 FROM Physics.dbo.vwChemSpider
 ) X
 CROSS APPLY dbo.uftSplitString(X.Form, '|') S
 WHERE S.Item <> ' '
 ) Z
LEFT JOIN dbo.vwPeriodicTable PT ON Replace(ReplacE(Replace(Replace([dbo].[fnRemoveNumericCharacter](TRIM(Z.Item)), '-', ''), '+', ''), '[', ''), ']', '')
 --Case when (SUBSTRING(RTRIM(Z.Element),2,1) = 'n' and (Z.Item Not like '%Zn%' or Z.Item Not like '%Sn%' or Z.Item not like '%Mn%' ))
 --then ReplacE(ReplacE(Replace(Replace(SUBSTRING(RTRIM(Z.Element),1,1),'-',''),'+',''),'[',''),']','')
 --Else  ReplacE(ReplacE(Replace(Replace(RTRIM(Z.Element),'-',''),'+',''),'[',''),']','') END
 = TRIM(PT.AtomicSymbol)
WHERE Z.ID > 0
 AND Cast(CASE
 WHEN Z.Number = ''
 THEN 1
 ELSE Z.Number
 END AS INT) < 100
ORDER BY ID
 ,SeqNo

END


BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-20230224] ON [dbo].[AtomicMilesMathisOrbitalParsed] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END


BEGIN
PRINT 'dbo.AtomicMilesMathisOrbitalBondsParsed'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisOrbitalBondsParsed
END

BEGIN

 SELECT DISTINCT   TOP 100 PERCENT
 *
 INTO dbo.AtomicMilesMathisOrbitalBondsParsed
 FROM
 (
    SELECT
    ROW_NUMBER() OVER (PARTITION BY ZID order by Zitem) as ZMoleculeOrder,
    AtomicSymbol as CurrentAtom,
    LEAD(AtomicSymbol, 1,NULL) OVER (partition by ZID order by Zitem) as NextAtom1,
    LEAD(AtomicSymbol, 2,NULL) OVER (partition by ZID order by Zitem) as NextAtom2,
    LEAD(AtomicSymbol, 3,NULL) OVER (partition by ZID order by Zitem) as NextAtom3,
    LEAD(AtomicSymbol, 4,NULL) OVER (partition by ZID order by Zitem) as NextAtom4,
    LEAD(AtomicSymbol, 5,NULL) OVER (partition by ZID order by Zitem) as NextAtom5,
    LEAD(AtomicSymbol, 6,NULL) OVER (partition by ZID order by Zitem) as NextAtom6,
    LEAD(AtomicSymbol, 7,NULL) OVER (partition by ZID order by Zitem) as NextAtom7,
    LEAD(AtomicSymbol, 8,NULL) OVER (partition by ZID order by Zitem) as NextAtom8,
    LEAD(AtomicSymbol, 9,NULL) OVER (partition by ZID order by Zitem) as NextAtom9,
    LEAD(AtomicSymbol, 10,NULL) OVER (partition by ZID order by Zitem) as NextAtom10,
    LEAD(AtomicSymbol, 11,NULL) OVER (partition by ZID order by Zitem) as NextAtom11,
    LEAD(AtomicSymbol, 12,NULL) OVER (partition by ZID order by Zitem) as NextAtom12,
    LEAD(AtomicSymbol, 13,NULL) OVER (partition by ZID order by Zitem) as NextAtom13,
    LEAD(AtomicSymbol, 14,NULL) OVER (partition by ZID order by Zitem) as NextAtom14,
    LEAD(AtomicSymbol, 15,NULL) OVER (partition by ZID order by Zitem) as NextAtom15,
    A.*
  --FROM [Physics].[dbo].[vwAtomicOrbitalPerm] A
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalParsed] A
  where ZFormula not like 'C%H%'
 ) X
 where X.ZMoleculeOrder = 1 and AtomicSymbol is NOT NULL
ORDER BY X.ZFormula
END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-20230224-Bonds] ON [dbo].[AtomicMilesMathisOrbitalBondsParsed] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END

BEGIN
PRINT 'dbo.AtomicMilesMathisElementsPositions'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisElementsPositions
END

BEGIN
--CREATE VIEW [dbo].[vwElementsPositions]

--AS

SELECT TOP 100 PERCENT
       [AtomicNumber]
      ,[AtomicSymbol]
      ,[Element]
      ,[AtomicTuple]
      ,[OrbitalGroup]
      ,[AtomicType]
      ,[GroupNumber]
      ,[Period]
      ,[SlotNumber]
      ,[Protons]
      ,[PX]
      ,[PY]
      ,[PZ]
      ,[P2P3]
      ,[P12]
      ,[PE]
      ,[p1x]
      ,[p1y]
      ,[p1z]
      ,[p2x]
      ,[p2y]
      ,[p2z]
      ,[p3x]
      ,[p3y]
      ,[p3z]
      ,[p4x]
      ,[p4y]
      ,[p4z]
      ,[p5x]
      ,[p5y]
      ,[p5z]
      ,[p6x]
      ,[p6y]
      ,[p6z]
      ,[Neutrons]
      ,[N1N2]
      ,[N1]
      ,[N2]
      ,[N3]
      ,[N4]
      ,[N5]
      ,[N6]
      ,[n1x]
      ,[n1y]
      ,[n1z]
      ,[n2x]
      ,[n2y]
      ,[n2z]
      ,[n3x]
      ,[n3y]
      ,[n3z]
      ,[n4x]
      ,[n4y]
      ,[n4z]
      ,[n5x]
      ,[n5y]
      ,[n5z]
      ,[n6x]
      ,[n6y]
      ,[n6z]
      ,[Electrons]
      ,[e1x]
      ,[e1y]
      ,[e1z]
      ,[e2x]
      ,[e2y]
      ,[e2z]
      ,[e3x]
      ,[e3y]
      ,[e3z]
      ,[e4x]
      ,[e4y]
      ,[e4z]
      ,[e5x]
      ,[e5y]
      ,[e5z]
      ,[e6x]
      ,[e6y]
      ,[e6z]
      ,[SlotOrien]
      ,[SlotSpin]
      ,[CanBind]
      ,[SlotLayout]
      ,[SL1]
      ,[SL2]
      ,[SL3]
      ,[SL4]
  ,TRIM(Electrons) + Cast([SlotNumber] as varchar(2)) + SlotOrien + cast(protons as varchar(2))+SlotSpin as LTAMKey
  ,TRIM(Electrons) +SlotSpin as BindKey
  INTO dbo.AtomicMilesMathisElementsPositions
  FROM [Physics].[dbo].[ElementsPositions]
  Order by AtomicNumber, SlotNumber

END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-20230224-Positions] ON [dbo].[AtomicMilesMathisElementsPositions] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END


BEGIN
PRINT 'dbo.AtomicMilesMathisPeriodicTable'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisPeriodicTable
END

BEGIN

SELECT  [UID]
      ,[AtomicNumber]
      ,[AtomicSymbol]
      ,[Element]
      ,[OrbitalGroup]
      ,[Protons]
      ,[Neutrons]
      ,[GroupNumber]
      ,[Period]
      ,[SlotNumber]
      ,[SlotOrder]
      ,[AlphaType]
  ,Row_Number() over (PARTITION BY AtomicSymbol order by AtomicNumber, SlotNumber) as ElementUniqueState
  ,ColorR = Case [AlphaType]   when 0 then '240'
               when 1 then '87'
               when 2 then '30'
               when 3 then '255'
               when 4 then '111'
               when 5 then '173'
               when 6 then '135'
               END
  ,ColorG = Case [AlphaType]   when 0 then '255'
               when 1 then '87'
               when 2 then '144'
               when 3 then '192'
               when 4 then '66'
               when 5 then '255'
               when 6 then '206'
               END
  ,ColorB = Case [AlphaType]   when 0 then '255'
               when 1 then '87'
               when 2 then '255'
               when 3 then '203'
               when 4 then '66'
               when 5 then '47'
               when 6 then '235'
               END
     ,Color = Case [AlphaType] when 0 then '240;255;255'
                 when 1 then '87;87;87'
                 when 2 then '30;144;255'
                 when 3 then '255;192;203'
                 when 4 then '111;66;66'
                 when 5 then '173;255;47'
                 when 6 then '135;206;235'
                 END

INTO dbo.AtomicMilesMathisPeriodicTable

  FROM [Physics].[dbo].[MilesMathisPeriodicTable]
END

BEGIN
PRINT 'dbo.AtomicMilesMathisPeriodicTableBase'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisPeriodicTableBase
END

BEGIN

SELECT
 --CASE when AlphaTypeRemainder > 6 then AlphaTypeRemainder -6 Else
 -- Case when AlphaTypeRemainder <1 then 0 Else AlphaTypeRemainder/ Case when (MathisCarouselAlphaTypeFull-2) < 1 then 1 ELSE  (MathisCarouselAlphaTypeFull-2) END END
 ---- End
 --as SingleRemainders,
 -- (Case when AlphaTypeRemainder <1 then 0 Else AlphaTypeRemainder/ Case when (MathisCarouselAlphaTypeFull-2) < 1 then MathisCarouselAlphaTypeFull ELSE  (MathisCarouselAlphaTypeFull-2) END END )
 ---- End
 --as RemaindersFilled,
 AlphaTypeRemainder AS RemainderAlphaLevel1
 ,AlphaTypeRemainder % 2 AS Rem2
 ,AlphaTypeRemainder % 3 AS Rem3
 ,AlphaTypeRemainder % 4 AS Rem4
 ,*
INTO dbo.AtomicMilesMathisPeriodicTableBase
FROM (
 SELECT CASE
 WHEN AtomicNumber < 5
 THEN 0
 ELSE CASE
 WHEN AtomicNumber BETWEEN 5
 AND 8
 THEN AtomicNumber - 5
 ELSE AtomicNumber % (MathisCarouselAlphaTypeFull * 9)
 END
 END AS AlphaTypeRemainder
 ,*
 FROM (
 SELECT CASE
 WHEN O.AtomicNumber < 5
 THEN 1
 ELSE CASE
 WHEN O.AtomicNumber / 9 = 2
 THEN 2
 ELSE CASE
 WHEN O.AtomicNumber / 9 = 4
 THEN 4
 ELSE CASE
 WHEN O.AtomicNumber / 9 = 6
 THEN 6
 ELSE CASE O.OrbitalGroup
 WHEN '[Ne]'
 THEN 1
 WHEN '[Ar]'
 THEN 2
 WHEN '[Kr]'
 THEN 4
 WHEN '[Xe]'
 THEN 6
 ELSE CASE
 WHEN O.AtomicNumber > 10
 THEN 6
 ELSE 1
 END
 END
 END
 END
 END
 END AS MathisCarouselAlphaTypeFull
 ,O.AtomicNumber
 ,O.AtomicSymbol
 ,O.Element
 ,O.OrbitalGroup
 ,LEFT(CASE
 WHEN (
 CHARINDEX('±', [Ions]) > 0
 OR CHARINDEX('+', [Ions]) > 0
 )
 THEN dbo.UDF_ParseNumeric([Ions])
 ELSE 0
 END, 1) AS PositiveIon
 ,LEFT(CASE
 WHEN (
 CHARINDEX('±', [Ions]) > 0
 OR CHARINDEX('-', [Ions]) > 0
 )
 THEN dbo.UDF_ParseNumeric([Ions])
 ELSE 0
 END, 1) AS NegativeIon
 ,Z.Protons
 ,Z.Electrons
 ,Z.Neutrons
 ,Z.PercDiff1stIonization
 ,Z.Ions
 ,Z.GroupNumber
 ,Z.OldGroupNumber
 ,Z.[Period]
 ,Z.AtomicMassRounded
 ,Z.[atomic mass (IUPAC 2005)]
 ,Z.[Melting Point Celsius]
 ,Z.[Boiling Point Celsius]
 ,Z.[State at Room Temp#]
 ,Z.[density g/mL]
 ,Z.[electronegativity (Pauling)]
 ,Z.[1st ionization potential (eV) ]
 ,Z.[2nd ionization potential (eV) ]
 ,Z.[3rd ionization potential (eV) ]
 ,Z.[1st ionization potential (kJ/mol) ]
 ,Z.[2nd ionization potential (kJ/mol) ]
 ,Z.[3rd ionization potential (kJ/mol) ]
 ,Z.[Electron Affinity (eV)]
 ,Z.[Electron Affinity (kJ/mol)]
 ,Z.[common oxidation states]
 ,Z.[ions commonly formed]
 ,Z.[Predicted Electron Configuration]
 ,Z.[Observed Electron Configuration]
 ,Z.[atomic radius (Å) ]
 ,Z.[ionic radius (Å) ]
 ,Z.[covalent radius (Å) ]
 ,Z.[radius_(2- ion)_(pm)]
 ,Z.[radius_(1- ion)_(pm)]
 ,Z.[atomic radius_(pm)]
 ,Z.[radius_(1+ ion)_(pm)]
 ,Z.[radius_(2+ ion)_(pm)]
 ,Z.[radius_(3+ ion)_(pm)]
 ,Z.[atomic volume (cm^3/mol) ]
 ,Z.[crystal structure]
 ,Z.[CAS Registry No#]
 ,Z.[electrical conductivity (mho/cm) ]
 ,Z.[specific heat (J/g K) ]
 ,Z.[heat of fusion (kJ/mol) ]
 ,Z.[heat of vaporization (kJ/mol) ]
 ,Z.[thermal conductivity (W/(m K)) ]
 ,Z.[mg/kg in Earth's crust]
 ,Z.[mg/L in seawater]
 ,Z.[% human body mass]
 ,Z.Notes
 ,Z.[source]
 ,Z.color
 ,Z.characteristics
 ,Z.structure
 ,Z.[hardness_(mohs)]
 ,Z.uses
 ,Z.[reaction with air]
 ,Z.[reaction with water]
 ,Z.[reaction with 6M HCl]
 ,Z.[reaction with 15M HNO3]
 ,Z.[reaction with 6M NaOH]
 ,Z.[hydride(s)]
 ,Z.[oxide(s)]
 ,Z.[chloride(s)]
 ,Z.[polarizability_(A^3)]
 ,Z.[heat atomization_(kJ/mol)]
 ,Z.[year discovered]
 ,Z.[rel# abund# solar system_(log)]
 ,Z.[abundance earth's crust_(log)]
 ,Z.[cost, pure_($/100g)]
 ,Z.[cost, bulk_($/100g)]
 ,Z.[toxic?]
 ,Z.[carcinogenic?]
 ,Z.PeriodicTableID
 ,Z.[Name]
 ,Z.Expr1
 ,Z.Symbol
 ,Z.[BP(K)]
 ,Z.[MP(K)]
 ,Z.Density
 ,Z.AtomicWeight
 ,Z.MostStableOxidationState
 ,Z.CovalentRadius
 ,Z.AtomicNumberRadiusAngstroms
 ,Z.FirstIP
 ,Z.SpecificHeatCapacity
 ,Z.ThermalConductivity
 ,Z.ElectricalConductivity
 ,Z.HeatOfFusion
 ,Z.HeatOfVaporization
 ,Z.ElectroNegativity
 ,Z.YearsSinceDiscovery
 ,Z.Family
 ,Z.[Group]
 ,Z.orbital
 ,Z.MetalOrNonMetal
 ,Z.[2ndmoststableoxidationstate]
 ,Z.[3rdmoststableoxidationstate]
 ,Z.[4thmoststableoxidationstate]
 ,Z.[mg/kg crust]
 ,Z.[mg/L seawater]
 ,Z.Expr2
 ,Z.[length of name]
 ,Z.Series
 ,Z.StateofMatter
 ,Z.[Atomic Radius (A)]
 ,Z.[Boiling point (oC)]
 ,Z.[Melting/Freezing Point (oC)]
 ,Z.[Density (g/mL)]
 ,Z.PeriodNumber
 ,Z.PeriodTypeDescription
 ,Z.LithosphereAbundance
 ,Z.RelativeProportion_ppm
 ,Z.CrustalAbundance1_ppm
 ,Z.CrustalAbundance2_ppm
 ,Z.CrustalAbundance3_ppm
 ,Z.ProductionTonnes
 ,O.[1s]
 ,O.[2s]
 ,O.[2p]
 ,O.[3s]
 ,O.[3p]
 ,O.[3d]
 ,O.[4s]
 ,O.[4p]
 ,O.[4d]
 ,O.[4f]
 ,O.[5s]
 ,O.[5p]
 ,O.[5d]
 ,O.[5f]
 ,O.[5g]
 ,O.[6s]
 ,O.[6p]
 ,O.[6d]
 ,O.[6f]
 ,O.[7s]
 ,O.[7p]
 ,O.[7d]
 ,O.[8s]
 ,O.[8p]
 ,O.[9s]
 ,O.[9p]
 FROM dbo.OrbitalMatrix AS O
 LEFT OUTER JOIN (
 SELECT PeriodicTable.AtomicNumber
 ,PeriodicTable.English_elementname AS Element
 ,PeriodicTable.AtomicNumber AS Protons
 ,PeriodicTable.AtomicNumber AS Electrons
 ,ROUND(PeriodicTable.AtomicMassRounded, 0) - PeriodicTable.AtomicNumber AS Neutrons
 ,RTRIM(PeriodicTable.AtomicSymbol) AS AtomicSymbol
 ,PeriodicTable.PercDiff1stIonization
 ,COALESCE(PeriodicTable.[ions commonly formed], '0') AS Ions
 ,PeriodicTable.GroupNumber
 ,PeriodicTable.OldGroupNumber
 ,PeriodicTable.Period
 ,PeriodicTable.AtomicMassRounded
 ,PeriodicTable.[atomic mass (IUPAC 2005)]
 ,PeriodicTable.[Melting Point Celsius]
 ,PeriodicTable.[Boiling Point Celsius]
 ,PeriodicTable.[State at Room Temp#]
 ,PeriodicTable.[density g/mL]
 ,PeriodicTable.[electronegativity (Pauling)]
 ,PeriodicTable.[1st ionization potential (eV) ]
 ,PeriodicTable.[2nd ionization potential (eV) ]
 ,PeriodicTable.[3rd ionization potential (eV) ]
 ,PeriodicTable.[1st ionization potential (kJ/mol) ]
 ,PeriodicTable.[2nd ionization potential (kJ/mol) ]
 ,PeriodicTable.[3rd ionization potential (kJ/mol) ]
 ,PeriodicTable.[Electron Affinity (eV)]
 ,PeriodicTable.[Electron Affinity (kJ/mol)]
 ,PeriodicTable.[common oxidation states]
 ,PeriodicTable.[ions commonly formed]
 ,PeriodicTable.[Predicted Electron Configuration]
 ,PeriodicTable.[Observed Electron Configuration]
 ,PeriodicTable.[atomic radius (Å) ]
 ,PeriodicTable.[ionic radius (Å) ]
 ,PeriodicTable.[covalent radius (Å) ]
 ,PeriodicTable.[radius_(2- ion)_(pm)]
 ,PeriodicTable.[radius_(1- ion)_(pm)]
 ,PeriodicTable.[atomic radius_(pm)]
 ,PeriodicTable.[radius_(1+ ion)_(pm)]
 ,PeriodicTable.[radius_(2+ ion)_(pm)]
 ,PeriodicTable.[radius_(3+ ion)_(pm)]
 ,PeriodicTable.[atomic volume (cm^3/mol) ]
 ,PeriodicTable.[crystal structure]
 ,PeriodicTable.[CAS Registry No#]
 ,PeriodicTable.[electrical conductivity (mho/cm) ]
 ,PeriodicTable.[specific heat (J/g K) ]
 ,PeriodicTable.[heat of fusion (kJ/mol) ]
 ,PeriodicTable.[heat of vaporization (kJ/mol) ]
 ,PeriodicTable.[thermal conductivity (W/(m K)) ]
 ,PeriodicTable.[mg/kg in Earth's crust]
 ,PeriodicTable.[mg/L in seawater]
 ,PeriodicTable.[% human body mass]
 ,PeriodicTable.Notes
 ,PeriodicTable.[source]
 ,PeriodicTable.color
 ,PeriodicTable.characteristics
 ,PeriodicTable.structure
 ,PeriodicTable.[hardness_(mohs)]
 ,PeriodicTable.uses
 ,PeriodicTable.[reaction with air]
 ,PeriodicTable.[reaction with water]
 ,PeriodicTable.[reaction with 6M HCl]
 ,PeriodicTable.[reaction with 15M HNO3]
 ,PeriodicTable.[reaction with 6M NaOH]
 ,PeriodicTable.[hydride(s)]
 ,PeriodicTable.[oxide(s)]
 ,PeriodicTable.[chloride(s)]
 ,PeriodicTable.[polarizability_(A^3)]
 ,PeriodicTable.[heat atomization_(kJ/mol)]
 ,PeriodicTable.[year discovered]
 ,PeriodicTable.[rel# abund# solar system_(log)]
 ,PeriodicTable.[abundance earth's crust_(log)]
 ,PeriodicTable.[cost, pure_($/100g)]
 ,PeriodicTable.[cost, bulk_($/100g)]
 ,PeriodicTable.[toxic?]
 ,PeriodicTable.[carcinogenic?]
 ,PeriodicTableGrouping.PeriodicTableID
 ,PeriodicTableGrouping.Name
 ,PeriodicTableGrouping.AtomicNumber AS Expr1
 ,PeriodicTableGrouping.Symbol
 ,PeriodicTableGrouping.[BP(K)]
 ,PeriodicTableGrouping.[MP(K)]
 ,PeriodicTableGrouping.Density
 ,PeriodicTableGrouping.AtomicWeight
 ,PeriodicTableGrouping.MostStableOxidationState
 ,PeriodicTableGrouping.CovalentRadius
 ,PeriodicTableGrouping.AtomicNumberRadiusAngstroms
 ,PeriodicTableGrouping.FirstIP
 ,PeriodicTableGrouping.SpecificHeatCapacity
 ,PeriodicTableGrouping.ThermalConductivity
 ,PeriodicTableGrouping.ElectricalConductivity
 ,PeriodicTableGrouping.HeatOfFusion
 ,PeriodicTableGrouping.HeatOfVaporization
 ,PeriodicTableGrouping.ElectroNegativity
 ,PeriodicTableGrouping.YearsSinceDiscovery
 ,PeriodicTableGrouping.Family
 ,PeriodicTableGrouping.[Group]
 ,PeriodicTableGrouping.orbital
 ,PeriodicTableGrouping.MetalOrNonMetal
 ,PeriodicTableGrouping.[2ndmoststableoxidationstate]
 ,PeriodicTableGrouping.[3rdmoststableoxidationstate]
 ,PeriodicTableGrouping.[4thmoststableoxidationstate]
 ,PeriodicTableGrouping.[mg/kg crust]
 ,PeriodicTableGrouping.[mg/L seawater]
 ,PeriodicTableGrouping.[% human body mass] AS Expr2
 ,PeriodicTableGrouping.[length of name]
 ,PeriodicTableState.Series
 ,PeriodicTableState.StateofMatter
 ,PeriodicTableState.[Atomic Radius (A)]
 ,PeriodicTableState.[Boiling point (oC)]
 ,PeriodicTableState.[Melting/Freezing Point (oC)]
 ,PeriodicTableState.[Density (g/mL)]
 ,PeriodicTableState.Period AS PeriodNumber
 ,PeriodType.PeriodTypeDescription
 ,ElementAbundance.LithosphereAbundance
 ,ElementAbundance.RelativeProportion_ppm
 ,ElementAbundance.CrustalAbundance1_ppm
 ,ElementAbundance.CrustalAbundance2_ppm
 ,ElementAbundance.CrustalAbundance3_ppm
 ,ElementAbundance.ProductionTonnes
 FROM dbo.PeriodicTableGrouping
 LEFT OUTER JOIN dbo.ElementAbundance ON PeriodicTableGrouping.AtomicNumber = ElementAbundance.Z
 RIGHT OUTER JOIN (
 SELECT COALESCE((CAST([1st ionization potential (kJ/mol) ] AS MONEY) - CAST(NextElement1stIonizationPotential AS MONEY)) / CAST([1st ionization potential (kJ/mol) ] AS MONEY), 0) AS PercDiff1stIonization
 ,PID
 ,AtomicNumber
 ,AtomicSymbol
 ,GroupNumber
 ,OldGroupNumber
 ,Period
 ,English_elementname
 --,German_elementname
 --,French_elementname
 --,Spanish_elementname
 --,Italian_elementname
 ,AtomicMassRounded
 ,[atomic mass (IUPAC 2005)]
 ,[Melting Point Celsius]
 ,[Boiling Point Celsius]
 ,[State at Room Temp#]
 ,[density g/mL]
 ,[electronegativity (Pauling)]
 ,[1st ionization potential (eV) ]
 ,[2nd ionization potential (eV) ]
 ,[3rd ionization potential (eV) ]
 ,[1st ionization potential (kJ/mol) ]
 ,[2nd ionization potential (kJ/mol) ]
 ,[3rd ionization potential (kJ/mol) ]
 ,NextElement1stIonizationPotential
 ,[Electron Affinity (eV)]
 ,[Electron Affinity (kJ/mol)]
 ,[common oxidation states]
 ,[ions commonly formed]
 ,[Predicted Electron Configuration]
 ,[Observed Electron Configuration]
 ,[atomic radius (Å) ]
 ,[ionic radius (Å) ]
 ,[covalent radius (Å) ]
 ,[radius_(2- ion)_(pm)]
 ,[radius_(1- ion)_(pm)]
 ,[atomic radius_(pm)]
 ,[radius_(1+ ion)_(pm)]
 ,[radius_(2+ ion)_(pm)]
 ,[radius_(3+ ion)_(pm)]
 ,[atomic volume (cm^3/mol) ]
 ,[crystal structure]
 ,[CAS Registry No#]
 ,[electrical conductivity (mho/cm) ]
 ,[specific heat (J/g K) ]
 ,[heat of fusion (kJ/mol) ]
 ,[heat of vaporization (kJ/mol) ]
 ,[thermal conductivity (W/(m K)) ]
 ,[mg/kg in Earth's crust]
 ,[mg/L in seawater]
 ,[% human body mass]
 ,Notes
 ,[source]
 ,color
 ,characteristics
 ,structure
 ,[hardness_(mohs)]
 ,uses
 ,[reaction with air]
 ,[reaction with water]
 ,[reaction with 6M HCl]
 ,[reaction with 15M HNO3]
 ,[reaction with 6M NaOH]
 ,[hydride(s)]
 ,[oxide(s)]
 ,[chloride(s)]
 ,[polarizability_(A^3)]
 ,[heat atomization_(kJ/mol)]
 ,[year discovered]
 ,[rel# abund# solar system_(log)]
 ,[abundance earth's crust_(log)]
 ,[cost, pure_($/100g)]
 ,[cost, bulk_($/100g)]
 ,[toxic?]
 ,[carcinogenic?]
 FROM (
 SELECT PID
 ,AtomicNumber
 ,AtomicSymbol
 ,GroupNumber
 ,OldGroupNumber
 ,[Period]
 ,English_elementname
 --,German_elementname
 --,French_elementname
 --,Spanish_elementname
 --,Italian_elementname
 ,AtomicMassRounded
 ,[atomic mass (IUPAC 2005)]
 ,[Melting Point Celsius]
 ,[Boiling Point Celsius]
 ,[State at Room Temp#]
 ,[density g/mL]
 ,[electronegativity (Pauling)]
 ,[1st ionization potential (eV) ]
 ,[2nd ionization potential (eV) ]
 ,[3rd ionization potential (eV) ]
 ,[1st ionization potential (kJ/mol) ]
 ,[2nd ionization potential (kJ/mol) ]
 ,[3rd ionization potential (kJ/mol) ]
 ,(
 SELECT TOP (1) [1st ionization potential (kJ/mol) ]
 FROM PeriodicTable AS B
 WHERE (A.PID = PID + 1)
 ) AS NextElement1stIonizationPotential
 ,[Electron Affinity (eV)]
 ,[Electron Affinity (kJ/mol)]
 ,[common oxidation states]
 ,[ions commonly formed]
 ,[Predicted Electron Configuration]
 ,[Observed Electron Configuration]
 ,[atomic radius (Å) ]
 ,[ionic radius (Å) ]
 ,[covalent radius (Å) ]
 ,[radius_(2- ion)_(pm)]
 ,[radius_(1- ion)_(pm)]
 ,[atomic radius_(pm)]
 ,[radius_(1+ ion)_(pm)]
 ,[radius_(2+ ion)_(pm)]
 ,[radius_(3+ ion)_(pm)]
 ,[atomic volume (cm^3/mol) ]
 ,[crystal structure]
 ,[CAS Registry No#]
 ,[electrical conductivity (mho/cm) ]
 ,[specific heat (J/g K) ]
 ,[heat of fusion (kJ/mol) ]
 ,[heat of vaporization (kJ/mol) ]
 ,[thermal conductivity (W/(m K)) ]
 ,[mg/kg in Earth's crust]
 ,[mg/L in seawater]
 ,[% human body mass]
 ,Notes
 ,[source]
 ,color
 ,characteristics
 ,structure
 ,[hardness_(mohs)]
 ,uses
 ,[reaction with air]
 ,[reaction with water]
 ,[reaction with 6M HCl]
 ,[reaction with 15M HNO3]
 ,[reaction with 6M NaOH]
 ,[hydride(s)]
 ,[oxide(s)]
 ,[chloride(s)]
 ,[polarizability_(A^3)]
 ,[heat atomization_(kJ/mol)]
 ,[year discovered]
 ,[rel# abund# solar system_(log)]
 ,[abundance earth's crust_(log)]
 ,[cost, pure_($/100g)]
 ,[cost, bulk_($/100g)]
 ,[toxic?]
 ,[carcinogenic?]
 FROM dbo.PeriodicTable AS A
 WHERE (PID > 0)
 ) AS X
 ) AS PeriodicTable ON PeriodicTableGrouping.AtomicNumber = PeriodicTable.AtomicNumber
 LEFT OUTER JOIN dbo.PeriodType ON PeriodicTableGrouping.[Group] = PeriodType.Period
 LEFT OUTER JOIN dbo.PeriodicTableState ON PeriodicTable.AtomicNumber = PeriodicTableState.AtomicNumber
 ) AS Z ON Z.AtomicNumber = O.AtomicNumber
 ) Alpha
 ) Remainder
END

BEGIN
PRINT 'dbo.AtomicMilesMathisProtonBalance'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisProtonBalance
END

BEGIN
--CREATE View [dbo].[vwProtonBalanceMathis]

SELECT
TOP 100 PERCENT *
INTO dbo.AtomicMilesMathisProtonBalance
FROM (
 SELECT Cast(Protons AS INT) % 5 AS Carousel
 ,CASE
 WHEN Cast(Protons AS INT) >= 10
 THEN Cast(Protons AS INT) - 10
 ELSE CASE
 WHEN Cast(Protons AS INT) >= 5
 THEN Cast(Protons AS INT) - 5
 ELSE 0
 END
 END AS AlphaProtonCarouselRemainder
 ,CASE
 WHEN Cast(Protons AS INT) % 2 = 0
 THEN Cast(Protons AS INT) / 2
 ELSE CASE
 WHEN Cast(Protons AS INT) >= 2
 THEN Cast(Protons AS INT) / 2
 ELSE 0
 END
 END AS Alphas
 ,Element
 ,AtomicSymbol
 ,Period
 ,AtomicNumber
 ,GroupNumber
 ,Protons
 ,[MathisCarouselAlphaTypeFull]
 ,RemainderAlphaLevel1
 ,AlphaTypeRemainder
 --,Cast(Protons as int) % 1 as ST1,
 --Cast(Protons as int) % 2 as ST2,
 --Cast(Protons as int) % 3 as ST3,
 --Cast(Protons as int) % 4 as ST4,
 --Cast(Protons as int) % 6 as ST6,
 --Cast(Protons as int) % 18 as FullCarousel2,
 --Cast(Protons as int) % 27 as FullCarousel3,
 --Cast(Protons as int) % 36 as FullCarousel4,
 --Cast(Protons as int) % 54 as FullCarousel6,
 --Car1H= CASE WHEN (CAST(Protons as int) )-1 < 0  then 0 ELSE 1 END ,
 --Car2V= CASE WHEN (CAST(Protons as int) )-2 < 0  then 0 ELSE 1 END ,
 --Car3V=CASE WHEN (CAST(Protons as int)  )-4  <= 0  then 0 ELSE 1 END ,
 --Car4V=CASE WHEN (CAST(Protons as int) )-6 <= 0  then 0 ELSE 1 END ,
 --Car5V=CASE WHEN (CAST(Protons as int))-8 <= 0  then 0 ELSE 1 END ,
 --Above1V=CASE WHEN (CAST(Protons as int) )-10 <= 0  then 0 ELSE 1 END ,
 --Below1V=CASE WHEN (CAST(Protons as int) )-12 <= 0  then 0 ELSE 1 END ,
 --Above2H=CASE WHEN (CAST(Protons as int) )-14 <= 0  then 0 ELSE 1 END ,
 --Below2H=CASE WHEN (CAST(Protons as int) )-16 <= 0  then 0 ELSE 1 END ,
 --Above3V=CASE WHEN (CAST(Protons as int) )-18 <= 0  then 0 ELSE 1 END ,
 --Below3V=CASE WHEN (CAST(Protons as int) )-20 <= 0  then 0 ELSE 1 END ,
 --CarSide1=CASE WHEN (CAST(Protons as int) )-22 <= 0  then 0 ELSE 1 END ,
 --CarSide2=CASE WHEN (CAST(Protons as int) )-24 <= 0  then 0 ELSE 1 END ,
 --CarSide3=CASE WHEN (CAST(Protons as int) )-26 <= 0  then 0 ELSE 1 END ,
 --CarSide4=CASE WHEN (CAST(Protons as int) )-28 <= 0  then 0 ELSE 1 END ,
 --Above1VSide1=CASE WHEN (CAST(Protons as int) )-30 <= 0  then 0 ELSE 1 END ,
 --Below1VSide1=CASE WHEN (CAST(Protons as int) )-32 <= 0  then 0 ELSE 1 END ,
 --Above1VSide2=CASE WHEN (CAST(Protons as int) )-34 <= 0  then 0 ELSE 1 END ,
 --Below1VSide2=CASE WHEN (CAST(Protons as int) )-36 <= 0  then 0 ELSE 1 END
 FROM [Physics].[dbo].[AtomicMilesMathisPeriodicTableBase]
 -- where  Cast(Protons as int) % 5 = 0
 ) Mathis
ORDER BY AtomicNumber
 ,1
END

BEGIN
PRINT '[dbo].[AtomicMilesMathisMoleculesBindLogicXYZ]'
DROP TABLE IF EXISTS [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ]
END

BEGIN
--CREATE VIEW [dbo].[vwMathisMoleculesBindLogicXYZ]
--AS
WITH Mathis
AS (
 SELECT e.*
 ,m.AlphaType
 ,m.SlotOrder
 ,pbm.MathisCarouselAlphaTypeFull
 ,pbm.AlphaTypeRemainder
 ,m.Protons AS ProtonsMM

 FROM [Physics].[dbo].[AtomicMilesMathisElementsPositions] e
 JOIN [Physics].[dbo].[AtomicMilesMathisPeriodicTable] m ON e.AtomicNumber = m.AtomicNumber
 AND e.SlotNumber = m.SlotNumber
 LEFT JOIN [Physics].[dbo].[AtomicMilesMathisProtonBalance] pbm ON m.AtomicNumber = pbm.AtomicNumber
 where e.Protons > 0
 )
SELECT TOP 100 PERCENT
     A.LTAMKey as LTAMKeySrc
 ,B.LTAMKey as LTAMKeyDest
    ,A.AtomicNumber AS AtomicNumberSrc
 ,B.AtomicNumber AS AtomicNumberDest
    ,A.Electrons  + A.SlotSpin + B.Electrons + B.SlotSpin     as SlotDirectionElectronBond
 ,Cast(1 as int) as IsValid  -- 1 Yes 0 No
 ,A.Element AS ElementSrc
 ,B.Element AS ElementDest
 ,A.CanBind AS CanBindSrc
 ,B.CanBind AS CanBindDest
 ,A.AlphaType AS AlphaTypeSrc
 ,B.AlphaType AS AlphaTypeDest
 ,A.SlotNumber AS SlotNumberSrc
 ,B.SlotNumber AS SlotNumberDest
 ,A.SlotSpin AS SlotSpinSrc
 ,B.SlotSpin AS SlotSpinDest
 ,A.AlphaTypeRemainder AS AlphaTypeRemainderSrc
 ,B.AlphaTypeRemainder AS AlphaTypeRemainderDest
 ,A.MathisCarouselAlphaTypeFull AS CarouselAlphaTypeSrc
 ,B.MathisCarouselAlphaTypeFull AS CarouselAlphaTypeDest
 ,A.AtomicSymbol AS AtomicSymbolSrc
 ,B.AtomicSymbol AS AtomicSymbolDest
 ,A.[SlotOrien] AS SlotOrienSrc
 ,B.[SlotOrien] AS SlotOrienDest
 ,A.[Neutrons] AS NeutronsSrc
 ,B.[Neutrons] AS NeutronsDest
 ,A.[Electrons] AS ElectronsSrc
 ,B.[Electrons] AS ElectronsDest
 ,A.ProtonsMM AS ProtonsMMSrc
 ,B.ProtonsMM AS ProtonsMMDest
 ,A.Protons AS ProtonsSrc
 ,B.Protons AS ProtonsDest
 ,A.[PX] AS PXSrc
 ,A.[PY] AS PYSrc
 ,A.[PZ] AS PZSrc
 ,A.[P2P3] AS P2P3Src
 ,A.[P12] AS P12Src
 ,A.[PE] AS PESrc
 ,A.[p1x] AS p1xSrc
 ,A.[p1y] AS p1ySrc
 ,A.[p1z] AS p1zSrc
 ,A.[p2x] AS p2xSrc
 ,A.[p2y] AS p2ySrc
 ,A.[p2z] AS p2zSrc
 ,A.[p3x] AS p3xSrc
 ,A.[p3y] AS p3ySrc
 ,A.[p3z] AS p3zSrc
 ,A.[p4x] AS p4xSrc
 ,A.[p4y] AS p4ySrc
 ,A.[p4z] AS p4zSrc
 ,A.[p5x] AS p5xSrc
 ,A.[p5y] AS p5ySrc
 ,A.[p5z] AS p5zSrc
 ,A.[p6x] AS p6xSrc
 ,A.[p6y] AS p6ySrc
 ,A.[p6z] AS p6zSrc
 ,A.[N1N2] AS N1N2Src
 ,A.[N1] AS N1Src
 ,A.[N2] AS N2Src
 ,A.[N3] AS N3Src
 ,A.[N4] AS N4Src
 ,A.[N5] AS N5Src
 ,A.[N6] AS N6Src
 ,A.[n1x] AS n1xSrc
 ,A.[n1y] AS n1ySrc
 ,A.[n1z] AS n1zSrc
 ,A.[n2x] AS n2xSrc
 ,A.[n2y] AS n2ySrc
 ,A.[n2z] AS n2zSrc
 ,A.[n3x] AS n3xSrc
 ,A.[n3y] AS n3ySrc
 ,A.[n3z] AS n3zSrc
 ,A.[n4x] AS n4xSrc
 ,A.[n4y] AS n4ySrc
 ,A.[n4z] AS n4zSrc
 ,A.[n5x] AS n5xSrc
 ,A.[n5y] AS n5ySrc
 ,A.[n5z] AS n5zSrc
 ,A.[n6x] AS n6xSrc
 ,A.[n6y] AS n6ySrc
 ,A.[n6z] AS n6zSrc
 ,A.[e1x] AS e1xSrc
 ,A.[e1y] AS e1ySrc
 ,A.[e1z] AS e1zSrc
 ,A.[e2x] AS e2xSrc
 ,A.[e2y] AS e2ySrc
 ,A.[e2z] AS e2zSrc
 ,A.[e3x] AS e3xSrc
 ,A.[e3y] AS e3ySrc
 ,A.[e3z] AS e3zSrc
 ,A.[e4x] AS e4xSrc
 ,A.[e4y] AS e4ySrc
 ,A.[e4z] AS e4zSrc
 ,A.[e5x] AS e5xSrc
 ,A.[e5y] AS e5ySrc
 ,A.[e5z] AS e5zSrc
 ,A.[e6x] AS e6xSrc
 ,A.[e6y] AS e6ySrc
 ,A.[e6z] AS e6zSrc
 ,B.[PX] AS PXDest
 ,B.[PY] AS PYDest
 ,B.[PZ] AS PZDest
 ,B.[P2P3] AS P2P3Dest
 ,B.[P12] AS P12Dest
 ,B.[PE] AS PEDest
 ,B.[p1x] AS p1xDest
 ,B.[p1y] AS p1yDest
 ,B.[p1z] AS p1zDest
 ,B.[p2x] AS p2xDest
 ,B.[p2y] AS p2yDest
 ,B.[p2z] AS p2zDest
 ,B.[p3x] AS p3xDest
 ,B.[p3y] AS p3yDest
 ,B.[p3z] AS p3zDest
 ,B.[p4x] AS p4xDest
 ,B.[p4y] AS p4yDest
 ,B.[p4z] AS p4zDest
 ,B.[p5x] AS p5xDest
 ,B.[p5y] AS p5yDest
 ,B.[p5z] AS p5zDest
 ,B.[p6x] AS p6xDest
 ,B.[p6y] AS p6yDest
 ,B.[p6z] AS p6zDest
 ,B.[N1N2] AS N1N2Dest
 ,B.[N1] AS N1Dest
 ,B.[N2] AS N2Dest
 ,B.[N3] AS N3Dest
 ,B.[N4] AS N4Dest
 ,B.[N5] AS N5Dest
 ,B.[N6] AS N6Dest
 ,B.[n1x] AS n1xDest
 ,B.[n1y] AS n1yDest
 ,B.[n1z] AS n1zDest
 ,B.[n2x] AS n2xDest
 ,B.[n2y] AS n2yDest
 ,B.[n2z] AS n2zDest
 ,B.[n3x] AS n3xDest
 ,B.[n3y] AS n3yDest
 ,B.[n3z] AS n3zDest
 ,B.[n4x] AS n4xDest
 ,B.[n4y] AS n4yDest
 ,B.[n4z] AS n4zDest
 ,B.[n5x] AS n5xDest
 ,B.[n5y] AS n5yDest
 ,B.[n5z] AS n5zDest
 ,B.[n6x] AS n6xDest
 ,B.[n6y] AS n6yDest
 ,B.[n6z] AS n6zDest
 ,B.[e1x] AS e1xDest
 ,B.[e1y] AS e1yDest
 ,B.[e1z] AS e1zDest
 ,B.[e2x] AS e2xDest
 ,B.[e2y] AS e2yDest
 ,B.[e2z] AS e2zDest
 ,B.[e3x] AS e3xDest
 ,B.[e3y] AS e3yDest
 ,B.[e3z] AS e3zDest
 ,B.[e4x] AS e4xDest
 ,B.[e4y] AS e4yDest
 ,B.[e4z] AS e4zDest
 ,B.[e5x] AS e5xDest
 ,B.[e5y] AS e5yDest
 ,B.[e5z] AS e5zDest
 ,B.[e6x] AS e6xDest
 ,B.[e6y] AS e6yDest
 ,B.[e6z] AS e6zDest

INTO [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ]
FROM Mathis A
FULL OUTER JOIN Mathis B ON 1 = 1
WHERE (
 (
 A.Protons > 0
 AND B.Protons > 0
 )
 OR (
 A.ProtonsMM > 0
 AND B.ProtonsMM > 0
 )
 )
 AND (A.AlphaType >= B.AlphaType)
 --AND (
 -- (
 -- (A.SlotSpin <> B.SlotSpin)
 -- OR (
 -- A.SlotSpin = 'N'
 -- AND B.SlotSpin = 'N'
 -- )
 -- OR NOT (
 -- (
 -- A.SlotSpin = 'A'
 -- AND B.SlotSpin <> 'A'
 -- )
 -- OR (
 -- A.SlotSpin <> 'A'
 -- AND B.SlotSpin = 'A'
 -- )
 -- )
 -- )
 ---- AND NOT (A.SlotSpin = B.SlotSpin)
 --)
 --and A.CanBind = B.CanBind
 --AND A.CanBind > 0
 --AND B.CanBind > 0
 AND A.Protons > 0
 AND B.Protons > 0
 AND B.AlphaType > 0
 AND A.AlphaType > 0

 --AND A.SlotNumber NOT IN (
 -- 18
 -- ,19
 -- )
 --AND B.SlotNumber NOT IN (
 -- 18
 -- ,19
 -- )
 

 --  AND A.Electrons + A.SlotSpin + B.Electrons + B.SlotSpin  not in (  
 --     'TRTL', 'BRBL', 'BRTR','BRTL' )
--and
--Case when (A.Electrons = 'A' and B.Electrons = 'A') then 1 else
--Case when A.Electrons = 'B' and B.Electrons = 'T' then 1 else
--Case when A.Electrons = 'T' and B.Electrons = 'B' then 1 else 0 end end end =1
--and CASE WHEN ((A.SlotNumber=1 and A.AtomicNumber <= 4) or (B.SlotNumber = 1 and B.AtomicNumber <=4)) Then 0 else 1 End = 1
ORDER BY A.AtomicNumber
 ,A.SlotNumber
 ,B.AtomicNumber
 ,B.SlotLayout

END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-202302242-BindLogicXYZ] ON [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END
 


-- Set known Invalid Configurations
BEGIN
PRINT 'Set IsValid = 0 for Invalid Configs'

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE  A.SlotDirectionElectronBond  in ( 'TRTL', ' TLTR', 'BRBL', 'BRTR','BRTL' ) ;

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE  A.SlotNumberSrc IN (18,19);

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE  A.SlotNumberDest IN (18,19);

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE (SlotSpinSrc = SlotSpinDest) and NOT (SlotSpinSrc = 'A' and SlotSpinDest = 'A') ;

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE (SlotSpinSrc = 'N' or  SlotSpinDest = 'N');

END


BEGIN
PRINT 'dbo.AtomicMilesMathisFormulas'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisFormulas
END


BEGIN
--CREATE View [dbo].[vwAtomicOrbitalsinMilesDetailAllBonds]
--as
--WITH Bonds
--AS (

SELECT
--P.ZFormula,
P.ZID,
Formula.Formula,
Formula.CurrentAtom,
Formula.NextAtom1,
Formula.NextAtom2,
Formula.NextAtom3,
Formula.NextAtom4,
Formula.NextAtom5,
Formula.NextAtom6
INTO dbo.AtomicMilesMathisFormulas
FROM
(SELECT Distinct ZFormula, MAX(ZID) as ZID
FROM [dbo].[AtomicMilesMathisOrbitalBondsParsed]
where LEN(ZFormula) > 1
GROUP BY ZFormula ) P
CROSS APPLY
(
 SELECT CurrentAtom
 ,NextAtom1
 ,NextAtom2
 ,NextAtom3
 ,NextAtom4
 ,NextAtom5
 ,NextAtom6
 ,Min(ZFormula) AS Formula
 ,Min(ZMolecule) AS Molecule
  --  INTO [dbo].[AtomicMilesMathisFormulas]
 FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] BL
 JOIN [dbo].[AtomicMilesMathisOrbitalBondsParsed] OB
 ON (
 BL.AtomicSymbolSrc = OB.CurrentAtom
 AND (
   BL.AtomicSymbolDest = OB.NextAtom1
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
    BL.AtomicSymbolDest = OB.CurrentAtom
 AND (
   BL.AtomicSymbolSrc = OB.NextAtom1
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom1
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom1
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom2
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom2
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom3
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom3
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom4
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom4
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom5
 AND (
 BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom5
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom6
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom6
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 WHERE BL.AtomicNumberSrc IS NOT NULL
  AND BL.IsValid > 0
  and OB.ZFormula = P.ZFormula
 --and NOT EXISTS (
 --SELECT TOP 1 1 from [dbo].[vwMathisMoleculesBindLogicXYZ] A where OB.ZFormula = A.AtomicSymbolSrc  
 --)
 --and CurrentAtom is not null and NextAtom1 is not null
 GROUP BY CurrentAtom
 ,NextAtom1
 ,NextAtom2
 ,NextAtom3
 ,NextAtom4
 ,NextAtom5
 ,NextAtom6
 
 ) Formula

-- )
END

BEGIN
--Remove Deutrium
  DELETE
  FROM [Physics].[dbo].[AtomicMilesMathisFormulas]
  where Formula like '%D%'  COLLATE SQL_Latin1_General_CP1_CS_AS
  and Formula not like '%Dy%'
END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-202302242-Formulas] ON [dbo].[AtomicMilesMathisFormulas] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END


BEGIN
PRINT 'dbo.AtomicMilesMathisOrbitalsDetailAllBonds'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisOrbitalsDetailAllBonds
END

BEGIN
SELECT TOP 100 PERCENT
     OB2.*
 ,BL2.*
INTO [dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
FROM [dbo].[AtomicMilesMathisFormulas] OB2
INNER JOIN [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] BL2 ON (
 OB2.CurrentAtom = BL2.AtomicSymbolSrc
 AND (
     BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom1 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom2 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom3 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom4 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom5 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom6 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 )
 )
WHERE 1=1
  AND BL2.IsValid = 1

--AND NOT(OB2.Formula LIKE '%D%'
--   OR OB2.Formula LIKE 'C%H%'
--       OR OB2.Formula LIKE '[0-9]%'
--     )
ORDER BY
    OB2.Formula
 ,ElementSrc
 ,ElementDest
 ,SlotNumberSrc
 ,SlotNumberDest

END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-202302242-OrbitalsMiles] ON [dbo].[AtomicMilesMathisOrbitalsDetailAllBonds] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END
GO


Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Wed Jun 28, 2023 8:56 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Nbuild10
Build Stored Procedure and EXEC Query outputs.

Cr6, your image shows right clicking on the stored procedure ‘spBuildAtomicMilesMathisOrbitalsDetailAllBonds’
in order to Drop that stored procedure before Creating a new one as per the current query? As an example of an administrative detail - adjusting objects to a coming change? How considerate. I suppose the new build query must be up and ready to execute at the time? I believe you included the image for information sake as the image cannot apply to me since there are no stored procedures (that I know of) in my Physics directory.

Staggered by the 'Current Build' size – over 1500 lines. Saved the sql file as ‘instr28June.sql’, awaiting execution.  

Checked my system memory, 95 GB free.

Tried Executing -  
Failed to execute
Msg 3701, Level 11, State 5, Line 5
Cannot drop the procedure 'dbo.spBuildAtomicMilesMathisOrbitalsDetailAllBonds', because it does not exist or you do not have permission.

Completion time: 2023-06-28T09:50:20.6192418-07:00

Checked Shrinking (Physics/Task/Shrink/Database or File).
-- The database can be reduced from its current 2191 MB, the available free space is 54 MB roughly 2%.
-- The file can be reduced from its current 273 MB down to a minimum of 221 MB.
Decided against doing any shrinking.

Had lunch.

Went back to SSMS and the Build Query and tried Execution again.
Commands completed successfully.
Completion time: 2023-06-28T12:25:39.8180778-07:00
Why did the ‘Current build script’ fail to run initially, yet complete successfully soon thereafter? Did I change anything by looking at shrink options? Maladjusted database objects indeed.

Saw Physics was still the current database, followed up with the new EXEC query:
EXEC [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]
Received an immediate completion with error.
dbo.AtomicMilesMathisOrbitalParsed
Msg 208, Level 16, State 1, Procedure dbo.spBuildAtomicMilesMathisOrbitalsDetailAllBonds, Line 13 [Batch Start Line 0]
Invalid object name 'Physics.dbo.vwChemSpider'.

Completion time: 2023-06-28T12:28:39.4394000-07:00
I'm hoping the Build Stored Procedure just needs some small correction.


BasedPhysics. According to the latest requirements.txt here are the version numbers for four Jupyter Notebook python libraries which allow a proper Notebook rendering of atoms and spin widgets for AB, AB2, AB3 and mB.  
Good Versions
pythreejs==2.4.2
pandas==1.5.3
numpy==1.24.3
ipywidgets==8.0.6

This morning using anaconda I tried updating those packages/libraries in the Notebook environment to those newer versions.
Pythreejs==2.4.2.  Good. Updated from 2.4.1 to 2.4.2.
pandas==1.3.5. Not Good. Anaconda indicates that an update to 1.3.5 is available, but all requested packages are already installed. The only alternative is to cancel the update.
Numpy==1.20.3. Not Good. Anaconda also indicates that an update to 1.20.3 is available, but (like pandas) all requested packages are already installed. The only alternative is to cancel the update.
ipywidgets==8.0.6.  Good. Updated from 8.0.2 to 8.0.6.

The two important rendering apps, Pythreejs and Ipywidgets versions are now good, Numpy and pandas are not - I wouldn't think the latest numpy or pandas would be necessary. I then reviewed the notebooks and saw that the SL spin controls are now visible, but the atom renderer still displays an error.

Jupyter Notebook now includes a new message about migrating to Notebook 7.
Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions - Please note that updating to Notebook 7 might break some of your extensions.
- https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

ipynb_checkpoints. Yesterday I thought I had cleared up the gitignore file to ignore my simple walk through reviews of the Notebook files. Well, I was wrong, the ipynb_checkpoints for both the main and sub-directory notebooks showed up again today. Very frustrating.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Wed Jun 28, 2023 11:55 pm

Hi LTAM,

Sorry to see the troubles.  I was kind of concerned giving the full Physics Database because there is some management overhead with it.
Sometimes closing SSMS and reconnecting can allow objects to "suddenly show up" from a previous script run. It does some caching in the background in SSMS.

Also, make sure your windows user login is an SA (sysAdmin) on the server (or the user you are using to connect in SSMS). This is under the folder Logins > Name of the User you are connecting with.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Logins11

Miles Periodic Table with Standard Periodic Table reference - Page 8 Logins10

You can re-add your login to the database after a restore if necessary:

But when I restore another database backup that gets disconnected, i.e. not accessible.

ALTER ROLE [db_owner] ADD MEMBER [MyComputerName\MyLoginName]
or EXEC sp_addrolemember 'db_owner', 'MyComputerName\MyLoginName';


Here's the ChemSpider view:

Code:
USE [Physics]
GO

/****** Object:  View [dbo].[vwChemSpider]    Script Date: 6/28/2023 10:59:18 PM ******/
DROP VIEW [dbo].[vwChemSpider]
GO

/****** Object:  View [dbo].[vwChemSpider]    Script Date: 6/28/2023 10:59:18 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[vwChemSpider]

as

SELECT distinct  MIN(ChemspiderID) as ChemspiderID, trim(f.value) as Formula,
MIN(REPLACE(REPLACE(REPLACE(REPLACE(TRIM(c.value), '</sup>',' '), '<sup>',''), '</sub>',' '), '<sub>','')

) as Molecule
from dbo.Chemspider  A
CROSS APPLY string_split(A.Content, '|',1) f
CROSS APPLY string_split(A.Content, '|',1) c
where f.ordinal = 2
and c.ordinal =  1
and trim(f.value) not like 'C%H%'
and trim(f.value) not like '[0-9]%'
GROUP BY trim(f.value)  
GO

It works for me and I can reach it.

Miles Periodic Table with Standard Periodic Table reference - Page 8 Chemsp10   scratch

After it runs for 20-30 minutes it should pop this in the messages tab:

dbo.AtomicMilesMathisOrbitalParsed

(13471 rows affected)
dbo.AtomicMilesMathisOrbitalBondsParsed

(4607 rows affected)
dbo.AtomicMilesMathisElementsPositions

(1710 rows affected)
dbo.AtomicMilesMathisPeriodicTable

(2983 rows affected)
dbo.AtomicMilesMathisPeriodicTableBase

(157 rows affected)
dbo.AtomicMilesMathisProtonBalance

(157 rows affected)
[dbo].[AtomicMilesMathisMoleculesBindLogicXYZ]

(883986 rows affected)
Set IsValid = 0 for Invalid Configs

(152450 rows affected)

(17474 rows affected)

(53787 rows affected)

(378888 rows affected)

(0 rows affected)
dbo.AtomicMilesMathisFormulas

(4483 rows affected)

(38 rows affected)
dbo.AtomicMilesMathisOrbitalsDetailAllBonds

(563022 rows affected)

Completion time: 2023-06-29T02:38:37.6286325-05:00

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Thu Jun 29, 2023 5:08 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Ssmslo10
Those little red x's don't look good.

Cr6 wrote. Also, make sure your windows user login is an SA (sysAdmin) on the server (or the user you are using to connect in SSMS). This is under the folder Logins > Name of the User you are connecting with.

How do I make sure of that? I guess this is what you mean by ‘Some management overhead’.

Sorry Boss, there will be some delay before I can follow your latest directions. You may think it remiss of me, but I don’t recall ever making any SSMS login. The instructions I’ve come across before were and still are somewhat incomprehensible.

I don't identify myself when opening SSMS. Am I, MyLoginName == Robert, the only USER of my laptop, known as MyComputerName == ASIMOV, named after Isaac Asimov, a favorite science fiction author of mine, and biochemistry professor who died in 1992?

When I turn on my machine (ASIMOV) every day, I type a password to access it – would that be Robert's SSMS password?

Or am I sa???? sa has a password entered and reentered longer than my everyday password. How do I know?

After all is said and done I take it you want my login (the person I should sign in as – Robert should be fine) rights to include both:

setupadmin
sysadmin

For the time being, the SSMS Login Properties help button directed me to Create a Login.
https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/create-a-login?

(Snipped a couple lines of browser address details – but it should still work)

I’ll try reading up on it. Feels like another make or break test. I hope you don't mind, I’d feel a whole lot better hearing any guidance you may have on the subject.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Fri Jun 30, 2023 2:10 am

Okay it looks like a Windows Login. That's good.

You might want to ensure you are a sysadmin. You probably are. The red Xs can be ignored, they are for services/internal system accounts. Generally for local development you'll see them but can ignore them. With an actual server it is a different matter and takes a bit more configuration to remove the red Xs.

SQL Server Management Studio = SSMS.

Miles Periodic Table with Standard Periodic Table reference - Page 8 Sysadm10

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Fri Jun 30, 2023 2:26 am

Here's a new database the the table fully populated. You won't need to run the stored proc unless you want to adjust it in anyway. The physics db restore will provide the table ready to use from the stored proc I ran successfully on my computer. If you have any issues with the restore, delete the old Physics database and restore it new with this version 20230630Physics.bak:

https://mega.nz/file/q9sAjSDR#KJ7shYicXIEoRB-48s_1q5r0PvVHfeI5oU7RQHK0I9U

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Fri Jun 30, 2023 12:06 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Resore10

Cr6, mixed results Sir, it worked until it didn’t.

Downloaded and identified 20230630Physics.bak as the Physics backup file. Did a full restore, and received the message “Database ‘Physics’ restored successfully”.

Refreshed, then looked at the ‘Physics” tables - no sp tables, then closed and reopened SSMS. Still no stored procedure tables visible.  

I then deleted (moved to a separate document folder) the old 20230624PhysicsVersion2.bak and 20230625PhysicsV2.bak backups and attempted another restore.

That restore failed and ‘Physics’ is no longer accessible. I returned the two backup files to the backup folder.

Awaiting further instructions.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Fri Jun 30, 2023 1:41 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Resor310

I take back that last awful status. I can see 'Physics' again.

Tried another restore of just the database and can see 'Physics' again.

Back to your instructions
'If you have any issues with the restore, delete the old Physics database and restore it new with this version 20230630Physics.bak'

As soon as I select (check) 20230630Physics the other docs are also checked. If I remove the old bak files and select 20230630Physics the Restore announced there's were no backup items selected. Returned the bak files. Now everything is back again.

I'm delirious, I guess I need an expanded explanation of "delete files and restore" - how exactly does one select the file to restore too?
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sat Jul 01, 2023 10:24 pm

To delete the old Physics database it is a "drop" statement like the following. It will delete everything so do a back up if you want to save something. After it finishes, do a new "restore" with the latest file:

Code:
USE [master]
GO

/****** Object:  Database [Physics]    Script Date: 7/1/2023 9:22:35 PM ******/
DROP DATABASE [Physics]
GO






Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Jul 03, 2023 4:36 pm

.
Cr6 wrote:
'If you have any issues with the restore, delete the old Physics database and restore it new with this version ‘20230630Physics.bak'
And.
To delete the old Physics database it is a "drop" statement like the following. It will delete everything so do a back up if you want to save something. After it finishes, do a new "restore" with the latest file
CODE:
Code:

USE [master]
GO

/****** Object:  Database [Physics]    Script Date: 7/1/2023 9:22:35 PM ******/
DROP DATABASE [Physics]
GO:
Cr6, thank you Sir. I believe you’ve made the task as easy as possible:

1. ‘20230630Physics.bak'. Obtain the current ‘Physics’ database file and store it in the backup folder.

2. Delete ‘Physics’.

3. “Restore” ‘Physics’using ‘20230630Physics.bak'.  

Very neat. No different than building a copy of an existing ‘Physics’ database for the very first time. Sure, its harder for non microsoft logins, but 20230630Physics.bak also provides well-developed stored procedure tables, sure seems like sql progress to me.  

Till I saw your last query, I didn’t realize that “deleting the old database” was anything more than deleting or replacing files. If I’ve appeared unwilling or resistant to your instructions, its only because I’m lacking confidence. Plus I lost the weekend due to time filling unexpected events. I hope I haven’t caused you any grief.

I’ll delay deleting and restoring ‘Physics’ until I do some basic sql review. Beginner stuff, starting with the tutorial:
Quickstart: Backup and restore a SQL Server database on-premises https://learn.microsoft.com/en-us/sql/relational-databases/backup-restore/quickstart-backup-restore-database?view=sql-server-ver16
Looks like a short tutorial, likely includes related tutorial links. I’ve also got three earlier sql tutorial databases available to mess with. I’ll also watch a few videos. That’ll likely take me a couple more days. Fully expect to learn I’ve been screwing-up the restore process at least one way or another. You probably knew that and have been patient with me; thanks.

That’s all my sql database status for now.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Wed Jul 05, 2023 4:10 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Physdb10
The old ‘Physics’ is dropped, the new ‘Physics’ is restored. My restore options list is now down to the current backup.

As we know, the process is not complicated. Working the tutorial and two spare databases; back-upping, dropping and restoring two or three times before doing ‘Physics’ enabled me to get past my anxiety.

'Physics' database changes. Here’s a quick summary of the database changes:
Dropped Graph Tables.
gAtom
gAtomPeriodicTableAtom
gMathisAtomPeriodicTableAtomLTAMKeyEdge
gMathisPeriodicTableAtomLTAM
gPeriodicTableAtom
gPeriodicTableSlots
Dropped Table.
AtomicOrbitalsinMilesDetailSummary
New Tables:
AtomicMilesMathisElementsPositions
AtomicMilesMathisFormulas
AtomicMilesMathisMoleculesBindLogicXYZ
AtomicMilesMathisOrbitalBondsParsed
AtomicMilesMathisOrbitalParsed
AtomicMilesMathisOrbitalDetailsAllBonds
AtomicMilesMathisPeriodicTable
AtomicMilesMathisPeriodicTableBase
AtomicMilesMathisProtonBalance
AtomPeriodicTableAtomLTAMKey
New Views:
gAllowedBonds. Query completed with errors.
Code:
    Msg 208, Level 16, State 1, Procedure gAllowedBonds, Line 6 [Batch Start Line 2]
     Invalid object name 'dbo.gPeriodicTableAtomLTAM'.
     Msg 4413, Level 16, State 1, Line 5
     Could not use view or function 'dbo.gAllowedBonds' because of binding errors.
vwChemSpider
vwServerIPAddress
vwSysTableSizes

The select all from gAllowedBonds query results in an error. Looks like the invalid object name needs to be changed to gMathisPeriodicTableAtomLTAM.

I was surprised not to see any ‘stored procedure’ tables, of the type, dbo.sp… , I guess the info they contained must make up the bulk of New Tables. Surprised to see only one Graph table remains – have you given up on speed?

Up-to-date index. Plenty I don’t grok either, repeated reviews can only help. For your convenience, an up-to-date index with brief descriptions of ‘Physics’ Graph Table, Tables and Views.

Code:

//////Physics database, 20230630Physics.bak, Updated 4-5 July 2023//////
#Graph Tables.

gMathisPeriodicTableAtomLTAM. 1,530 rows, 17 cols. Familiar data with $node schema info/code

/////////////////////////////////
#Tables.

AllTable.  335 rows -  4 cols. Quantity, Value, Uncertainty, Unit.
 No primary key. 355 atomic constants and relationships.
AtomicMilesMathisElementsPositions. 1710 rows and 89 cols. Haven't figured it out yet.
AtomicMilesMathisFormulas. 4,445 rows, 9 cols. ZID, Formula, CurrentAtom, NextAtom1, … , NextAtom6.  
AtomicMilesMathisMoleculesBindLogicXYZ. 883,986 rows, 166 cols. Each row is a bond. 1 min 3 sec.
AtomicMilesMathisOrbitalBondsParsed. 4,607 rows, 64 cols. ZMolecule, CurrentAtom, NextAtom1, … , 8p, 9s, 9p, ZID.
AtomicMilesMathisOrbitalParsed. 13,471 rows, 47 cols. ID ZMolecule ZItem ZFormula ... .
AtomicMilesMathisOrbitalDetailsAllBonds. 563,022 rows, 175 cols. ZID Formula CurrentAtom NextAtom1 ... e6zDest.
AtomicMilesMathisPeriodicTable. 2,983 rows, 17 cols. UID AtomicNumber AtomicSymbol ... color. Pt data in a strange order?
AtomicMilesMathisPeriodicTableBase. 157 rows, 153 cols. RemainderAlphaLevel ... 9p. Mainly Atomic data (?).
AtomicMilesMathisProtonBalance.  157 rows, 12 cols. Carousel ... AlphaTypeRemainder
AtomicOrbital. 21,161 rows 46 cols. ID ZMolecule ZItem ZFormula ... .
AtomicOrbital1. 372,821 rows. 46 cols.  ID ZMolecule ZItem ZFormula, … , 9p. 11 seconds to output.
AtomicRDKit. 92 rows -  38 cols. Each atom’s (1-92) select atomic values.
AtomicSourcesRDKit. 26 rows -  5 cols (PropertyID, property, notes, units and source).
AtomPeriodicTableAtomLTAMKey. 132 rows, 5 cols. ID LTAMKey CanBind Electrons AlphaType.
Chemspider. Was 65,814 rows. 5 cols. UID Line Content ChemspiderID LoadDate.
 Content includes various Chemspider molecular names. 
Circle. 36001 rows - 360 degrees in hundreths. Cols x y and z are NULL. Replaces rotation calculations with a table lookup.
Compounds. 262 rows - 3 cols. No, Compound, Formula.
CompoundsSmiles. 1351 rows - 6 cols. SMILES info(PID,id,EntryName,SMILES,MW.Selectivity_Index).
ElementAbundance. 78 rows – 9 cols. 78 Elements’ crustal abundances.
ElementsPositions. 1710 rows – 87 cols. Available bonding slots(?) per element.
EnergyLevel. 6 rows – 7 cols. EnergyLevel,ShellLetter,ElectronCapacity,s,p,d,f.
FormulaSuperConductor. 176 rows of FormulaSuperConductors
GraphMilesAtomNode – 157 rows - Through Atomic number 162. 8 columns (AtomicNumber, AtomicSymbol, Element,
GraphTempAtomNode. 90 rows, Up to Thorium. 8 columns (AtomicNumber, AtomicSymbol, Element,
 OrbitalGroup, Protons, Neutrons, GroupNumber, Period).
Ions. 64 rows – 5 cols. IonID,Ion,Charge,AlphaNm,Name
Mathis. 1282 rows – 5 cols. UID, AtomicNumber,Position,SlotNumber,AlphaType
MilesMathis. 12 rows – 4 cols. ID,Description,RawCalculation, Set2. Miles calcs.
MilesMathisPeriodicTable. 2983 rows – 18 cols. 163 Atomic numbers x 19 slots.
MilesMathisPeriodicTableOLD. 2983 rows – 18 cols. 163 Atomic numbers x 19 slots. Missing slotlayouts.
MilesMathisPeriodicTableOLD2. 2993 rows, 18 columns.
nci. 150 rows – 2 cols. Compoundid, smiles.
Numbers. 65,536 rows – 1col, Number. Rows 1 to 65536 containing Number 0 to 65,535.
Orbital1. 344 rows – 27 cols. Atomic electron orbital info.
OrbitalMatrix. 157 rows – 30 cols. 163 elements with atomic electron orbital info.
Orbitals. 172 rows – 13 cols. 172 elements’ atomic electron orbital info.
PeriodicTable. 118 rows – 74 cols. 118 elements’ atomic data.
PeriodicTableGrouping. 110 rows – 30 cols. 110 elements’ atomic data.
PeriodicTableState. 112 rows – 12 cols. 112 elements’ atomic data.      
PeriodType. 10 rows – 2 cols. Period, PeriodTypeDescription - Atomic types, alkaki metals to noble gases.      
Species. 105,020 rows, 4 cols. ID, Molecule, Formula, Detail. Like Chemspider.
Species_Stg. 1998 rows – 3 cols. Molecule, Formula, Detail.      
Species20230212. 103,185 rows. 4 cols. ID, Molecule, Formula, Detail. 1 Sec.
sqlmol_bond_type. 0 rows. btid symbol.    
sqlmol_compound. 150 rows. compoundid, smiles  cols.    
sqlmol_compound_bonds. 0 rows. cbid, compoundid, btid, ceid1, ceid2.  
sqlmol_compound_elements. 0 rows. ceid, compoundid, atom, nodeid.    
sqlmol_compound_hfbonds. 0 rows. compoundid, chbid, ceid, cbid, btid, parseid.
sqlmol_element_type. 0 rows. symbol.                                
sqlmol_hfbond_type. 0 rows. btid, symbol.                                
sqlmol_symbol. 28 rows. 3 cols, code, type, Aromaticity.                              
STG_Orbital. 172 rows. 28 cols. 172 elements’ electron orbital data.

/////////////////////////////////
#Views.

AtomicOrbitalBonds. 9028 rows. 53 cols. Atomic details and orbitals. All ZmoleculeOrder values equal 1.
AtomicPivotedByAtomicNumber. 9,993 rows. 92 cols. Atom1-Atom90 cols. 12 secs. 
Function_Assist_GETDATE. 1 row. 1 col, GetDate. Gives the date and time of the query function.
Function_Assist_RAND. 1 row. 1 col, RAND. Returns a random value between 0 and 1.

gAllowedBonds. Msg 208, Level 16, State 1, Procedure gAllowedBonds, Line 6 [Batch Start Line 2]
 Invalid object name 'dbo.gPeriodicTableAtomLTAM'.
 Msg 4413, Level 16, State 1, Line 5
 Could not use view or function 'dbo.gAllowedBonds' because of binding errors.

MathisEdgesGraphML. 141,518 rows. 6 cols. RowN, Source, Target, srcElement, trgElement, edges. 10 secs.  
MathisNodesEdgesAllBinds. 0 rows. 43 cols. AtomicNumberSrc, … , Color. Columns Acting buggy.  
MathisNodesGraphML. 1000 rows. 1000 nodes.      
MilesMathisCalculus. 50 rows. 5 cols. Z, 2z, z3, NextNumber, MathisCalculus.      
vwAllTable. 335 rows. 4 cols. FloatValue, Quantity, Value, Uncertainty.        
vwAtomic. 385,015 rows. 160 cols. 44 seconds.
vwAtomicOrbital. 34,465 rows. 47 cols. ID, ZMolecule, Zitem, … , 9p.
vwAtomicOrbitalBonds. 13,848 rows. 56 cols. ZMoleculeOrder, CurrentAtom, ... , ZID.
 Atomic details and orbitals. All Zmolecule, Order values equal 1.
vwAtomicOrbitalPerm. 21,161 rows. 46 cols. ZID, ZMolecule, ZItem, … , 9p.
vwAtomicOrbitalsAllMiles. 2,610 rows. 7 cols. CurrentAtom, NextAtom1, … , Formula. 39 seconds.
vwAtomicOrbitalsinMiles. Was 1778, now 2,608 rows. 7 cols. CurrentAtom, NextAtom1, … , Formula. 23 secs.
vwAtomicOrbitalsinMilesDetail. 11,857 rows. 170 cols. 3 Minutes 1 second.  
vwAtomicOrbitalsinMilesDetailAllBonds. 41,431 rows. 173 cols. CurrentAtom, NextAtom1, … , Formula.
 Took 7 minutes 03 seconds to run this query, longest by far.
vwAtomicOrbitalsinMilesDetailCarbonFilteredOut. 9,378 rows. 170 cols. CurrentAtom, NextAtom1, … , Formula. Took 3 minutes 14 seconds.
vwAtomicOrbitalsinMilesDetailSummary. 35,978 Rows, 172 cols.  CurrentAtom, NextAtom1, … , e6zDest. 5 seconds.
vwAtomicOrbitalsinMilesDetailSummaryPeriodicDetail. 71,914 rows and 323 columns. 12 seconds. A lot of info.
vwAtomicOrbitalsinMilesDetailSuperConductors. 3,424 rows, 170 cols, CurrentAtom, NextAtom1, … , e6zDest.
vwAtomicOrbitalsNotinMiles. 545 rows. 8 cols. CurrentAtom, NextAtom1, … , Formula. Took 40 seconds to run this query.
vwAtomicOrbitalsNotinMilesAll. 40 seconds. 827 rows and 9 cols. With reasons: SlotOrientation and BindLogic. 32 secs.
vwAtomicOrbitalsNotinMilesBySlotOrientation. 789 rows and 170 cols.
vwAtomicPeriodicTableLTAMSpins. 34,399 rows 177 cols. ID, ZMolecule, … , SL4. Took 5 secs to run this query.
vwAtomicPivoted. 34,399. 92 cols. ID, ZMolecule,  … , MolOrder. Took 4 secs to run this query.
vwChemSpider. 65,814 rows, 5 cols. UID Line Content Chemspider LoadDate
vwCircle. 36001 rows. 1 col. Degree. Looks like random rotations (with select *) between zero
 and sequential rotations when using the select top 1000 values.
vwDeutrium. 14 rows. 4 col. ID, Molecule, Formula, Detail.
vwElementsPositions. 1710 rows. 88 cols. AtomicNumber, AtCurrentAtom, NextAtom1, … , Formula. 0 seconds.
 Element, AtomicTuple, … , SL4,LTAMKey
vwMathisLTAMMolecules. 397,328 rows. 119 cols. ZID, ZMolecule, … , 9p. 14 seconds. Ties electrons and electron orbitals together?
vwMathisMaxSlotPivoted. 90 rows. 28 cols. AtomicNumber, AtomicSymbol, … , Slot19.
vwMathisMoleculesBindLogic. 35509 rows. 162 cols. AtomicNumberSrc, AtomicNumber Dest, … , e6zDest. The query took 3 secs.
vwMathisMoleculesBindLogicXYZ. 24,318 rows. 164 cols. AtomicNumberSrc, AtomicNumber Dest, … , e6zDest. The query took 2 secs.
vwMathisMoleculesFullBindLogic. 989,012 rows. 255 cols. BondType, AtomicNumber, AtomicSymbol Dest, … , e6zDest. The query took 1 minute 26 secs.
vwMilesMathisElectronBondingMapped, 2983 rows. 179 cols. UID, mOrbitalGroup, mProtons,mNeutrons, , ZSeqNo, ZItem, ZElement, ZFormula, … , 9p.
 From 35 to 1 second runtime. Resembling AtomicOrbitalBonds with plenty of potential ml atomic attributes.
vwMilesMathisPeriodicTable. 2,983 rows. 17 cols. UID, AtomicNumber, AtomicSymbol, … , Color. The query took 8 secs.
vwMilesMathisPeriodicTablePivoted. 2,983 rows. 34 cols. UID, AtomicNumber, AtomicSymbol, … , Color.
vwMolecule. 815,528 rows. 8 cols. ID, Molecule, Formula,  Item, RW, ASCIINum, Number, CharPlaceType. 32 secs.
vwMoleculeAtomicWeight. 13,848 rows. 7 cols. ID, MolecularWeight, Formula,  Molecule, Number, NistLookup, ChemspiderLookup ,Total1stIonization. 2 Seconds.
vwNumbers. 2,476,099 rows. 1 col. n. 0-2,476,099. 8 Seconds.
vwPeriodicTable. 157 rows. 153 cols. RemainderAlphaLevel1, REM2, REM3, … , 9p.
vwProtonBalanceMathis. 157 rows. 12 cols. Carousel, AlphaProtonCarouselRemainder, Alphas, Element, AtomicSymbol, Period, … , AlphaTypeRemainder.
vwServerIPAddress. 1 row, 7 cols. net_transport protocol_type auth_scheme ... public_nrt_transport
vwSysTableSizes. 53 rows, 6 cols. SchemaName TableName RowCounts Used_MB Unused_MB Total_MB

////////////////////////////////////////////////////////////////

Cr6, I’ve lost track. What are the latest numbers? How many molecule types comprised of seven or so atom types are known? Does Physics use each of them? How many do our charge field bonding rules seem to account for? How many do they not? Any outstanding problems? An assessment, plan or direction would be welcome.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Thu Jul 06, 2023 1:09 am

Hi LTAM,

Nice recap!  It is great to hear you can reach tables/views in the most current .bak file.

For the Graph oriented tables ("gTableName"), I had to drop them simply due to size.  They were getting very large and made the database not that easy to share.  Should have prefaced that in a prior post. This was back in June.

As for the lengths of bonds,  I am still leaving out hydrocarbon style bonds "CH" just because they create a lot of entries and they take a lot of time to process on my laptop.

LTAM wrote:
Cr6, I’ve lost track. What are the latest numbers? How many molecule types comprised of seven or so atom types are known? Does Physics use each of them? How many do our charge field bonding rules seem to account for? How many do they not? Any outstanding problems? An assessment, plan or direction would be welcome.

Yeah, getting longer and more complex Formulas added per Miles is still a challenge. I just wanted to get a dataset that we could use to look at a good number of them. I may need to do a special Chemspider query for length-number of combined atoms and add those in.  

Right now the "rules engine" is pretty loose. Adding in this "WHERE IsValid=1" clause can firm it up a bit towards Miles' structures. Still it needs more work like for cases where an AA or A1 (center of carousel) can actually bond-hook with a "Z14" et. al. Rules to firm up cases are still needed for certain formulations. Also since this shows a 2-D table style grid instead of 3-D in a GUI (like Nevyn's Atomic Viewer, Jared's videos, or your LTAM views in your Jupyter notebooks)...things can just drop out except when looked at, or thought of, in a 3-D manner. 2-D can't account for all the dimensions at play. Sadly, most data oriented people are not 3-D graphic artists and can't see what causes the "shadows" in certain real-world situations. They want to just look at differences and changes from stable values (e.g. height and... not a Shadow's length at 5pm...for the exact same person on a certain day of the year in the exact same spot.  Cool ...people often want to redefine "height" so the attributes just fit into their thinking patterns -- pretty common in corporate reporting TBH -- this is why I started going towards "Graph DBs" they can allow multiple attributes for the same "entity"...the core entity remains solid and true but the attributes to describe it can be expanded like with  different axes or strengths-speeds-etc.). It is the old reporting question of "what is in" and "what is out" when doing a connection-comparison.

I'll need to look at Miles again to really see what can be a valid bond, atom to atom, with these A1's:


LTAMKeySrc LTAMKeyDest FormulaCounts
A1Z2A A1Z2A 4
A1Z2A A1Z4A 2
A1Z2A A1Z6A 75
A1Z2A A1Z6B 119
A1Z2A B10Z1R 26
A1Z2A B13Z1L 28
A1Z2A B15Y1R 44
A1Z2A B15Y1R 6
A1Z2A B15Y2R 36
A1Z2A B15Y2R 10
A1Z2A B17Z1R 38
A1Z2A B1Z1R 101
A1Z2A B4Z1L 15
A1Z2A B4Z2L 8
A1Z2A B7Y1R 4
A1Z2A N16Z1L 4
A1Z2A N2Y1R 1
A1Z2A N3Y1L 1
A1Z2A T11Z1R 28
A1Z2A T12Z1L 23
A1Z2A T14Y1L 56
A1Z2A T14Y1L 13
A1Z2A T14Y2L 32
A1Z2A T14Y2L 11
A1Z2A T16Z1L 20
A1Z2A T2Y1L 17
A1Z2A T5Z1R 15
A1Z2A T6Y1L 4
A1Z4A B10Z1R 14
A1Z4A B13Z1L 15
A1Z4A B15Y1R 17
A1Z4A B15Y2R 1
A1Z4A B17Z1R 10
A1Z4A B1Z1R 26
A1Z4A B4Z1L 6
A1Z4A B4Z2L 5
A1Z4A B7Y1R 4
A1Z4A N2Y1R 4
A1Z4A N3Y1L 4
A1Z4A T11Z1R 15
A1Z4A T12Z1L 11
A1Z4A T14Y1L 23
A1Z4A T14Y2L 3
A1Z4A T16Z1L 8
A1Z4A T2Y1L 9
A1Z4A T5Z1R 6
A1Z4A T6Y1L 4
A1Z6A A1Z2A 75
A1Z6A A1Z4A 18
A1Z6A A1Z6A 62
A1Z6A A1Z6B 405
A1Z6A B10Z1R 138
A1Z6A B13Z1L 162
A1Z6A B15Y1R 262
A1Z6A B15Y1R 26
A1Z6A B15Y2R 209
A1Z6A B15Y2R 47
A1Z6A B16Z1L 1
A1Z6A B17Z1R 233
A1Z6A B1Z1R 307
A1Z6A B4Z1L 137
A1Z6A B4Z2L 47
A1Z6A B7Y1R 7
A1Z6A N16Z1L 21
A1Z6A N2Y1R 230
A1Z6A N3Y1L 230
A1Z6A T11Z1R 162
A1Z6A T12Z1L 114
A1Z6A T14Y1L 221
A1Z6A T14Y1L 64
A1Z6A T14Y2L 221
A1Z6A T14Y2L 42
A1Z6A T16Z1L 132
A1Z6A T2Y1L 133
A1Z6A T5Z1R 137
A1Z6A T6Y1L 7
A1Z6B A1Z2A 119
A1Z6B A1Z4A 40
A1Z6B A1Z6A 405
A1Z6B B10Z1R 627
A1Z6B B13Z1L 676
A1Z6B B15Y1R 914
A1Z6B B15Y1R 179
A1Z6B B15Y2R 613
A1Z6B B15Y2R 122
A1Z6B B16Z1L 5
A1Z6B B17Z1R 667
A1Z6B B1Z1R 876
A1Z6B B4Z1L 372
A1Z6B B4Z2L 201
A1Z6B B7Y1R 49
A1Z6B N16Z1L 133
A1Z6B N2Y1R 200
A1Z6B N3Y1L 200
A1Z6B T11Z1R 676
A1Z6B T12Z1L 532
A1Z6B T14Y1L 992
A1Z6B T14Y1L 288
A1Z6B T14Y2L 567
A1Z6B T14Y2L 109
A1Z6B T16Z1L 322
A1Z6B T2Y1L 407
A1Z6B T5Z1R 372
A1Z6B T6Y1L 49

Code:


CREATE VIEW [dbo].[vwAtomicOrbitalsAllowed]
AS

SELECT TOP 100 PERCENT

     Min([AtomicNumberSrc]) AS MinAtomicNumberSrc
 ,Max([AtomicNumberSrc]) AS MaxAtomicNumberSrc
 ,Min([AtomicNumberDest]) AS MinAtomicNumberDest
 ,Max([AtomicNumberDest]) AS MaxAtomicNumberDest
 ,[LTAMKeySrc]
 ,[LTAMKeyDest]
 ,[SlotDirectionElectronBond]
 ,[IsValid]
 ,[CanBindSrc]
 ,[CanBindDest]
 ,[AlphaTypeSrc]
 ,[AlphaTypeDest]
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
WHERE IsValid = 1
 AND CanBindSrc = 1
 AND CanBindDest = 1
GROUP BY [LTAMKeySrc]
 ,[LTAMKeyDest]
 ,[SlotDirectionElectronBond]
 ,[IsValid]
 ,[CanBindSrc]
 ,[CanBindDest]
 ,[AlphaTypeSrc]
 ,[AlphaTypeDest]
ORDER BY [LTAMKeySrc]
 ,[LTAMKeyDest]
 ,1
 ,2
 ,3
 ,4




SELECT *
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
WHERE CanBindSrc = 1 and CanBindDest=1 and IsValid =1 -- sets valid combinations for now

This query can show the distribution across slots:


Longer Formulas are usually Superconductors. Formulas collected from Chemspider tend to be shorter and well known-published. Hydrocarbons are excluded for now:

FormulaDistinctCount - 4678
CurrentAtomCount - 76
NextAtom1Count - 81
NextAtom2Count - 67
NextAtom3Count - 54
NextAtom4Count - 30
NextAtom5Count - 13
NextAtom6Count - 9
Code:
 SELECT  Count(Distinct Formula) as FormulaCount,
          Count(Distinct CurrentAtom) as CurrentAtomCount
         ,Count(Distinct NextAtom1) as NextAtom1Count
       ,Count(Distinct NextAtom2) as NextAtom2Count
   ,Count(Distinct NextAtom3) as NextAtom3Count
 ,Count(Distinct NextAtom4) as NextAtom4Count
 ,Count(Distinct NextAtom5) as NextAtom5Count
 ,Count(Distinct NextAtom6) as NextAtom6Count
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]

I did add the SuperConductors which can often fill up the 7 slot-bonding positions.  Using this adjustment below:



ALTER PROCEDURE [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]

AS

BEGIN
PRINT 'dbo.AtomicMilesMathisOrbitalParsed'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisOrbitalParsed;
END

BEGIN
SELECT TOP 100 PERCENT
Z.ID
,Z.Molecule AS ZMolecule
,
--Z.SeqNo as ZSeqNo,
Z.Item AS ZItem
,
--Z.Element as ZElement,
Z.[Formula] AS ZFormula
,Cast(CASE
WHEN Z.Number = ''
THEN 1
ELSE Z.Number
END AS INT) AS ZElementNum
,AtomicNumber
,AtomicSymbol
,AtomicWeight
,PT.Element
,OrbitalGroup
,PositiveIon
,NegativeIon
,Protons
,Electrons
,Neutrons
,PercDiff1stIonization
,Ions
,GroupNumber
,OldGroupNumber
,[Period]
,[1s]
,[2s]
,[2p]
,[3s]
,[3p]
,[3d]
,[4s]
,[4p]
,[4d]
,[4f]
,[5s]
,[5p]
,[5d]
,[5f]
,[5g]
,[6s]
,[6p]
,[6d]
,[6f]
,[7s]
,[7p]
,[7d]
,[8s]
,[8p]
,[9s]
,[9p]
,ID as ZID
INTO dbo.AtomicMilesMathisOrbitalParsed

FROM (
SELECT X.ID
,X.Molecule
,S.*
,dbo.UDF_ParseAlphaChars(S.Item) AS Element
,dbo.UDF_ParseNumeric(S.Item) AS Number
,[Formula]
FROM (
--SELECT [ID]
-- ,Molecule
-- ,dbo.[UDF_ParseAlphaCharsChem]([Formula]) AS Form
-- ,[Formula]
----  REPLACE([Formula],PATINDEX('%[^A-Z]%'),'|')
--FROM [Physics].[dbo].[Species]
--WHERE [Formula] NOT LIKE '%(%)%'
-- AND Formula NOT LIKE 'C%H%'
SELECT distinct Chemspiderid as [ID] ,
Molecule,
dbo.[UDF_ParseAlphaCharsChem]([Formula]) AS Form,
Formula
FROM
(
SELECT *  
FROM Physics.dbo.vwChemSpider
UNION
SELECT  [ID]  as ID,
Molecule,
[Molecule] +' | ' + Formula + ' | Detail' as Formula
FROM [Physics].[dbo].[Species]
where Detail like 'Super%'
and Molecule  --remove munged entries
   not
      in (
'AuTe2Se4/3',
'CdSMgos',
'LnFeAsOF',
'Sn10ShTe9Ba2MnCu21042',
'Sn3Ba4Im3Cu6O2',
'Sn5SbSBa2MnCM',
'Y2Ba1IJCu12O25'
)
    ) ZZ
) X

CROSS APPLY dbo.uftSplitString(X.Form, '|') S
WHERE S.Item <> ' '
) Z
LEFT JOIN dbo.vwPeriodicTable PT ON Replace(ReplacE(Replace(Replace([dbo].[fnRemoveNumericCharacter](TRIM(Z.Item)), '-', ''), '+', ''), '[', ''), ']', '')
--Case when (SUBSTRING(RTRIM(Z.Element),2,1) = 'n' and (Z.Item Not like '%Zn%' or Z.Item Not like '%Sn%' or Z.Item not like '%Mn%' ))
--then ReplacE(ReplacE(Replace(Replace(SUBSTRING(RTRIM(Z.Element),1,1),'-',''),'+',''),'[',''),']','')
--Else  ReplacE(ReplacE(Replace(Replace(RTRIM(Z.Element),'-',''),'+',''),'[',''),']','') END
= TRIM(PT.AtomicSymbol)
WHERE Z.ID > 0
AND Cast(CASE
WHEN Z.Number = ''
THEN 1
ELSE Z.Number
END AS INT) < 100
ORDER BY ID
,SeqNo

END

I can probably pivot the atom counts H2 = HH at some point or just show the counts per atom for a formula in new columns. Essentially it is getting a good dataframe of bonds-slots that can answer 80/20 per Miles for now.

At the end of the day, I wanted to make this a tool that can allow some kids to look at "Old bonding" and Mathis' Bonding. Some IT tools-algos like DataRobot or Ensembles in R/Python can probably assist in finding matches valid per AI algos. Sadly, a lot of algos look at metric features instead of "height with shadow on day X, Lat./Long. over years 50,000. Stuff can easily become a quick mess if good solid bases are not established clear and early. The full essence of Miles' insights I hold true.

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sat Jul 08, 2023 4:05 am

Hey LTAM,

Was doing some validation of what is dropping out with the queries in terms of Formulas. Looks like a lot of Na where dropping out. Miles has a single alpha to single alpha for NaCl (salt). It showed up on my "drop-outs".  I started looking at slot 15 for Na and it didn't have a proton as 1 and the key started with 'N'.  I updated it from 0 to 1 with the following query and didn't filter on the 'N' key. It came in but these may need another look with your tools.  Don't want to throw too much at you with this. Essentially, the following don't "bond" per Miles and some might need a second look in terms of alignments-Protons-Slot numbers-LTAM type key. Granted anything with a slot number under Carbon could be problem due to geometry.

Here's the new script for the main build proc...takes 20-40 minutes to run it.

Code:
USE [Physics]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE OR ALTER PROCEDURE [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]

AS

BEGIN
PRINT 'dbo.AtomicMilesMathisOrbitalParsed'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisOrbitalParsed;
END

BEGIN
SELECT TOP 100 PERCENT
 Z.ID
 ,Z.Molecule AS ZMolecule
 ,
 --Z.SeqNo as ZSeqNo,
 Z.Item AS ZItem
 ,
 --Z.Element as ZElement,
 Z.[Formula] AS ZFormula
 ,Cast(CASE
 WHEN Z.Number = ''
 THEN 1
 ELSE Z.Number
 END AS INT) AS ZElementNum
 ,AtomicNumber
 ,AtomicSymbol
 ,AtomicWeight
 ,PT.Element
 ,OrbitalGroup
 ,PositiveIon
 ,NegativeIon
 ,Protons
 ,Electrons
 ,Neutrons
 ,PercDiff1stIonization
 ,Ions
 ,GroupNumber
 ,OldGroupNumber
 ,[Period]
 ,[1s]
 ,[2s]
 ,[2p]
 ,[3s]
 ,[3p]
 ,[3d]
 ,[4s]
 ,[4p]
 ,[4d]
 ,[4f]
 ,[5s]
 ,[5p]
 ,[5d]
 ,[5f]
 ,[5g]
 ,[6s]
 ,[6p]
 ,[6d]
 ,[6f]
 ,[7s]
 ,[7p]
 ,[7d]
 ,[8s]
 ,[8p]
 ,[9s]
 ,[9p]
 ,ID as ZID
INTO dbo.AtomicMilesMathisOrbitalParsed

FROM (
 SELECT X.ID
 ,X.Molecule
 ,S.*
 ,dbo.UDF_ParseAlphaChars(S.Item) AS Element
 ,dbo.UDF_ParseNumeric(S.Item) AS Number
 ,[Formula]
 FROM (
 --SELECT [ID]
 -- ,Molecule
 -- ,dbo.[UDF_ParseAlphaCharsChem]([Formula]) AS Form
 -- ,[Formula]
 ----  REPLACE([Formula],PATINDEX('%[^A-Z]%'),'|')
 --FROM [Physics].[dbo].[Species]
 --WHERE [Formula] NOT LIKE '%(%)%'
 -- AND Formula NOT LIKE 'C%H%'
 SELECT distinct Chemspiderid as [ID] ,
 Molecule,
 dbo.[UDF_ParseAlphaCharsChem]([Formula]) AS Form,
 Formula
 FROM
 (
 SELECT *  
 FROM Physics.dbo.vwChemSpider
 UNION
 SELECT  [ID] +.01 as ID,
 Molecule,
 [Molecule] +' | ' + Formula + ' | Detail' as Formula
 FROM [Physics].[dbo].[Species]
 where Detail like 'Super%'
 --and Molecule
 --       --not
 --       in (
 -- 'AuTe2Se4/3',
 -- 'CdSMgos',
 -- 'LnFeAsOF',
 -- 'Sn10ShTe9Ba2MnCu21042',
 -- 'Sn3Ba4Im3Cu6O2',
 -- 'Sn5SbSBa2MnCM',
 -- 'Y2Ba1IJCu12O25'
 -- )
     ) ZZ
 ) X
 CROSS APPLY dbo.uftSplitString(X.Form, '|') S
 WHERE S.Item <> ' '
 ) Z
LEFT JOIN dbo.vwPeriodicTable PT ON Replace(ReplacE(Replace(Replace([dbo].[fnRemoveNumericCharacter](TRIM(Z.Item)), '-', ''), '+', ''), '[', ''), ']', '')
 --Case when (SUBSTRING(RTRIM(Z.Element),2,1) = 'n' and (Z.Item Not like '%Zn%' or Z.Item Not like '%Sn%' or Z.Item not like '%Mn%' ))
 --then ReplacE(ReplacE(Replace(Replace(SUBSTRING(RTRIM(Z.Element),1,1),'-',''),'+',''),'[',''),']','')
 --Else  ReplacE(ReplacE(Replace(Replace(RTRIM(Z.Element),'-',''),'+',''),'[',''),']','') END
 = TRIM(PT.AtomicSymbol)
WHERE Z.ID > 0
 AND Cast(CASE
 WHEN Z.Number = ''
 THEN 1
 ELSE Z.Number
 END AS INT) < 100
ORDER BY ID
 ,SeqNo

END


BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-20230224] ON [dbo].[AtomicMilesMathisOrbitalParsed] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END


BEGIN
PRINT 'dbo.AtomicMilesMathisOrbitalBondsParsed'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisOrbitalBondsParsed
END

BEGIN

 SELECT DISTINCT   TOP 100 PERCENT
 *
 INTO dbo.AtomicMilesMathisOrbitalBondsParsed
 FROM
 (
    SELECT
    ROW_NUMBER() OVER (PARTITION BY ZID order by Zitem) as ZMoleculeOrder,
    AtomicSymbol as CurrentAtom,
    LEAD(AtomicSymbol, 1,NULL) OVER (partition by ZID order by Zitem) as NextAtom1,
    LEAD(AtomicSymbol, 2,NULL) OVER (partition by ZID order by Zitem) as NextAtom2,
    LEAD(AtomicSymbol, 3,NULL) OVER (partition by ZID order by Zitem) as NextAtom3,
    LEAD(AtomicSymbol, 4,NULL) OVER (partition by ZID order by Zitem) as NextAtom4,
    LEAD(AtomicSymbol, 5,NULL) OVER (partition by ZID order by Zitem) as NextAtom5,
    LEAD(AtomicSymbol, 6,NULL) OVER (partition by ZID order by Zitem) as NextAtom6,
    LEAD(AtomicSymbol, 7,NULL) OVER (partition by ZID order by Zitem) as NextAtom7,
    LEAD(AtomicSymbol, 8,NULL) OVER (partition by ZID order by Zitem) as NextAtom8,
    LEAD(AtomicSymbol, 9,NULL) OVER (partition by ZID order by Zitem) as NextAtom9,
    LEAD(AtomicSymbol, 10,NULL) OVER (partition by ZID order by Zitem) as NextAtom10,
    LEAD(AtomicSymbol, 11,NULL) OVER (partition by ZID order by Zitem) as NextAtom11,
    LEAD(AtomicSymbol, 12,NULL) OVER (partition by ZID order by Zitem) as NextAtom12,
    LEAD(AtomicSymbol, 13,NULL) OVER (partition by ZID order by Zitem) as NextAtom13,
    LEAD(AtomicSymbol, 14,NULL) OVER (partition by ZID order by Zitem) as NextAtom14,
    LEAD(AtomicSymbol, 15,NULL) OVER (partition by ZID order by Zitem) as NextAtom15,
    A.*
  --FROM [Physics].[dbo].[vwAtomicOrbitalPerm] A
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalParsed] A
  where ZFormula not like 'C%H%'
 ) X
 where X.ZMoleculeOrder = 1 and AtomicSymbol is NOT NULL
ORDER BY X.ZFormula
END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-20230224-Bonds] ON [dbo].[AtomicMilesMathisOrbitalBondsParsed] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END

BEGIN
PRINT 'dbo.AtomicMilesMathisElementsPositions'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisElementsPositions
END

BEGIN
--CREATE VIEW [dbo].[vwElementsPositions]

--AS

SELECT TOP 100 PERCENT
       [AtomicNumber]
      ,[AtomicSymbol]
      ,[Element]
      ,[AtomicTuple]
      ,[OrbitalGroup]
      ,[AtomicType]
      ,[GroupNumber]
      ,[Period]
      ,[SlotNumber]
      ,[Protons]
      ,[PX]
      ,[PY]
      ,[PZ]
      ,[P2P3]
      ,[P12]
      ,[PE]
      ,[p1x]
      ,[p1y]
      ,[p1z]
      ,[p2x]
      ,[p2y]
      ,[p2z]
      ,[p3x]
      ,[p3y]
      ,[p3z]
      ,[p4x]
      ,[p4y]
      ,[p4z]
      ,[p5x]
      ,[p5y]
      ,[p5z]
      ,[p6x]
      ,[p6y]
      ,[p6z]
      ,[Neutrons]
      ,[N1N2]
      ,[N1]
      ,[N2]
      ,[N3]
      ,[N4]
      ,[N5]
      ,[N6]
      ,[n1x]
      ,[n1y]
      ,[n1z]
      ,[n2x]
      ,[n2y]
      ,[n2z]
      ,[n3x]
      ,[n3y]
      ,[n3z]
      ,[n4x]
      ,[n4y]
      ,[n4z]
      ,[n5x]
      ,[n5y]
      ,[n5z]
      ,[n6x]
      ,[n6y]
      ,[n6z]
      ,[Electrons]
      ,[e1x]
      ,[e1y]
      ,[e1z]
      ,[e2x]
      ,[e2y]
      ,[e2z]
      ,[e3x]
      ,[e3y]
      ,[e3z]
      ,[e4x]
      ,[e4y]
      ,[e4z]
      ,[e5x]
      ,[e5y]
      ,[e5z]
      ,[e6x]
      ,[e6y]
      ,[e6z]
      ,[SlotOrien]
      ,[SlotSpin]
      ,[CanBind]
      ,[SlotLayout]
      ,[SL1]
      ,[SL2]
      ,[SL3]
      ,[SL4]
  ,TRIM(Electrons) + Cast([SlotNumber] as varchar(2)) + SlotOrien + cast(protons as varchar(2))+SlotSpin as LTAMKey
  ,TRIM(Electrons) +SlotSpin as BindKey
  INTO dbo.AtomicMilesMathisElementsPositions
  FROM [Physics].[dbo].[ElementsPositions]
  Order by AtomicNumber, SlotNumber

END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-20230224-Positions] ON [dbo].[AtomicMilesMathisElementsPositions] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END


BEGIN
PRINT 'dbo.AtomicMilesMathisPeriodicTable'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisPeriodicTable
END

BEGIN

SELECT  [UID]
      ,[AtomicNumber]
      ,[AtomicSymbol]
      ,[Element]
      ,[OrbitalGroup]
      ,[Protons]
      ,[Neutrons]
      ,[GroupNumber]
      ,[Period]
      ,[SlotNumber]
      ,[SlotOrder]
      ,[AlphaType]
  ,Row_Number() over (PARTITION BY AtomicSymbol order by AtomicNumber, SlotNumber) as ElementUniqueState
  ,ColorR = Case [AlphaType]   when 0 then '240'
               when 1 then '87'
               when 2 then '30'
               when 3 then '255'
               when 4 then '111'
               when 5 then '173'
               when 6 then '135'
               END
  ,ColorG = Case [AlphaType]   when 0 then '255'
               when 1 then '87'
               when 2 then '144'
               when 3 then '192'
               when 4 then '66'
               when 5 then '255'
               when 6 then '206'
               END
  ,ColorB = Case [AlphaType]   when 0 then '255'
               when 1 then '87'
               when 2 then '255'
               when 3 then '203'
               when 4 then '66'
               when 5 then '47'
               when 6 then '235'
               END
     ,Color = Case [AlphaType] when 0 then '240;255;255'
                 when 1 then '87;87;87'
                 when 2 then '30;144;255'
                 when 3 then '255;192;203'
                 when 4 then '111;66;66'
                 when 5 then '173;255;47'
                 when 6 then '135;206;235'
                 END

INTO dbo.AtomicMilesMathisPeriodicTable

  FROM [Physics].[dbo].[MilesMathisPeriodicTable]
END

BEGIN
PRINT 'dbo.AtomicMilesMathisPeriodicTableBase'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisPeriodicTableBase
END

BEGIN

SELECT
 --CASE when AlphaTypeRemainder > 6 then AlphaTypeRemainder -6 Else
 -- Case when AlphaTypeRemainder <1 then 0 Else AlphaTypeRemainder/ Case when (MathisCarouselAlphaTypeFull-2) < 1 then 1 ELSE  (MathisCarouselAlphaTypeFull-2) END END
 ---- End
 --as SingleRemainders,
 -- (Case when AlphaTypeRemainder <1 then 0 Else AlphaTypeRemainder/ Case when (MathisCarouselAlphaTypeFull-2) < 1 then MathisCarouselAlphaTypeFull ELSE  (MathisCarouselAlphaTypeFull-2) END END )
 ---- End
 --as RemaindersFilled,
 AlphaTypeRemainder AS RemainderAlphaLevel1
 ,AlphaTypeRemainder % 2 AS Rem2
 ,AlphaTypeRemainder % 3 AS Rem3
 ,AlphaTypeRemainder % 4 AS Rem4
 ,*
INTO dbo.AtomicMilesMathisPeriodicTableBase
FROM (
 SELECT CASE
 WHEN AtomicNumber < 5
 THEN 0
 ELSE CASE
 WHEN AtomicNumber BETWEEN 5
 AND 8
 THEN AtomicNumber - 5
 ELSE AtomicNumber % (MathisCarouselAlphaTypeFull * 9)
 END
 END AS AlphaTypeRemainder
 ,*
 FROM (
 SELECT CASE
 WHEN O.AtomicNumber < 5
 THEN 1
 ELSE CASE
 WHEN O.AtomicNumber / 9 = 2
 THEN 2
 ELSE CASE
 WHEN O.AtomicNumber / 9 = 4
 THEN 4
 ELSE CASE
 WHEN O.AtomicNumber / 9 = 6
 THEN 6
 ELSE CASE O.OrbitalGroup
 WHEN '[Ne]'
 THEN 1
 WHEN '[Ar]'
 THEN 2
 WHEN '[Kr]'
 THEN 4
 WHEN '[Xe]'
 THEN 6
 ELSE CASE
 WHEN O.AtomicNumber > 10
 THEN 6
 ELSE 1
 END
 END
 END
 END
 END
 END AS MathisCarouselAlphaTypeFull
 ,O.AtomicNumber
 ,O.AtomicSymbol
 ,O.Element
 ,O.OrbitalGroup
 ,LEFT(CASE
 WHEN (
 CHARINDEX('±', [Ions]) > 0
 OR CHARINDEX('+', [Ions]) > 0
 )
 THEN dbo.UDF_ParseNumeric([Ions])
 ELSE 0
 END, 1) AS PositiveIon
 ,LEFT(CASE
 WHEN (
 CHARINDEX('±', [Ions]) > 0
 OR CHARINDEX('-', [Ions]) > 0
 )
 THEN dbo.UDF_ParseNumeric([Ions])
 ELSE 0
 END, 1) AS NegativeIon
 ,Z.Protons
 ,Z.Electrons
 ,Z.Neutrons
 ,Z.PercDiff1stIonization
 ,Z.Ions
 ,Z.GroupNumber
 ,Z.OldGroupNumber
 ,Z.[Period]
 ,Z.AtomicMassRounded
 ,Z.[atomic mass (IUPAC 2005)]
 ,Z.[Melting Point Celsius]
 ,Z.[Boiling Point Celsius]
 ,Z.[State at Room Temp#]
 ,Z.[density g/mL]
 ,Z.[electronegativity (Pauling)]
 ,Z.[1st ionization potential (eV) ]
 ,Z.[2nd ionization potential (eV) ]
 ,Z.[3rd ionization potential (eV) ]
 ,Z.[1st ionization potential (kJ/mol) ]
 ,Z.[2nd ionization potential (kJ/mol) ]
 ,Z.[3rd ionization potential (kJ/mol) ]
 ,Z.[Electron Affinity (eV)]
 ,Z.[Electron Affinity (kJ/mol)]
 ,Z.[common oxidation states]
 ,Z.[ions commonly formed]
 ,Z.[Predicted Electron Configuration]
 ,Z.[Observed Electron Configuration]
 ,Z.[atomic radius (Å) ]
 ,Z.[ionic radius (Å) ]
 ,Z.[covalent radius (Å) ]
 ,Z.[radius_(2- ion)_(pm)]
 ,Z.[radius_(1- ion)_(pm)]
 ,Z.[atomic radius_(pm)]
 ,Z.[radius_(1+ ion)_(pm)]
 ,Z.[radius_(2+ ion)_(pm)]
 ,Z.[radius_(3+ ion)_(pm)]
 ,Z.[atomic volume (cm^3/mol) ]
 ,Z.[crystal structure]
 ,Z.[CAS Registry No#]
 ,Z.[electrical conductivity (mho/cm) ]
 ,Z.[specific heat (J/g K) ]
 ,Z.[heat of fusion (kJ/mol) ]
 ,Z.[heat of vaporization (kJ/mol) ]
 ,Z.[thermal conductivity (W/(m K)) ]
 ,Z.[mg/kg in Earth's crust]
 ,Z.[mg/L in seawater]
 ,Z.[% human body mass]
 ,Z.Notes
 ,Z.[source]
 ,Z.color
 ,Z.characteristics
 ,Z.structure
 ,Z.[hardness_(mohs)]
 ,Z.uses
 ,Z.[reaction with air]
 ,Z.[reaction with water]
 ,Z.[reaction with 6M HCl]
 ,Z.[reaction with 15M HNO3]
 ,Z.[reaction with 6M NaOH]
 ,Z.[hydride(s)]
 ,Z.[oxide(s)]
 ,Z.[chloride(s)]
 ,Z.[polarizability_(A^3)]
 ,Z.[heat atomization_(kJ/mol)]
 ,Z.[year discovered]
 ,Z.[rel# abund# solar system_(log)]
 ,Z.[abundance earth's crust_(log)]
 ,Z.[cost, pure_($/100g)]
 ,Z.[cost, bulk_($/100g)]
 ,Z.[toxic?]
 ,Z.[carcinogenic?]
 ,Z.PeriodicTableID
 ,Z.[Name]
 ,Z.Expr1
 ,Z.Symbol
 ,Z.[BP(K)]
 ,Z.[MP(K)]
 ,Z.Density
 ,Z.AtomicWeight
 ,Z.MostStableOxidationState
 ,Z.CovalentRadius
 ,Z.AtomicNumberRadiusAngstroms
 ,Z.FirstIP
 ,Z.SpecificHeatCapacity
 ,Z.ThermalConductivity
 ,Z.ElectricalConductivity
 ,Z.HeatOfFusion
 ,Z.HeatOfVaporization
 ,Z.ElectroNegativity
 ,Z.YearsSinceDiscovery
 ,Z.Family
 ,Z.[Group]
 ,Z.orbital
 ,Z.MetalOrNonMetal
 ,Z.[2ndmoststableoxidationstate]
 ,Z.[3rdmoststableoxidationstate]
 ,Z.[4thmoststableoxidationstate]
 ,Z.[mg/kg crust]
 ,Z.[mg/L seawater]
 ,Z.Expr2
 ,Z.[length of name]
 ,Z.Series
 ,Z.StateofMatter
 ,Z.[Atomic Radius (A)]
 ,Z.[Boiling point (oC)]
 ,Z.[Melting/Freezing Point (oC)]
 ,Z.[Density (g/mL)]
 ,Z.PeriodNumber
 ,Z.PeriodTypeDescription
 ,Z.LithosphereAbundance
 ,Z.RelativeProportion_ppm
 ,Z.CrustalAbundance1_ppm
 ,Z.CrustalAbundance2_ppm
 ,Z.CrustalAbundance3_ppm
 ,Z.ProductionTonnes
 ,O.[1s]
 ,O.[2s]
 ,O.[2p]
 ,O.[3s]
 ,O.[3p]
 ,O.[3d]
 ,O.[4s]
 ,O.[4p]
 ,O.[4d]
 ,O.[4f]
 ,O.[5s]
 ,O.[5p]
 ,O.[5d]
 ,O.[5f]
 ,O.[5g]
 ,O.[6s]
 ,O.[6p]
 ,O.[6d]
 ,O.[6f]
 ,O.[7s]
 ,O.[7p]
 ,O.[7d]
 ,O.[8s]
 ,O.[8p]
 ,O.[9s]
 ,O.[9p]
 FROM dbo.OrbitalMatrix AS O
 LEFT OUTER JOIN (
 SELECT PeriodicTable.AtomicNumber
 ,PeriodicTable.English_elementname AS Element
 ,PeriodicTable.AtomicNumber AS Protons
 ,PeriodicTable.AtomicNumber AS Electrons
 ,ROUND(PeriodicTable.AtomicMassRounded, 0) - PeriodicTable.AtomicNumber AS Neutrons
 ,RTRIM(PeriodicTable.AtomicSymbol) AS AtomicSymbol
 ,PeriodicTable.PercDiff1stIonization
 ,COALESCE(PeriodicTable.[ions commonly formed], '0') AS Ions
 ,PeriodicTable.GroupNumber
 ,PeriodicTable.OldGroupNumber
 ,PeriodicTable.Period
 ,PeriodicTable.AtomicMassRounded
 ,PeriodicTable.[atomic mass (IUPAC 2005)]
 ,PeriodicTable.[Melting Point Celsius]
 ,PeriodicTable.[Boiling Point Celsius]
 ,PeriodicTable.[State at Room Temp#]
 ,PeriodicTable.[density g/mL]
 ,PeriodicTable.[electronegativity (Pauling)]
 ,PeriodicTable.[1st ionization potential (eV) ]
 ,PeriodicTable.[2nd ionization potential (eV) ]
 ,PeriodicTable.[3rd ionization potential (eV) ]
 ,PeriodicTable.[1st ionization potential (kJ/mol) ]
 ,PeriodicTable.[2nd ionization potential (kJ/mol) ]
 ,PeriodicTable.[3rd ionization potential (kJ/mol) ]
 ,PeriodicTable.[Electron Affinity (eV)]
 ,PeriodicTable.[Electron Affinity (kJ/mol)]
 ,PeriodicTable.[common oxidation states]
 ,PeriodicTable.[ions commonly formed]
 ,PeriodicTable.[Predicted Electron Configuration]
 ,PeriodicTable.[Observed Electron Configuration]
 ,PeriodicTable.[atomic radius (Å) ]
 ,PeriodicTable.[ionic radius (Å) ]
 ,PeriodicTable.[covalent radius (Å) ]
 ,PeriodicTable.[radius_(2- ion)_(pm)]
 ,PeriodicTable.[radius_(1- ion)_(pm)]
 ,PeriodicTable.[atomic radius_(pm)]
 ,PeriodicTable.[radius_(1+ ion)_(pm)]
 ,PeriodicTable.[radius_(2+ ion)_(pm)]
 ,PeriodicTable.[radius_(3+ ion)_(pm)]
 ,PeriodicTable.[atomic volume (cm^3/mol) ]
 ,PeriodicTable.[crystal structure]
 ,PeriodicTable.[CAS Registry No#]
 ,PeriodicTable.[electrical conductivity (mho/cm) ]
 ,PeriodicTable.[specific heat (J/g K) ]
 ,PeriodicTable.[heat of fusion (kJ/mol) ]
 ,PeriodicTable.[heat of vaporization (kJ/mol) ]
 ,PeriodicTable.[thermal conductivity (W/(m K)) ]
 ,PeriodicTable.[mg/kg in Earth's crust]
 ,PeriodicTable.[mg/L in seawater]
 ,PeriodicTable.[% human body mass]
 ,PeriodicTable.Notes
 ,PeriodicTable.[source]
 ,PeriodicTable.color
 ,PeriodicTable.characteristics
 ,PeriodicTable.structure
 ,PeriodicTable.[hardness_(mohs)]
 ,PeriodicTable.uses
 ,PeriodicTable.[reaction with air]
 ,PeriodicTable.[reaction with water]
 ,PeriodicTable.[reaction with 6M HCl]
 ,PeriodicTable.[reaction with 15M HNO3]
 ,PeriodicTable.[reaction with 6M NaOH]
 ,PeriodicTable.[hydride(s)]
 ,PeriodicTable.[oxide(s)]
 ,PeriodicTable.[chloride(s)]
 ,PeriodicTable.[polarizability_(A^3)]
 ,PeriodicTable.[heat atomization_(kJ/mol)]
 ,PeriodicTable.[year discovered]
 ,PeriodicTable.[rel# abund# solar system_(log)]
 ,PeriodicTable.[abundance earth's crust_(log)]
 ,PeriodicTable.[cost, pure_($/100g)]
 ,PeriodicTable.[cost, bulk_($/100g)]
 ,PeriodicTable.[toxic?]
 ,PeriodicTable.[carcinogenic?]
 ,PeriodicTableGrouping.PeriodicTableID
 ,PeriodicTableGrouping.Name
 ,PeriodicTableGrouping.AtomicNumber AS Expr1
 ,PeriodicTableGrouping.Symbol
 ,PeriodicTableGrouping.[BP(K)]
 ,PeriodicTableGrouping.[MP(K)]
 ,PeriodicTableGrouping.Density
 ,PeriodicTableGrouping.AtomicWeight
 ,PeriodicTableGrouping.MostStableOxidationState
 ,PeriodicTableGrouping.CovalentRadius
 ,PeriodicTableGrouping.AtomicNumberRadiusAngstroms
 ,PeriodicTableGrouping.FirstIP
 ,PeriodicTableGrouping.SpecificHeatCapacity
 ,PeriodicTableGrouping.ThermalConductivity
 ,PeriodicTableGrouping.ElectricalConductivity
 ,PeriodicTableGrouping.HeatOfFusion
 ,PeriodicTableGrouping.HeatOfVaporization
 ,PeriodicTableGrouping.ElectroNegativity
 ,PeriodicTableGrouping.YearsSinceDiscovery
 ,PeriodicTableGrouping.Family
 ,PeriodicTableGrouping.[Group]
 ,PeriodicTableGrouping.orbital
 ,PeriodicTableGrouping.MetalOrNonMetal
 ,PeriodicTableGrouping.[2ndmoststableoxidationstate]
 ,PeriodicTableGrouping.[3rdmoststableoxidationstate]
 ,PeriodicTableGrouping.[4thmoststableoxidationstate]
 ,PeriodicTableGrouping.[mg/kg crust]
 ,PeriodicTableGrouping.[mg/L seawater]
 ,PeriodicTableGrouping.[% human body mass] AS Expr2
 ,PeriodicTableGrouping.[length of name]
 ,PeriodicTableState.Series
 ,PeriodicTableState.StateofMatter
 ,PeriodicTableState.[Atomic Radius (A)]
 ,PeriodicTableState.[Boiling point (oC)]
 ,PeriodicTableState.[Melting/Freezing Point (oC)]
 ,PeriodicTableState.[Density (g/mL)]
 ,PeriodicTableState.Period AS PeriodNumber
 ,PeriodType.PeriodTypeDescription
 ,ElementAbundance.LithosphereAbundance
 ,ElementAbundance.RelativeProportion_ppm
 ,ElementAbundance.CrustalAbundance1_ppm
 ,ElementAbundance.CrustalAbundance2_ppm
 ,ElementAbundance.CrustalAbundance3_ppm
 ,ElementAbundance.ProductionTonnes
 FROM dbo.PeriodicTableGrouping
 LEFT OUTER JOIN dbo.ElementAbundance ON PeriodicTableGrouping.AtomicNumber = ElementAbundance.Z
 RIGHT OUTER JOIN (
 SELECT COALESCE((CAST([1st ionization potential (kJ/mol) ] AS MONEY) - CAST(NextElement1stIonizationPotential AS MONEY)) / CAST([1st ionization potential (kJ/mol) ] AS MONEY), 0) AS PercDiff1stIonization
 ,PID
 ,AtomicNumber
 ,AtomicSymbol
 ,GroupNumber
 ,OldGroupNumber
 ,Period
 ,English_elementname
 --,German_elementname
 --,French_elementname
 --,Spanish_elementname
 --,Italian_elementname
 ,AtomicMassRounded
 ,[atomic mass (IUPAC 2005)]
 ,[Melting Point Celsius]
 ,[Boiling Point Celsius]
 ,[State at Room Temp#]
 ,[density g/mL]
 ,[electronegativity (Pauling)]
 ,[1st ionization potential (eV) ]
 ,[2nd ionization potential (eV) ]
 ,[3rd ionization potential (eV) ]
 ,[1st ionization potential (kJ/mol) ]
 ,[2nd ionization potential (kJ/mol) ]
 ,[3rd ionization potential (kJ/mol) ]
 ,NextElement1stIonizationPotential
 ,[Electron Affinity (eV)]
 ,[Electron Affinity (kJ/mol)]
 ,[common oxidation states]
 ,[ions commonly formed]
 ,[Predicted Electron Configuration]
 ,[Observed Electron Configuration]
 ,[atomic radius (Å) ]
 ,[ionic radius (Å) ]
 ,[covalent radius (Å) ]
 ,[radius_(2- ion)_(pm)]
 ,[radius_(1- ion)_(pm)]
 ,[atomic radius_(pm)]
 ,[radius_(1+ ion)_(pm)]
 ,[radius_(2+ ion)_(pm)]
 ,[radius_(3+ ion)_(pm)]
 ,[atomic volume (cm^3/mol) ]
 ,[crystal structure]
 ,[CAS Registry No#]
 ,[electrical conductivity (mho/cm) ]
 ,[specific heat (J/g K) ]
 ,[heat of fusion (kJ/mol) ]
 ,[heat of vaporization (kJ/mol) ]
 ,[thermal conductivity (W/(m K)) ]
 ,[mg/kg in Earth's crust]
 ,[mg/L in seawater]
 ,[% human body mass]
 ,Notes
 ,[source]
 ,color
 ,characteristics
 ,structure
 ,[hardness_(mohs)]
 ,uses
 ,[reaction with air]
 ,[reaction with water]
 ,[reaction with 6M HCl]
 ,[reaction with 15M HNO3]
 ,[reaction with 6M NaOH]
 ,[hydride(s)]
 ,[oxide(s)]
 ,[chloride(s)]
 ,[polarizability_(A^3)]
 ,[heat atomization_(kJ/mol)]
 ,[year discovered]
 ,[rel# abund# solar system_(log)]
 ,[abundance earth's crust_(log)]
 ,[cost, pure_($/100g)]
 ,[cost, bulk_($/100g)]
 ,[toxic?]
 ,[carcinogenic?]
 FROM (
 SELECT PID
 ,AtomicNumber
 ,AtomicSymbol
 ,GroupNumber
 ,OldGroupNumber
 ,[Period]
 ,English_elementname
 --,German_elementname
 --,French_elementname
 --,Spanish_elementname
 --,Italian_elementname
 ,AtomicMassRounded
 ,[atomic mass (IUPAC 2005)]
 ,[Melting Point Celsius]
 ,[Boiling Point Celsius]
 ,[State at Room Temp#]
 ,[density g/mL]
 ,[electronegativity (Pauling)]
 ,[1st ionization potential (eV) ]
 ,[2nd ionization potential (eV) ]
 ,[3rd ionization potential (eV) ]
 ,[1st ionization potential (kJ/mol) ]
 ,[2nd ionization potential (kJ/mol) ]
 ,[3rd ionization potential (kJ/mol) ]
 ,(
 SELECT TOP (1) [1st ionization potential (kJ/mol) ]
 FROM PeriodicTable AS B
 WHERE (A.PID = PID + 1)
 ) AS NextElement1stIonizationPotential
 ,[Electron Affinity (eV)]
 ,[Electron Affinity (kJ/mol)]
 ,[common oxidation states]
 ,[ions commonly formed]
 ,[Predicted Electron Configuration]
 ,[Observed Electron Configuration]
 ,[atomic radius (Å) ]
 ,[ionic radius (Å) ]
 ,[covalent radius (Å) ]
 ,[radius_(2- ion)_(pm)]
 ,[radius_(1- ion)_(pm)]
 ,[atomic radius_(pm)]
 ,[radius_(1+ ion)_(pm)]
 ,[radius_(2+ ion)_(pm)]
 ,[radius_(3+ ion)_(pm)]
 ,[atomic volume (cm^3/mol) ]
 ,[crystal structure]
 ,[CAS Registry No#]
 ,[electrical conductivity (mho/cm) ]
 ,[specific heat (J/g K) ]
 ,[heat of fusion (kJ/mol) ]
 ,[heat of vaporization (kJ/mol) ]
 ,[thermal conductivity (W/(m K)) ]
 ,[mg/kg in Earth's crust]
 ,[mg/L in seawater]
 ,[% human body mass]
 ,Notes
 ,[source]
 ,color
 ,characteristics
 ,structure
 ,[hardness_(mohs)]
 ,uses
 ,[reaction with air]
 ,[reaction with water]
 ,[reaction with 6M HCl]
 ,[reaction with 15M HNO3]
 ,[reaction with 6M NaOH]
 ,[hydride(s)]
 ,[oxide(s)]
 ,[chloride(s)]
 ,[polarizability_(A^3)]
 ,[heat atomization_(kJ/mol)]
 ,[year discovered]
 ,[rel# abund# solar system_(log)]
 ,[abundance earth's crust_(log)]
 ,[cost, pure_($/100g)]
 ,[cost, bulk_($/100g)]
 ,[toxic?]
 ,[carcinogenic?]
 FROM dbo.PeriodicTable AS A
 WHERE (PID > 0)
 ) AS X
 ) AS PeriodicTable ON PeriodicTableGrouping.AtomicNumber = PeriodicTable.AtomicNumber
 LEFT OUTER JOIN dbo.PeriodType ON PeriodicTableGrouping.[Group] = PeriodType.Period
 LEFT OUTER JOIN dbo.PeriodicTableState ON PeriodicTable.AtomicNumber = PeriodicTableState.AtomicNumber
 ) AS Z ON Z.AtomicNumber = O.AtomicNumber
 ) Alpha
 ) Remainder
END

BEGIN
PRINT 'dbo.AtomicMilesMathisProtonBalance'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisProtonBalance
END

BEGIN
--CREATE View [dbo].[vwProtonBalanceMathis]

SELECT
TOP 100 PERCENT *
INTO dbo.AtomicMilesMathisProtonBalance
FROM (
 SELECT Cast(Protons AS INT) % 5 AS Carousel
 ,CASE
 WHEN Cast(Protons AS INT) >= 10
 THEN Cast(Protons AS INT) - 10
 ELSE CASE
 WHEN Cast(Protons AS INT) >= 5
 THEN Cast(Protons AS INT) - 5
 ELSE 0
 END
 END AS AlphaProtonCarouselRemainder
 ,CASE
 WHEN Cast(Protons AS INT) % 2 = 0
 THEN Cast(Protons AS INT) / 2
 ELSE CASE
 WHEN Cast(Protons AS INT) >= 2
 THEN Cast(Protons AS INT) / 2
 ELSE 0
 END
 END AS Alphas
 ,Element
 ,AtomicSymbol
 ,Period
 ,AtomicNumber
 ,GroupNumber
 ,Protons
 ,[MathisCarouselAlphaTypeFull]
 ,RemainderAlphaLevel1
 ,AlphaTypeRemainder
 --,Cast(Protons as int) % 1 as ST1,
 --Cast(Protons as int) % 2 as ST2,
 --Cast(Protons as int) % 3 as ST3,
 --Cast(Protons as int) % 4 as ST4,
 --Cast(Protons as int) % 6 as ST6,
 --Cast(Protons as int) % 18 as FullCarousel2,
 --Cast(Protons as int) % 27 as FullCarousel3,
 --Cast(Protons as int) % 36 as FullCarousel4,
 --Cast(Protons as int) % 54 as FullCarousel6,
 --Car1H= CASE WHEN (CAST(Protons as int) )-1 < 0  then 0 ELSE 1 END ,
 --Car2V= CASE WHEN (CAST(Protons as int) )-2 < 0  then 0 ELSE 1 END ,
 --Car3V=CASE WHEN (CAST(Protons as int)  )-4  <= 0  then 0 ELSE 1 END ,
 --Car4V=CASE WHEN (CAST(Protons as int) )-6 <= 0  then 0 ELSE 1 END ,
 --Car5V=CASE WHEN (CAST(Protons as int))-8 <= 0  then 0 ELSE 1 END ,
 --Above1V=CASE WHEN (CAST(Protons as int) )-10 <= 0  then 0 ELSE 1 END ,
 --Below1V=CASE WHEN (CAST(Protons as int) )-12 <= 0  then 0 ELSE 1 END ,
 --Above2H=CASE WHEN (CAST(Protons as int) )-14 <= 0  then 0 ELSE 1 END ,
 --Below2H=CASE WHEN (CAST(Protons as int) )-16 <= 0  then 0 ELSE 1 END ,
 --Above3V=CASE WHEN (CAST(Protons as int) )-18 <= 0  then 0 ELSE 1 END ,
 --Below3V=CASE WHEN (CAST(Protons as int) )-20 <= 0  then 0 ELSE 1 END ,
 --CarSide1=CASE WHEN (CAST(Protons as int) )-22 <= 0  then 0 ELSE 1 END ,
 --CarSide2=CASE WHEN (CAST(Protons as int) )-24 <= 0  then 0 ELSE 1 END ,
 --CarSide3=CASE WHEN (CAST(Protons as int) )-26 <= 0  then 0 ELSE 1 END ,
 --CarSide4=CASE WHEN (CAST(Protons as int) )-28 <= 0  then 0 ELSE 1 END ,
 --Above1VSide1=CASE WHEN (CAST(Protons as int) )-30 <= 0  then 0 ELSE 1 END ,
 --Below1VSide1=CASE WHEN (CAST(Protons as int) )-32 <= 0  then 0 ELSE 1 END ,
 --Above1VSide2=CASE WHEN (CAST(Protons as int) )-34 <= 0  then 0 ELSE 1 END ,
 --Below1VSide2=CASE WHEN (CAST(Protons as int) )-36 <= 0  then 0 ELSE 1 END
 FROM [Physics].[dbo].[AtomicMilesMathisPeriodicTableBase]
 -- where  Cast(Protons as int) % 5 = 0
 ) Mathis
ORDER BY AtomicNumber
 ,1
END

BEGIN
PRINT '[dbo].[AtomicMilesMathisMoleculesBindLogicXYZ]'
DROP TABLE IF EXISTS [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ]
END

BEGIN
--CREATE VIEW [dbo].[vwMathisMoleculesBindLogicXYZ]
--AS
WITH Mathis
AS (
 SELECT e.*
 ,m.AlphaType
 ,m.SlotOrder
 ,pbm.MathisCarouselAlphaTypeFull
 ,pbm.AlphaTypeRemainder
 ,m.Protons AS ProtonsMM

 FROM [Physics].[dbo].[AtomicMilesMathisElementsPositions] e
 JOIN [Physics].[dbo].[AtomicMilesMathisPeriodicTable] m ON e.AtomicNumber = m.AtomicNumber
 AND e.SlotNumber = m.SlotNumber
 LEFT JOIN [Physics].[dbo].[AtomicMilesMathisProtonBalance] pbm ON m.AtomicNumber = pbm.AtomicNumber
 where e.Protons > 0
 )
SELECT TOP 100 PERCENT
     A.LTAMKey as LTAMKeySrc
 ,B.LTAMKey as LTAMKeyDest
    ,A.AtomicNumber AS AtomicNumberSrc
 ,B.AtomicNumber AS AtomicNumberDest
    ,A.Electrons  + A.SlotSpin + B.Electrons + B.SlotSpin     as SlotDirectionElectronBond
 ,Cast(1 as int) as IsValid  -- 1 Yes 0 No
 ,A.Element AS ElementSrc
 ,B.Element AS ElementDest
 ,A.CanBind AS CanBindSrc
 ,B.CanBind AS CanBindDest
 ,A.AlphaType AS AlphaTypeSrc
 ,B.AlphaType AS AlphaTypeDest
 ,A.SlotNumber AS SlotNumberSrc
 ,B.SlotNumber AS SlotNumberDest
 ,A.SlotSpin AS SlotSpinSrc
 ,B.SlotSpin AS SlotSpinDest
 ,A.AlphaTypeRemainder AS AlphaTypeRemainderSrc
 ,B.AlphaTypeRemainder AS AlphaTypeRemainderDest
 ,A.MathisCarouselAlphaTypeFull AS CarouselAlphaTypeSrc
 ,B.MathisCarouselAlphaTypeFull AS CarouselAlphaTypeDest
 ,A.AtomicSymbol AS AtomicSymbolSrc
 ,B.AtomicSymbol AS AtomicSymbolDest
 ,A.[SlotOrien] AS SlotOrienSrc
 ,B.[SlotOrien] AS SlotOrienDest
 ,A.[Neutrons] AS NeutronsSrc
 ,B.[Neutrons] AS NeutronsDest
 ,A.[Electrons] AS ElectronsSrc
 ,B.[Electrons] AS ElectronsDest
 ,A.ProtonsMM AS ProtonsMMSrc
 ,B.ProtonsMM AS ProtonsMMDest
 ,A.Protons AS ProtonsSrc
 ,B.Protons AS ProtonsDest
 ,A.[PX] AS PXSrc
 ,A.[PY] AS PYSrc
 ,A.[PZ] AS PZSrc
 ,A.[P2P3] AS P2P3Src
 ,A.[P12] AS P12Src
 ,A.[PE] AS PESrc
 ,A.[p1x] AS p1xSrc
 ,A.[p1y] AS p1ySrc
 ,A.[p1z] AS p1zSrc
 ,A.[p2x] AS p2xSrc
 ,A.[p2y] AS p2ySrc
 ,A.[p2z] AS p2zSrc
 ,A.[p3x] AS p3xSrc
 ,A.[p3y] AS p3ySrc
 ,A.[p3z] AS p3zSrc
 ,A.[p4x] AS p4xSrc
 ,A.[p4y] AS p4ySrc
 ,A.[p4z] AS p4zSrc
 ,A.[p5x] AS p5xSrc
 ,A.[p5y] AS p5ySrc
 ,A.[p5z] AS p5zSrc
 ,A.[p6x] AS p6xSrc
 ,A.[p6y] AS p6ySrc
 ,A.[p6z] AS p6zSrc
 ,A.[N1N2] AS N1N2Src
 ,A.[N1] AS N1Src
 ,A.[N2] AS N2Src
 ,A.[N3] AS N3Src
 ,A.[N4] AS N4Src
 ,A.[N5] AS N5Src
 ,A.[N6] AS N6Src
 ,A.[n1x] AS n1xSrc
 ,A.[n1y] AS n1ySrc
 ,A.[n1z] AS n1zSrc
 ,A.[n2x] AS n2xSrc
 ,A.[n2y] AS n2ySrc
 ,A.[n2z] AS n2zSrc
 ,A.[n3x] AS n3xSrc
 ,A.[n3y] AS n3ySrc
 ,A.[n3z] AS n3zSrc
 ,A.[n4x] AS n4xSrc
 ,A.[n4y] AS n4ySrc
 ,A.[n4z] AS n4zSrc
 ,A.[n5x] AS n5xSrc
 ,A.[n5y] AS n5ySrc
 ,A.[n5z] AS n5zSrc
 ,A.[n6x] AS n6xSrc
 ,A.[n6y] AS n6ySrc
 ,A.[n6z] AS n6zSrc
 ,A.[e1x] AS e1xSrc
 ,A.[e1y] AS e1ySrc
 ,A.[e1z] AS e1zSrc
 ,A.[e2x] AS e2xSrc
 ,A.[e2y] AS e2ySrc
 ,A.[e2z] AS e2zSrc
 ,A.[e3x] AS e3xSrc
 ,A.[e3y] AS e3ySrc
 ,A.[e3z] AS e3zSrc
 ,A.[e4x] AS e4xSrc
 ,A.[e4y] AS e4ySrc
 ,A.[e4z] AS e4zSrc
 ,A.[e5x] AS e5xSrc
 ,A.[e5y] AS e5ySrc
 ,A.[e5z] AS e5zSrc
 ,A.[e6x] AS e6xSrc
 ,A.[e6y] AS e6ySrc
 ,A.[e6z] AS e6zSrc
 ,B.[PX] AS PXDest
 ,B.[PY] AS PYDest
 ,B.[PZ] AS PZDest
 ,B.[P2P3] AS P2P3Dest
 ,B.[P12] AS P12Dest
 ,B.[PE] AS PEDest
 ,B.[p1x] AS p1xDest
 ,B.[p1y] AS p1yDest
 ,B.[p1z] AS p1zDest
 ,B.[p2x] AS p2xDest
 ,B.[p2y] AS p2yDest
 ,B.[p2z] AS p2zDest
 ,B.[p3x] AS p3xDest
 ,B.[p3y] AS p3yDest
 ,B.[p3z] AS p3zDest
 ,B.[p4x] AS p4xDest
 ,B.[p4y] AS p4yDest
 ,B.[p4z] AS p4zDest
 ,B.[p5x] AS p5xDest
 ,B.[p5y] AS p5yDest
 ,B.[p5z] AS p5zDest
 ,B.[p6x] AS p6xDest
 ,B.[p6y] AS p6yDest
 ,B.[p6z] AS p6zDest
 ,B.[N1N2] AS N1N2Dest
 ,B.[N1] AS N1Dest
 ,B.[N2] AS N2Dest
 ,B.[N3] AS N3Dest
 ,B.[N4] AS N4Dest
 ,B.[N5] AS N5Dest
 ,B.[N6] AS N6Dest
 ,B.[n1x] AS n1xDest
 ,B.[n1y] AS n1yDest
 ,B.[n1z] AS n1zDest
 ,B.[n2x] AS n2xDest
 ,B.[n2y] AS n2yDest
 ,B.[n2z] AS n2zDest
 ,B.[n3x] AS n3xDest
 ,B.[n3y] AS n3yDest
 ,B.[n3z] AS n3zDest
 ,B.[n4x] AS n4xDest
 ,B.[n4y] AS n4yDest
 ,B.[n4z] AS n4zDest
 ,B.[n5x] AS n5xDest
 ,B.[n5y] AS n5yDest
 ,B.[n5z] AS n5zDest
 ,B.[n6x] AS n6xDest
 ,B.[n6y] AS n6yDest
 ,B.[n6z] AS n6zDest
 ,B.[e1x] AS e1xDest
 ,B.[e1y] AS e1yDest
 ,B.[e1z] AS e1zDest
 ,B.[e2x] AS e2xDest
 ,B.[e2y] AS e2yDest
 ,B.[e2z] AS e2zDest
 ,B.[e3x] AS e3xDest
 ,B.[e3y] AS e3yDest
 ,B.[e3z] AS e3zDest
 ,B.[e4x] AS e4xDest
 ,B.[e4y] AS e4yDest
 ,B.[e4z] AS e4zDest
 ,B.[e5x] AS e5xDest
 ,B.[e5y] AS e5yDest
 ,B.[e5z] AS e5zDest
 ,B.[e6x] AS e6xDest
 ,B.[e6y] AS e6yDest
 ,B.[e6z] AS e6zDest

INTO [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ]
FROM Mathis A
FULL OUTER JOIN Mathis B ON 1 = 1
WHERE (
 (
 A.Protons > 0
 AND B.Protons > 0
 )
 OR (
 A.ProtonsMM > 0
 AND B.ProtonsMM > 0
 )
 )
 AND (A.AlphaType >= B.AlphaType)
 --AND (
 -- (
 -- (A.SlotSpin <> B.SlotSpin)
 -- OR (
 -- A.SlotSpin = 'N'
 -- AND B.SlotSpin = 'N'
 -- )
 -- OR NOT (
 -- (
 -- A.SlotSpin = 'A'
 -- AND B.SlotSpin <> 'A'
 -- )
 -- OR (
 -- A.SlotSpin <> 'A'
 -- AND B.SlotSpin = 'A'
 -- )
 -- )
 -- )
 ---- AND NOT (A.SlotSpin = B.SlotSpin)
 --)
 --and A.CanBind = B.CanBind
 --AND A.CanBind > 0
 --AND B.CanBind > 0
 AND A.Protons > 0
 AND B.Protons > 0
 AND B.AlphaType > 0
 AND A.AlphaType > 0

 --AND A.SlotNumber NOT IN (
 -- 18
 -- ,19
 -- )
 --AND B.SlotNumber NOT IN (
 -- 18
 -- ,19
 -- )
 

 --  AND A.Electrons + A.SlotSpin + B.Electrons + B.SlotSpin  not in (  
 --     'TRTL', 'BRBL', 'BRTR','BRTL' )
--and
--Case when (A.Electrons = 'A' and B.Electrons = 'A') then 1 else
--Case when A.Electrons = 'B' and B.Electrons = 'T' then 1 else
--Case when A.Electrons = 'T' and B.Electrons = 'B' then 1 else 0 end end end =1
--and CASE WHEN ((A.SlotNumber=1 and A.AtomicNumber <= 4) or (B.SlotNumber = 1 and B.AtomicNumber <=4)) Then 0 else 1 End = 1
ORDER BY A.AtomicNumber
 ,A.SlotNumber
 ,B.AtomicNumber
 ,B.SlotLayout

END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-202302242-BindLogicXYZ] ON [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END
 


-- Set known Invalid Configurations
BEGIN
PRINT 'Set IsValid = 0 for Invalid Configs'

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE  A.SlotDirectionElectronBond  in ( 'TRTL', ' TLTR', 'BRBL', 'BRTR','BRTL' ) ;

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE  A.SlotNumberSrc IN (18,19);

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE  A.SlotNumberDest IN (18,19);

UPDATE A
SET IsValid = 0
FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
WHERE (SlotSpinSrc = SlotSpinDest) and NOT (SlotSpinSrc = 'A' and SlotSpinDest = 'A') ;

--UPDATE A
--SET IsValid = 0
--FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] A
--WHERE (SlotSpinSrc = 'N' or  SlotSpinDest = 'N');

END


BEGIN
PRINT 'dbo.AtomicMilesMathisFormulas'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisFormulas
END


BEGIN
--CREATE View [dbo].[vwAtomicOrbitalsinMilesDetailAllBonds]
--as
--WITH Bonds
--AS (

SELECT
--P.ZFormula,
P.ZID,
Formula.Formula,
Formula.CurrentAtom,
Formula.NextAtom1,
Formula.NextAtom2,
Formula.NextAtom3,
Formula.NextAtom4,
Formula.NextAtom5,
Formula.NextAtom6
INTO dbo.AtomicMilesMathisFormulas
FROM
(SELECT Distinct ZFormula, MAX(ZID) as ZID
FROM [dbo].[AtomicMilesMathisOrbitalBondsParsed]
where LEN(ZFormula) > 1
GROUP BY ZFormula ) P
CROSS APPLY
(
 SELECT CurrentAtom
 ,NextAtom1
 ,NextAtom2
 ,NextAtom3
 ,NextAtom4
 ,NextAtom5
 ,NextAtom6
 ,Min(ZFormula) AS Formula
 ,Min(ZMolecule) AS Molecule
  --  INTO [dbo].[AtomicMilesMathisFormulas]
 FROM [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] BL
 JOIN [dbo].[AtomicMilesMathisOrbitalBondsParsed] OB
 ON (
 BL.AtomicSymbolSrc = OB.CurrentAtom
 AND (
   BL.AtomicSymbolDest = OB.NextAtom1
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
    BL.AtomicSymbolDest = OB.CurrentAtom
 AND (
   BL.AtomicSymbolSrc = OB.NextAtom1
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom1
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom1
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom2
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom2
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom3
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom3
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom4
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom5
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom4
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom5
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom5
 AND (
 BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom5
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolSrc = OB.NextAtom6
 AND (
   BL.AtomicSymbolDest = OB.CurrentAtom
 OR BL.AtomicSymbolDest = OB.NextAtom2
 OR BL.AtomicSymbolDest = OB.NextAtom3
 OR BL.AtomicSymbolDest = OB.NextAtom4
 OR BL.AtomicSymbolDest = OB.NextAtom6
 )
 )
 OR (
 BL.AtomicSymbolDest = OB.NextAtom6
 AND (
   BL.AtomicSymbolSrc = OB.CurrentAtom
 OR BL.AtomicSymbolSrc = OB.NextAtom2
 OR BL.AtomicSymbolSrc = OB.NextAtom3
 OR BL.AtomicSymbolSrc = OB.NextAtom4
 OR BL.AtomicSymbolSrc = OB.NextAtom6
 )
 )
 WHERE BL.AtomicNumberSrc IS NOT NULL
  AND BL.IsValid > 0
  and OB.ZFormula = P.ZFormula
 --and NOT EXISTS (
 --SELECT TOP 1 1 from [dbo].[vwMathisMoleculesBindLogicXYZ] A where OB.ZFormula = A.AtomicSymbolSrc  
 --)
 --and CurrentAtom is not null and NextAtom1 is not null
 GROUP BY CurrentAtom
 ,NextAtom1
 ,NextAtom2
 ,NextAtom3
 ,NextAtom4
 ,NextAtom5
 ,NextAtom6
 
 ) Formula

-- )
END

BEGIN
--Remove Deutrium
  DELETE
  FROM [Physics].[dbo].[AtomicMilesMathisFormulas]
  where Formula like '%D%'  COLLATE SQL_Latin1_General_CP1_CS_AS
  and Formula not like '%Dy%'
END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-202302242-Formulas] ON [dbo].[AtomicMilesMathisFormulas] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END


BEGIN
PRINT 'dbo.AtomicMilesMathisOrbitalsDetailAllBonds'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisOrbitalsDetailAllBonds
END

BEGIN
SELECT TOP 100 PERCENT
     OB2.*
 ,BL2.*
INTO [dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
FROM [dbo].[AtomicMilesMathisFormulas] OB2
INNER JOIN [dbo].[AtomicMilesMathisMoleculesBindLogicXYZ] BL2 ON (
 OB2.CurrentAtom = BL2.AtomicSymbolSrc
 AND (
     BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom1 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom2 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom3 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom4 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom5 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom6
 )
 )
 OR (
 OB2.NextAtom6 = BL2.AtomicSymbolSrc
 AND (
   BL2.AtomicSymbolDest = OB2.CurrentAtom
 OR BL2.AtomicSymbolDest = OB2.NextAtom1
 OR BL2.AtomicSymbolDest = OB2.NextAtom2
 OR BL2.AtomicSymbolDest = OB2.NextAtom3
 OR BL2.AtomicSymbolDest = OB2.NextAtom4
 OR BL2.AtomicSymbolDest = OB2.NextAtom5
 )
 )
WHERE 1=1
  AND BL2.IsValid = 1

--AND NOT(OB2.Formula LIKE '%D%'
--   OR OB2.Formula LIKE 'C%H%'
--       OR OB2.Formula LIKE '[0-9]%'
--     )
ORDER BY
    OB2.Formula
 ,ElementSrc
 ,ElementDest
 ,SlotNumberSrc
 ,SlotNumberDest

END

BEGIN
UPDATE A
SET IsValid =0
FROM [dbo].[AtomicMilesMathisOrbitalsDetailAllBonds] A
WHERE (SlotSpinSrc = 'N' or  SlotSpinDest = 'N');
END

BEGIN
CREATE CLUSTERED COLUMNSTORE INDEX [ClusteredColumnStoreIndex-202302242-OrbitalsMiles] ON [dbo].[AtomicMilesMathisOrbitalsDetailAllBonds] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0) ON [PRIMARY]
END
GO

Check queries...Y is a problem child with Miles:

Code:
SELECT Distinct Formula , 'Not MM Bonded' as BondResult
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds] b
where Formula not in (
  SELECT Formula
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds] a
  where 1=1
  --and a.IsValid = 1
  and a.CanBindSrc =1 and a.CanBindDest =1
)
  order by 1
  ;

  SELECT Distinct 'Has N in Key' as FailType,*  FROM  [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds] a
  where CanBindSrc =1 and CanBindDest =1 and IsValid = 0
  order by 2, SlotNumberSrc

Result of fall-outs...a lot of "gold" and "cobalt" misses with Ar, Si as well:


Ar2Hg
ArBe
ArTl
Au2Co
Au2Y
Au3Co
Au3Dy
Au4Y
Au5Y
Au7Y
Au8Y
Au9Y
AuCo
AuCo2
AuCo3
AuDy
B4Si
B6Si
BaHe
BaSi2
BeNe
BLi
Cd3P2
Cl3Si
Co2Eu
Co2Ta
Co2Y
Co3Ir
Co3Ta
Co3Y
Co3Y4
Co5Ir2
Co5Y
Co5Y8
Co7Y2
Co7Y9
CoIr3
CoTa
CoTa2
CoY3
Cs2O7U2
Cs2S
CSi
CsO
Cu3P2
EuP
Ga3Rb
Ga7Rb
GaP
H12Si5
H2Cl2Si
H2Si2U
H3ClSi
H3Si
H6Si2
H6Si3
HCl
HeHg
HeTa
HgNe
HLi
I3Si
I4Si
ILi
Ir2Y
Ir3Y
Ir4Y
K10Y
LiBr
LiCl
LiI
LiO
LuY
Mg2Si
NbSi
NbSi2
Ni2Si
NiSi
Pt3Y
PTa
ReSi2
Si2Ta
Si2Ti
Si2W
Si2Zr
Si3Ta5
SiO

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Jul 11, 2023 4:01 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Au2y10
Erroneous slot spin data, the four slots circled on the left have been corrected as shown on the right.

Hi Cr6, I saved and tried all the queries you posted on 6 and 8 July.

1.
Code:
CREATE VIEW [dbo].[vwAtomicOrbitalsAllowed]
AS

SELECT TOP 100 PERCENT
...
Completed successfully, the view has been added.

2.
Code:
USE [Physics]
GO

SELECT *
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
WHERE CanBindSrc = 1 and CanBindDest=1 and IsValid =1 -- sets valid combinations for now
The current number of valid bonds? Results in 36,290 rows.

3.
Code:
USE [Physics]
GO

SELECT  Count(Distinct Formula) as FormulaCount,
             Count(Distinct CurrentAtom) as CurrentAtomCount
            ,Count(Distinct NextAtom1) as NextAtom1Count
             ,Count(Distinct NextAtom2) as NextAtom2Count
            ,Count(Distinct NextAtom3) as NextAtom3Count
          ,Count(Distinct NextAtom4) as NextAtom4Count
          ,Count(Distinct NextAtom5) as NextAtom5Count
          ,Count(Distinct NextAtom6) as NextAtom6Count
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
Returns the distribution:
Code:
FormulaCount CurrentAtomCount NextAtom1Count NextAtom2Count NextAtom3Count NextAtom4Count NextAtom5Count NextAtom6Count
4445 76 81 64 47 29 10 6
4.
Code:
USE [Physics]
GO

ALTER PROCEDURE [dbo].[spBuildAtomicMilesMathisOrbitalsDetailAllBonds]

AS

BEGIN
PRINT 'dbo.AtomicMilesMathisOrbitalParsed'
DROP TABLE IF EXISTS dbo.AtomicMilesMathisOrbitalParsed;
END

Was completed successfully. I guess the superconductors were added.

5. On 8 July, Cr6 wrote. Here's the new script for the main build proc...takes 20-40 minutes to run it.
Airman. When I tried executing the “new script for the main build proc” there was no 20-40 minute wait - the result was immediate.

6. Next I saved and ran:
Code:
SELECT Distinct Formula , 'Not MM Bonded' as BondResult
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds] b
where Formula not in (
...
After 25 seconds I saw the dropout list of 101 ‘Not MM Bonded’ formulas you posted.  

7. Today I selected a molecule from near the top of the dropout list - Au2Y.
a. Used Jupyter Notebook to obtain the Au and Y slotlayout diagrams, as shown above - the left side.
b. Noticed that for both atoms, slots 2 and 3 are A type electron configurations (indicating electrons at both Top and Bottom proton pole positions), yet those slots erroneously indicate L and R proton spins. The spin types should be ‘A’, indicating both L and R spins are present.
c. Sorted the 90 Elements.csv (Elements-Positions2.csv) on the electrons column. There are 252 slots where the A indicates both T and B electron positions. Of those 252 slots: 163 showed “R” or “L” slot spins. They needed to be changed to ‘A’, both left and right proton spins.
d. Changed 163 erroneous 'R' or 'L' slot spins to 'A'. Definitely a screw-up that should have been found long ago. Please pardon the multiple errors.
e. Updated the Elements-Positions2.csv file at github. https://github.com/LtAirman/ChargeFieldTopics  

Some discussion may be warranted. Slots two and three are, of course, where the hook positions (slots 16, 17, 18 and 19) attach to the main z column. Au has two occupied hook positions. An Au/Y bond wouldn’t occur at a hook position. In any event, the atomic slot data has been changed. Sorry to oblige you in such manner. Does it made a difference to the dropout list?
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Tue Jul 11, 2023 11:03 pm

Thanks LTAM,

I'll try to get this added!

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Wed Jul 12, 2023 3:07 am


Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Wed Jul 12, 2023 2:16 pm

.
Downloaded and saved physics20230712.bak to the Backup folder. With some trepidation followed the tutorial steps to restore to today's ‘Physics’. Later today or tomorrow I think I could do it without the open tutorial.

Reran the valid bonds query:
Code:
CODE:
USE [Physics]
GO

SELECT *
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
WHERE CanBindSrc = 1 and CanBindDest=1 and IsValid =1 -- sets valid combinations for now
Yesterday, the result was 36,290 rows.
Today, the number is 291,019. That’s a big difference.

Had to  see for myself, reran the not MM Bonded query:
Code:
CODE:
SELECT Distinct Formula , 'Not MM Bonded' as BondResult
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds] b
where Formula not in (
...
Yep, I’m seeing the same screen.

That's good, right?  Smile  
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Thu Jul 13, 2023 1:41 am

Hi LTAM,

Yep it is good! Yeah I think this new file is more solid for what is "allowed" per Miles. Here are some other quick queries on counts to just look at differences. Let me check against the Chemspider table as well for drop outs. It is a good sign that the new .csv file allows more A-Carousel bonds. The challenge now is how "tight" versus how "loose" for showing the structures. Basically what is an exception at this point? What needs special handling? Stuff like beryllium still might need some attention with bonds.  

At this point the next goal is to create a Graph style database that can show off all the known bonds in the universe per Miles and atoms 1-90. That is kind of my goal at this point. It would be cool to show Formulas/Molecules with good bonds per Miles' structures that are still "undiscovered" in the literature.

Hopefully we get folks to chime in and tell us why this is "wrong". Criticism at this point can only help with seeing why slot bonds do not map to traditional epn-ion style "bonds".  
------------
--Seeing the same counts
Code:
     
SELECT DISTINCT Formula
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
  where IsValid =1 and CanBindSrc =1 and CanBindDest =1
  order by 1
GO
SELECT DISTINCT Formula
    FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
 order by 1
GO

SELECT Count(Distinct Formula) as CountFormula
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
WHERE CanBindSrc = 1 and CanBindDest=1 and IsValid =1 -- sets valid combinations for now

SELECT COUNT(*) --Rows count includes slot numbers
FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
WHERE CanBindSrc = 1 and CanBindDest=1 and IsValid =1 -- sets valid combinations for now

For example, these 10 might be problem children because they are duping horizontally for bonds. Might be something in the stored proc:

Code:
 SELECT Distinct ZID, Formula
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
  where CurrentAtom = NextAtom1
  order by 1

[b]ZID Formula[/b]
55366.00 Cl4O5Sn
74712.00 H2BMo
74714.00 H2BTa
74715.00 BW
105283.01 PCCO -- could make this PC2O to fix
123026.00 H21HP -- could make this H22P to fix
140446.00 Cl3N6Ru
140541.00 H15Cl3N5Ru
21170791.00 BNi2
1234636906.00 NHOH --Could make this NH2O to fix
B and Ru look like exceptions for some bonds?

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sat Jul 15, 2023 8:52 pm

.
Cr6 wrote. Yep it is good! Yeah I think this new file is more solid for what is "allowed" per Miles. Here are some other quick queries on counts to just look at differences. Let me check against the Chemspider table as well for drop outs. It is a good sign that the new .csv file allows more A-Carousel bonds.
------------
--Seeing the same counts
Airman. Very Good. Now that the current number of valid bonds is somewhat closer to where it should reasonably be(?), I certainly feel relief.
I hope you weren’t overly disappointed to initially implement e-p-n bonding rules and see so few valid bonds. In hindsight several things were unresolved or broken, you probably considered that. I imagine you’ve kept you eye on what slot numbers were involved in however many valid formulas the database reported at the time, with a keen interest in the carousel.
Slow progress is still progress.
I suppose the not “A,,,,A” slot data set error should be added to the database(?).

First query. Actually four queries in one, all deal with the same table, [AtomicMilesMathisOrbitalsDetailAllBonds]
After executing, the output is divided into four sections.
a. The 1st sub - Select Distinct query tests for IsValid =1 and CanBindSrc =1 and CanBindDest =1;
b. the 2nd sub-Select Distinct query does not, yet both queries output the same list of 4,678 formulas. I suppose that means that for all 4,678 formulas  – each bond’s three variables (IsValid, CanBindSrc, CanBindDest) equals 1. Indicating a valid formula(?).
c. The 3rd sub-Select Count query, outputs “CountFormula” is 4,678, confirms the number of distinct valid formulas.
d. The last sub-query, Select Count must be counting the total number of rows (each is separate bond between atoms) for all those formulas – 291,019.  

For the second, SELECT Distinct ZID query, Cr6 wrote.
For example, these 10 might be problem children because they are duping horizontally for bonds. Might be something in the stored proc:
Code:
SELECT Distinct ZID, Formula
  FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
  where CurrentAtom = NextAtom1
  order by 1

[b]ZID Formula[/b]
55366.00 Cl4O5Sn
74712.00 H2BMo
74714.00 H2BTa
74715.00 BW
105283.01 PCCO -- could make this PC2O to fix
123026.00 H21HP -- could make this H22P to fix
140446.00 Cl3N6Ru
140541.00 H15Cl3N5Ru
21170791.00 BNi2
1234636906.00 NHOH --Could make this NH2O to fix

Airman. I see “where CurrentAtom = NextAtom1”. So if that’s true, does it means that a bond exists between two atoms of the same type? Such as H2 or Cl2? I would think that test alone is frequently valid and only infrequently not valid. The 9 out of the 10 zid formulas contain at least one atom type with multiple instances. The following list identifies the atom types and the total number of that type. 1. Cl4 or O5. 2. H2. 3. H2. 4. . 5. C2. 6. H22. 7. Cl3 or N6. 8. H15 or Cl3 or N5. 9. Ni2. 10. H2. Only the fourth formula, BW, Boron and Tungsten fails to meet that test – why did it fail? If only BW fails that test, why are all the other formulas with valid duplicates be identified as duping problems? I’m missing something.
Plus I see Boron appears in 4 of the 10 zid formulas.

Cr6 wrote. The challenge now is how "tight" versus how "loose" for showing the structures.
Airman. “Tight vs loose for showing the structures”, are you talking 3D proton separation distances for molecular rendering? If so, I would hope can we use the current gui controllable proton separation distances.  
Cr6 wrote. Basically what is an exception at this point? What needs special handling? Stuff like beryllium still might need some attention with bonds.
and
Cr6 wrote. B and Ru look like exceptions for some bonds?
Airman. Understood, any remaining exceptions may be difficult to find. Boron (B,5), Beryllium (Be,4) and Ruthenium (Ru,44) may be suspect atoms, there may not be any conclusive queries indicating a problem.

Miles Periodic Table with Standard Periodic Table reference - Page 8 Bebslo10
For the record, Miles depicted Be and B as shown on the left. I took the liberty of altering them as shown on the right. That was before we added the e-p-n bonding rules. Another altered atom (not shown) is Oxygen (O,Cool, with three separate parallel alphas in slot1, which I simplified to a six proton stack, And later as an A type six proton stack. And Fluorine (F,9), with the same two separate protons in slot3 as in B. For both atoms I replaced the two individual slot3 protons with a single alpha. Maybe Boron’s or Fluorine’s slot 3 should be T or B, L or R and not an alpha(?). And maybe some atoms have multiple forms - something to keep in mind.

Be, As Miles depicted Beryllium - four parallel or anti-parallel protons from four adjacent Z aligned slots along with five neutrons, is so unusual it seems to me to be the most unique among all the elements. Changing Be to a four proton A stack may be incorrect. Our Be or B slotlayouts could easily be wrong.

On the other hand, a lack of bonding problems seems to suggest our e-p-n structures and bonding rules are correct.  

Miles Periodic Table with Standard Periodic Table reference - Page 8 Ruwtwo10
Keeping a lookout for any possible exception suspects.

Cr6 wrote. At this point the next goal is to create a Graph style database that can show off all the known bonds in the universe per Miles and atoms 1-90. That is kind of my goal at this point.

At this point the next goal is to create a Graph style database that can show off all the known bonds in the universe per Miles and atoms 1-90. That is kind of my goal at this point. It would be cool to show Formulas/Molecules with good bonds per Miles' structures that are still "undiscovered" in the literature.

Airman. Above you said “The challenge now is how ‘tight’ versus how ‘loose’ for showing the structures”. Bonds between atoms come in two varieties: 1. either within a shared slot or 2. between adjacent slots. I guess those four sub-queries above can be designed to discriminate between the two bond types. I suppose the queries might also be used to identify either of those separate or adjacent bonding slot locations as well as each atoms’ locations and orientations? Answering yes means we have all the necessary details to render a molecular view.

BasedPhysics is rebuilding AtomBuilder3. He may tackle the MoleculeBuilder as well. He doesn’t need me if he knows where that data is.

Creating a graph style database that can show all the known bonds in the universe as well as predicting new ones is pretty big goal, not to mention charge field Machine Learning. With your approval and directions I’ll be more than happy to continue working on a Jupyter Notebook molecular graph using networkX or whatever else you think necessary.

Cr6 wrote. Hopefully we get folks to chime in and tell us why this is "wrong". Criticism at this point can only help with seeing why slot bonds do not map to traditional epn-ion style "bonds".
Airman. I agree.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Jul 16, 2023 3:44 am

I'm totally on board with using Networkx and Pandas. The graph databases are a little tricky to get working with a Gremlin style syntax. It is easy to burn a lot of time in a graph database while Networkx is fairly straight forward.  I'm starting to get the Jupyter notebooks out again with Networkx. I know you did some cool things with Networkx awhile back. I just hope it has enough power to give millions of rows back.

LTAM wrote:I suppose the not “A,,,,A” slot data set error should be added to the database(?).

This could be added as a case statement.

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sat Jul 22, 2023 3:04 am

By the way, Be can create superconductors in some combinations.
---------
https://pubs.rsc.org/en/content/articlelanding/2020/cp/c9cp06008a

Metallization and superconductivity in methane doped by beryllium at low pressure
Hai-Yan Lv,ab   Si-Yuan Zhang,ab   Meng-Hu Li,ab   Yu-Long Hai,ab   Ning Lu,ab   Wen-Jie Li*a  and  Guo-Hua Zhong ORCID logo *a  
Author affiliations
Abstract

As one of the simplest hydrocarbons, methane (CH4) has great potential in the research of superconductors. However, the metallization of CH4 has been an issue for a long time. Here, we report the structure, metallization, and superconductivity of CH4 doped by Be at low pressures, based on first-principles calculations. The result shows that the thermodynamically stable BeCH4 with P[1 with combining macron] space-group can transform into a metal at ambient pressure. This ternary hydride BeCH4 exhibits a superconductivity of ∼6 K below 25.6 GPa. Interestingly, the superconducting critical temperature of BeCH4 can reach ∼30 K at 80 GPa in the form of an a-P1 space-group phase. The charge transfer from Be to CH4 molecules plays an important role in the superconductivity. Our results present a novel way to realize the metallization of methane at relative pressures and indicate that the doped methane is a potential candidate for seeking high temperature and low pressure superconductivity.

https://arxiv.org/abs/2209.01903

[Submitted on 5 Sep 2022]
Superconductivity and magnetism in compressed actinium-beryllium-hydrogen alloys
Zhongyu Wan, Tianyi Yang, Wenjun Xu, Ruiqin Zhang

   The discovery of new high-temperature superconductors is one of the most critical problems in materials, chemistry, and physics. This work systematically investigates fluorite-like structures of XBeH8 (X is Ac, Th, Pa, U, and Np) to gain physical insight into the pressure effects on the properties. Our results reveal that AcBeH8 and ThBeH8 are two potential high-temperature superconductors, where AcBeH8 reaching a superconducting transition temperature of 284.11 K at 150 GPa and even a value of 203.29 K at 50 GPa, ThBeH8 has Tc is 217.65 K at 200 GPa, and the predicted results provide strong candidates for achieving high temperature or even room temperature superconductivity. The analysis of pressure effects demonstrates unusual charge transfer and atomic structure in the system, with s-f migration in Ac/Th atoms and s-p migration in Be atoms, similar to the high-pressure behavior of alkaline earth metals. In the past long time, superconductivity and magnetism were considered unable to coexist. However, UBeH8 and NpBeH8 are two potential magnetic superconductors with maximum Tc of 60.70 and 107.18 K at 100 and 350 GPa, respectively, and Hubbard U calculations predict their magnetic moments with 1.52 to 1.90 and 2.49 to 2.92 muB at 0 K. The coexistence of magnetic and superconducting states may be attributed to the different sublattice actions.

Subjects: Superconductivity (cond-mat.supr-con); Strongly Correlated Electrons (cond-mat.str-el)
Cite as: arXiv:2209.01903 [cond-mat.supr-con]
  (or arXiv:2209.01903v1 [cond-mat.supr-con] for this version)
 
https://doi.org/10.48550/arXiv.2209.01903
Assembling the puzzle of superconducting elements: A Review
Miles Periodic Table with Standard Periodic Table reference - Page 8 Ptsupe10
Miles Periodic Table with Standard Periodic Table reference - Page 8 Schist10

https://arxiv.org/ftp/cond-mat/papers/0410/0410302.pdf

1. Introduction
After two decades of focused research on
superconductivity in copper oxides or cuprates, interest has
recently veered toward simpler materials, such as
magnesium diboride and basic elements. Simple materials
were recently reported to superconduct at, surprisingly high
critical temperatures (T c), 40 K for MgB2 - a binary
compound [1], and 20 K for lithium under pressure - the
highest T c for a simple element [2]. During the last few
years, the physics community has been delighted with
observation of superconductivity in many new elements,
some of them under pressure, such as sulphur 17 K [3],
oxygen 0.5 K [4], carbon in nanotube 15 K [5] and
diamond forms 4K [6], a non-magnetic state of iron 1 K
[7], and the light elements lithium 20 K [2] and boron 11 K
[8]. While we will soon celebrate a century of
superconductivity (Figure 1), these recent discoveries
highlight answers to fundamental questions that the
elements of the periodic table still conceal. Though
thousands of papers have been published on the topic, a
general predictive model of superconductivity has eluded
us.

Enhancement of Superconductivity of Beryllium at High Pressure

   Shimizu, Katsuya ; Kubota, Kazuhisa ; Katsuoka, Takahiro ; Miyake, Atsushi ; Sakata, Masafumi ; Nakamoto, Yuki ; Ohishi, Yasuo

Abstract

Among elements shows superconductivity at high pressure, some elements show the large enhancement of the transition temperature (Tc) at higher pressures. In the case of lithium, the Tc at ambient pressure is 0.4 mK which is the lowest observed value in whole elements, however, is enhanced by pressure up to near 20 K. And calcium, which is on the same group II and not superconductive at ambient pressure, shows the highest Tc of elements at 29 K under pressure. Then we focused on beryllium which is near to them on the periodic table. At ambient pressure, Tc of beryllium is 24 mK. We measured the electrical resistance at high pressure (P < 50 GPa) and low temperature (T > 100 mK) and found that the Tc rose up to few Kelvin at pressure above 20 GPa and reached up to 3.7 K at 30 GPa. In this pressure range the hcp crystal structure is stable at room temperature. We performed a powder X-ray diffraction measurement at room temperature and low temperature in BL10XU at SPring-8 and found a discontinuous change in c/a ratio at around 25 GPa.

Publication:
   Topical Conference on the Shock Compression of Matter 2013, abstract id. Q2.002
Pub Date:
   June 2013
https://ui.adsabs.harvard.edu/abs/2013APS..SHK.Q2002S/abstract

Theoretical study of multiband Superconductivity and Enhanced Tc in Rhenium Beryllium (ReBe22) superconductor

   Hambisa, Teshome Kebede search by orcid ; Singh, P. ; Geffe, Chernet Amente

Abstract

The superconductivity of Rhenium Beryllium in two band model is theoretically studied using a standard model Hamiltonian which contains the Bardeen, Cooper and Schriefer, BCS type pairing interaction. Green function formalism was employed to obtain expression for superconducting order parameter in the bands, the coupling parameters and the superconducting critical temperature, T C , for this ReBe22 material. Our findings indicate, the enhancement of the superconducting critical temperature with the augmentation of the electron-phonon coupling strength in the entire system. The variation of the coupling parameter in the bands is understood as the reason for introducing a temperature gap and rising of the critical temperature suggesting significant upsurge at further scrutiny.

Publication:
   Materials Research Express, Volume 10, Issue 6, id.066001, 9 pp.
Pub Date:
   June 2023
https://ui.adsabs.harvard.edu/abs/2023MRE....10f6001H/abstract

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Jul 23, 2023 4:45 am

Don't need to belabor further revisions but added fixes for a couple of Superconductors (LBCO for example).

https://mega.nz/file/ekUzSBCT#AtURpYgisxHl4qLBTOL5b1nssEeATjkOoU0tQ_w1j2I

Just drop the current database and restore it from this file above:

DROP DATABASE Physics
GO
Then restore from downloaded file location.

Added in the counts of Atom in a formula. Could possibly add this to the detail so that it shows duplicates in a vertical form as well. Right now it is Mg2 = Mg and Count 2. May need to create Mg1 and Mg2 stacked.

Added in the two superconductors for Be mentioned above:

SELECT * FROM
[AtomicMilesMathisOrbitalsDetailAllBonds] where Formula like '%BeH8%'
Order by 1

It is looking fairly complete at this point and just needs challenges for corrections/outliers/problem children. Using this now for the graph dataframe in pandas-networkx...still working on it. The goal is transitive closure with all to all allowable links with Miles' bonding structures.
https://en.wikipedia.org/wiki/Transitive_closure
Miles Periodic Table with Standard Periodic Table reference - Page 8 Curren10

Want to do this with a Miles' Style:
Physics and chemistry
Graph theory is also used to study molecules in chemistry and physics. In condensed matter physics, the three-dimensional structure of complicated simulated atomic structures can be studied quantitatively by gathering statistics on graph-theoretic properties related to the topology of the atoms. Also, "the Feynman graphs and rules of calculation summarize quantum field theory in a form in close contact with the experimental numbers one wants to understand."[13] In chemistry a graph makes a natural model for a molecule, where vertices represent atoms and edges bonds. This approach is especially used in computer processing of molecular structures, ranging from chemical editors to database searching. In statistical physics, graphs can represent local connections between interacting parts of a system, as well as the dynamics of a physical process on such systems. Similarly, in computational neuroscience graphs can be used to represent functional connections between brain areas that interact to give rise to various cognitive processes, where the vertices represent different areas of the brain and the edges represent the connections between those areas. Graph theory plays an important role in electrical modeling of electrical networks, here, weights are associated with resistance of the wire segments to obtain electrical properties of network structures.[14] Graphs are also used to represent the micro-scale channels of porous media, in which the vertices represent the pores and the edges represent the smaller channels connecting the pores. Chemical graph theory uses the molecular graph as a means to model molecules. Graphs and networks are excellent models to study and understand phase transitions and critical phenomena. Removal of nodes or edges leads to a critical transition where the network breaks into small clusters which is studied as a phase transition. This breakdown is studied via percolation theory.[15]
https://en.wikipedia.org/wiki/Graph_theory

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Jul 23, 2023 6:08 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Execut10
The latest query has been executing for 7 and a half hours.

Hi Cr6, I'll try making sense of the superconductor information.

Downloaded and saved 20230723.bak to Backup folder.
Noticed that in the Backup folder its about 2.1 GB, three times larger than the previous backup.
Selected 20230723.bak as the ‘Physics’ bkup file.

Executed:
Code:
DROP DATABASE Physics
GO

I then restored Physics from the new backup.

Next, I tried executing:
Code:
SELECT * FROM
[AtomicMilesMathisOrbitalsDetailAllBonds] where Formula like '%BeH8%'
Order by 1

About 7 and a half hours later the query is still “Executing”.

My system shows 89.5 GB free. I'm optimistic, I’ll let it continue for another 6 hours before I stop it.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Jul 23, 2023 6:52 pm

Ouch. Yeah it should resolve in seconds. It is a bigger file. You may want to delete the dowloaded .bak files to free space or move them to a USB style plugin drive -thumb drive. Shocked.

If you have enough drive space, then maybe restart the server. Right-Click the server, click "Restart":

Miles Periodic Table with Standard Periodic Table reference - Page 8 Rightc10



Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Mon Jul 24, 2023 2:54 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Validb10
Everything appears to be running Ok.

Yesterday, I gave up at about 13 hours. This morning I did as you suggested - moving old bak files to external storage, and deleting them from my laptop; all but the previous and current bak files that is. After restarting the computer, my system showed 94.1 GB free; I'd cleaned up a mere 4.7 GB. As you may discern, I approached the problem query by degrees, with no problem. Now it executed, as you said, in seconds. "Restarting the server" is probably what did the trick.

Well, all that aside, lo and behold - in columns off to the right - I see all the bonding source and destination, proton neutron and electron positional data I’ve been begging for. All the molecule construction details needed for mBuilder to display any valid molecule.

Overwhelmed, again, I must re-familiarize myself with the data.

Cr6, this is a significant milestone. Thank you very much. Care to share any thoughts or considerations on the data? Its getting close to the point where I’ll have no alternative but to move to molecular graphs.

BasedPhysics provided a list of notebook project tasks he had identified and was involved in a couple of weeks ago in a comment to a new branch, “improving readability #6”.
https://github.com/LtAirman/ChargeFieldTopics/pull/6
The new branch appeared to be a draft pull request - not yet ready for merging. So I left it at that, without merging, and left him a message, thanking him for the update. By the way, I fully support his recommended changes. I hope I didn’t misunderstand and deny merging an actual PR.

BasedPhysics, if you are there, and would be so kind, please pipe-in.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Chromium6 likes this post

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Tue Jul 25, 2023 2:04 am

Sounds like progress LTAM! That's awesome that you are back in business.

Was looking at this SQL Server .dll plugin for Transitive Closure. It kind of works only with numeric values. Still looking at this as a possible surrogate for a full-blown Graph database port. It can kind of give insight into bonds but not the full paths-directions.
---------

https://mauridb.medium.com/transitive-closure-clustering-with-sql-server-uda-and-json-dade18953fd2
(has directions to install on SQL Server)

Compiled .dll from their github repository .cs file (run virus check if concerned):
https://mega.nz/file/X0UGhSgK#nyi2vuc48fZLiMHAHWNhL88UX2xGNmYsorADbZO7Y6U

Results look something like this...shows LTAMKeys that match up with a list of AtomicNumbers using the keys:

Select Distinct
-- AtomicNumberSrc, AtomicNumberDest,
LTAMKeySrc, LTAMKeyDest,

dbo.TCC([AtomicNumberSrc],[AtomicNumberDest]) as  AtomicNumbers ,
dbo.TCC([SlotNumberSrc],[SlotNumberDest]) as SlotBinds ,
dbo.TCC(Case [SlotSpinSrc] when 'A' then 1 when 'R' then 2 when 'L' then 3 end ,
        Case   [SlotSpinDest]  when 'A' then 1 when 'R' then 2 when 'L' then 3 end) SlotSpins,
dbo.TCC( [AlphaTypeSrc]  ,
           [AlphaTypeDest] ) AlphaTypes,
dbo.TCC( [NeutronsSrc]  ,
           [NeutronsDest] ) Neutrons,
dbo.TCC( [ProtonsSrc]  ,
           [ProtonsDest] ) Protons
 
FROM [dbo].[MathisNodesEdgesAllBinds]
where CanBindSrc = 1 and CanBindDest =1
GROUP BY --AtomicNumberSrc, AtomicNumberDest,
LTAMKeySrc, LTAMKeyDest
GO
Miles Periodic Table with Standard Periodic Table reference - Page 8 Tccdum10

Code:

LTAMKeySrc LTAMKeyDest AtomicNumbers SlotBinds SlotSpins AlphaTypes Neutrons Protons
A1Z2A A1Z2A {"0":[2,3,5,10,11,12,13,20,17]} {"0":[1]} {"0":[1]} {"0":[2,1]} {"0":[2]} {"0":[2]}
A1Z4A A1Z2A {"0":[3,6,4,20,2,5,12,17,11,13,10]} {"0":[1]} {"0":[1]} {"0":[1,2]} {"0":[2,6,5]} {"0":[2,4]}
A1Z6A A1Z2A {"0":[8,20,9,7,5,2,10,12,11,17,13,3]} {"0":[1]} {"0":[1]} {"0":[2,1]} {"0":[2,7,6]} {"0":[2,6]}
A2Y2A A1Z2A {"0":[20,21,19,18,16,2,14,11,22,23,24,25,26,27,28,5,29,30,10,31,32,33,3,12,17,13]} {"0":[1,2]} {"0":[1]} {"0":[2,1]} {"0":[2]} {"0":[2]}
A2Y4A A1Z2A {"0":[12,52,51,50,49,48,47,45,44,11,43,42,41,40,39,20,38,13,37,36,3,2,17,5,10]} {"0":[1,2]} {"0":[1]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
A2Y5A A1Z2A {"0":[11,66,63,13,62,59,67,58,57,69,10,68,3,20,12,5,2,17]} {"0":[1,2]} {"0":[1]} {"0":[2,5,1]} {"0":[2,5]} {"0":[2,5]}
A2Y6A A1Z2A {"0":[11,80,54,13,20,5,81,82,79,2,55,56,12,78,83,17,84,76,3,75,10,71,72,86,73,74]} {"0":[1,2]} {"0":[1]} {"0":[1,6,2,5]} {"0":[2,6,5]} {"0":[2,6]}
A3Y2A A1Z2A {"0":[12,16,31,26,24,19,11,28,30,15,3,22,18,17,21,10,23,20,13,27,29,25,14,32,5,2]} {"0":[1,3]} {"0":[1]} {"0":[2,1]} {"0":[2]} {"0":[2]}
A3Y4A A1Z2A {"0":[3,36,43,13,52,37,17,11,42,10,50,20,47,38,44,12,39,48,40,49,41,5,2]} {"0":[1,3]} {"0":[1]} {"0":[1,4,2]} {"0":[2,4]} {"0":[2,4]}
A3Y5A A1Z2A {"0":[12,65,58,3,66,20,57,64,10,63,67,17,5,13,2,11]} {"0":[1,3]} {"0":[1]} {"0":[2,5,1]} {"0":[2,5,4,6]} {"0":[2,5]}
A3Y6A A1Z2A {"0":[5,83,84,17,82,81,20,85,86,87,12,72,11,71,13,75,73,10,3,76,77,55,78,79,80,2,54,56]} {"0":[1,3]} {"0":[1]} {"0":[2,6,5,1]} {"0":[2,6]} {"0":[2,6]}
B10Z1R A1Z2A {"0":[3,59,5,60,2,27,17,28,13,58,57,11,20,12,10,41,42,43,46,45,44,26,21,25,22,24,23]} {"0":[1,10]} {"0":[1,2]} {"0":[1,2]} {"0":[0,2,1]} {"0":[1,2]}
B10Z2R A1Z2A {"0":[20,61,48,12,10,51,62,3,34,52,50,35,63,31,53,5,64,47,11,65,66,49,33,32,17,30,29,13,2]} {"0":[1,10]} {"0":[1,2]} {"0":[2,1]} {"0":[2]} {"0":[2]}
B10Z3R A1Z2A {"0":[17,84,83,78,73,13,74,75,11,72,10,3,82,5,77,76,20,85,12,67,71,2]} {"0":[1,10]} {"0":[1,2]} {"0":[2,3,1,4]} {"0":[2,3]} {"0":[2,3]}
B10Z4R A1Z2A {"0":[5,80,17,79,10,81,20,70,13,2,69,68,12,3,11]} {"0":[1,10]} {"0":[1,2]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
B10Z5R A1Z2A {"0":[3,87,13,88,11,86,12,17,89,5,90,2,10,20]} {"0":[1,10]} {"0":[1,2]} {"0":[1,5,2]} {"0":[2,5]} {"0":[2,5]}
B13Z1L A1Z2A {"0":[3,42,47,25,24,26,46,44,23,41,43,45,40,22]} {"0":[1,13]} {"0":[1,3]} {"0":[1]} {"0":[0,2,1]} {"0":[1,2]}
B13Z2L A1Z2A {"0":[10,59,5,2,60,58,52,17,57,30,11,31,50,53,61,29,20,28,72,35,13,49,32,34,33,48,62,27,73,75,51,3,12]} {"0":[1,13]} {"0":[1,3]} {"0":[2,1]} {"0":[2]} {"0":[2]}
B13Z3L A1Z2A {"0":[12,77,63,3,76,17,74,68,10,66,13,70,69,11,64,71,5,79,78,67,65,2,20]} {"0":[1,13]} {"0":[1,3]} {"0":[2,3,1]} {"0":[2,3]} {"0":[2,3]}
B13Z4L A1Z2A {"0":[13,81,11,10,80,20,2,17,5,12,3]} {"0":[1,13]} {"0":[1,3]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
B13Z5L A1Z2A {"0":[17,89,87,12,85,5,90,2,86,20,88,10,84,3,83,11,82,13]} {"0":[1,13]} {"0":[1,3]} {"0":[2,5,1]} {"0":[2,5]} {"0":[2,5]}
B15Y1R A1Z2A {"0":[11,50,3,30,61,12,44,17,38,43,2,10,24,13,5,46,40,42,20,25,56,41,45]} {"0":[1,15]} {"0":[1,2]} {"0":[2,1]} {"0":[0,2,1]} {"0":[1,2]}
B15Y2R A1Z2A {"0":[13,35,34,11,5,32,58,33,62,10,57,12,51,49,53,52,48,60,59,20,26,31,17,29,3,2,47,28]} {"0":[1,15]} {"0":[1,2]} {"0":[2,1]} {"0":[2]} {"0":[2]}
B15Y3R A1Z2A {"0":[3,65,64,63,67,10,17,2,76,75,74,77,73,11,12,71,72,5,20,13]} {"0":[1,15]} {"0":[1,2]} {"0":[1,3,2,4]} {"0":[2,3]} {"0":[2,3]}
B15Y4R A1Z2A {"0":[20,69,68,70,80,3,66,10,81,5,79,78,17,2,13,11,12]} {"0":[1,15]} {"0":[1,2]} {"0":[2,4,1,3]} {"0":[2,4]} {"0":[2,4]}
B15Y5R A1Z2A {"0":[3,85,90,86,89,17,84,88,13,82,83,11,87,10,20,2,12,5]} {"0":[1,15]} {"0":[1,2]} {"0":[1,5,2]} {"0":[2,5]} {"0":[2,5]}
B1Z1R A1Z2A {"0":[1,3]} {"0":[1]} {"0":[1,2]} {"0":[1]} {"0":[1,2]} {"0":[1,2]}
B3Y1R A1Z2A {"0":[3,8]} {"0":[1,3]} {"0":[1,2]} {"0":[1]} {"0":[1,2]} {"0":[1,2]}
B3Y2R A1Z2A {"0":[3,9]} {"0":[1,3]} {"0":[1,2]} {"0":[1]} {"0":[2]} {"0":[2]}
B4Z1L A1Z2A {"0":[3,16]} {"0":[1,4]} {"0":[1,3]} {"0":[1]} {"0":[1,2]} {"0":[1,2]}
B4Z2L A1Z2A {"0":[2,10,3,15,13,18,11,22,17,5,12,20]} {"0":[1,4]} {"0":[1,3]} {"0":[2,1]} {"0":[2]} {"0":[2]}
B4Z4L A1Z2A {"0":[13,36,11,17,2,10,20,5,3,12]} {"0":[1,4]} {"0":[1,3]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
B4Z6L A1Z2A {"0":[20,54,2,5,12,17,3,11,13,10]} {"0":[1,4]} {"0":[1,3]} {"0":[2,6,1]} {"0":[2,6]} {"0":[2,6]}
B7Y1R A1Z2A {"0":[5,15,13,3,20,11,12,17,2,10]} {"0":[1,7]} {"0":[1,2]} {"0":[1,2]} {"0":[1,2]} {"0":[1,2]}
B7Y2R A1Z2A {"0":[11,17,16,3,18,10,14,20,12,19,13,2,5]} {"0":[1,7]} {"0":[1,2]} {"0":[1,2]} {"0":[2]} {"0":[2]}
B7Y4R A1Z2A {"0":[10,39,38,5,40,11,37,13,41,17,3,36,20,12,2]} {"0":[1,7]} {"0":[1,2]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
B7Y6R A1Z2A {"0":[11,56,3,54,12,55,10,5,17,20,2,13]} {"0":[1,7]} {"0":[1,2]} {"0":[2,6,1]} {"0":[2,6,7]} {"0":[2,6]}
B8X1R A1Z2A {"0":[11,15,20,12,3,17,2,10,13,5]} {"0":[1,8]} {"0":[1,2]} {"0":[2,1]} {"0":[1,2]} {"0":[1,2]}
B8X2R A1Z2A {"0":[2,19,18,16,21,12,14,17,20,10,11,3,5,13]} {"0":[1,8]} {"0":[1,2]} {"0":[2,1]} {"0":[2]} {"0":[2]}
B8X4R A1Z2A {"0":[13,36,37,17,38,11,10,12,3,5,20,2]} {"0":[1,8]} {"0":[1,2]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
B8X6R A1Z2A {"0":[13,55,11,56,12,54,17,2,10,5,20,3]} {"0":[1,8]} {"0":[1,2]} {"0":[2,6,1]} {"0":[2,6]} {"0":[2,6]}
N2Y1R A1Z2A {"0":[3,6]} {"0":[1,2]} {"0":[1,2]} {"0":[1]} {"0":[0,2]} {"0":[1,2]}
N3Y1L A1Z2A {"0":[3,6]} {"0":[1,3]} {"0":[1,3]} {"0":[1]} {"0":[0,2]} {"0":[1,2]}
T11Z1R A1Z2A {"0":[3,40,41,42,22,23,43,24,44,25,47,46,45,26]} {"0":[1,11]} {"0":[1,2]} {"0":[1]} {"0":[0,2,1]} {"0":[1,2]}
T11Z2R A1Z2A {"0":[2,62,61,60,59,58,57,5,52,17,20,53,10,50,30,12,51,11,33,34,35,49,48,3,72,73,32,31,29,28,13,27,71]} {"0":[1,11]} {"0":[1,2]} {"0":[1,2,3]} {"0":[2]} {"0":[2]}
T11Z3R A1Z2A {"0":[2,74,10,70,69,68,67,12,66,65,63,64,13,75,76,77,78,5,17,79,3,20,11]} {"0":[1,11]} {"0":[1,2]} {"0":[2,3,1]} {"0":[2,3]} {"0":[2,3]}
T11Z4R A1Z2A {"0":[17,81,12,5,13,80,3,11,20,2,10]} {"0":[1,11]} {"0":[1,2]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
T11Z5R A1Z2A {"0":[13,85,86,2,83,84,12,82,20,87,3,11,89,10,88,90,17,5]} {"0":[1,11]} {"0":[1,2]} {"0":[2,5,1]} {"0":[2,5,4]} {"0":[2,5]}
T12Z1L A1Z2A {"0":[3,58,45,23,60,12,28,13,46,5,10,57,44,25,43,17,42,2,22,20,24,11,26,59]} {"0":[1,12]} {"0":[1,3]} {"0":[1,2]} {"0":[0,2,1]} {"0":[1,2]}
T12Z2L A1Z2A {"0":[5,63,17,33,48,20,50,3,62,51,10,32,66,53,61,12,52,71,11,65,47,13,35,31,64,49,30,29,34,2]} {"0":[1,12]} {"0":[1,3]} {"0":[1,2,4]} {"0":[2]} {"0":[2]}
T12Z3L A1Z2A {"0":[20,76,74,83,84,11,78,12,77,72,82,73,85,67,75,17,13,10,5,2,3]} {"0":[1,12]} {"0":[1,3]} {"0":[2,3,1]} {"0":[2,3]} {"0":[2,3]}
T12Z4L A1Z2A {"0":[2,79,11,80,10,3,81,12,17,69,70,68,20,13,5]} {"0":[1,12]} {"0":[1,3]} {"0":[1,4,2]} {"0":[2,4]} {"0":[2,4]}
T12Z5L A1Z2A {"0":[17,86,11,87,88,89,90,13,12,2,10,5,20,3]} {"0":[1,12]} {"0":[1,3]} {"0":[2,5,1]} {"0":[2,6,5]} {"0":[2,5]}
T14Y1L A1Z2A {"0":[3,29,13,30,2,39,5,50,20,25,47,10,61,24,12,23,21,60,59,58,57,56,37,17,44,11,43,45,42,41,46,40,38]} {"0":[1,14]} {"0":[1,3]} {"0":[1,2]} {"0":[0,2,1]} {"0":[1,2]}
T14Y2L A1Z2A {"0":[2,33,32,34,31,35,3,26,27,28,5,49,48,51,52,53,20,10,64,63,12,62,11,71,65,17,13]} {"0":[1,14]} {"0":[1,3]} {"0":[1,2,3]} {"0":[2]} {"0":[2]}
T14Y3L A1Z2A {"0":[2,72,73,74,75,76,77,20,79,3,10,11,13,66,67,68,69,70,5,12,17]} {"0":[1,14]} {"0":[1,3]} {"0":[2,3,1]} {"0":[2,3]} {"0":[2,3]}
T14Y4L A1Z2A {"0":[5,78,80,17,81,10,20,13,11,3,12,2]} {"0":[1,14]} {"0":[1,3]} {"0":[2,3,4,1]} {"0":[2,4]} {"0":[2,4]}
T14Y5L A1Z2A {"0":[13,89,90,88,87,86,17,11,83,85,20,82,84,10,12,2,3,5]} {"0":[1,14]} {"0":[1,3]} {"0":[2,5,1]} {"0":[2,5]} {"0":[2,5]}
T2Y1L A1Z2A {"0":[3,7,8,9]} {"0":[1,2]} {"0":[1,3]} {"0":[1]} {"0":[0,2,1]} {"0":[1,2]}
T5Z1R A1Z2A {"0":[3,16]} {"0":[1,5]} {"0":[1,2]} {"0":[1]} {"0":[1,2]} {"0":[1,2]}
T5Z2R A1Z2A {"0":[5,13,11,10,20,21,3,23,19,18,22,17,12,2]} {"0":[1,5]} {"0":[1,2]} {"0":[2,1]} {"0":[2]} {"0":[2]}
T5Z4R A1Z2A {"0":[17,39,3,37,12,36,20,10,11,2,5,13]} {"0":[1,5]} {"0":[1,2]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
T5Z6R A1Z2A {"0":[2,54,12,55,13,17,10,3,11,5,20]} {"0":[1,5]} {"0":[1,2]} {"0":[2,6,1]} {"0":[2,6]} {"0":[2,6]}
T6Y1L A1Z2A {"0":[3,15,12,13,20,10,2,5,17,11]} {"0":[1,6]} {"0":[1,3]} {"0":[1,2]} {"0":[1,2]} {"0":[1,2]}
T6Y2L A1Z2A {"0":[14,20,2,12,10,18,16,11,19,5,17,13,3]} {"0":[1,6]} {"0":[1,3]} {"0":[2,1]} {"0":[2]} {"0":[2]}
T6Y4L A1Z2A {"0":[13,40,10,39,11,36,38,37,17,2,3,5,20,12]} {"0":[1,6]} {"0":[1,3]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
T6Y6L A1Z2A {"0":[17,54,55,20,56,11,10,5,3,13,2,12]} {"0":[1,6]} {"0":[1,3]} {"0":[2,6,1]} {"0":[2,6]} {"0":[2,6]}
T9X1L A1Z2A {"0":[2,15,12,3,10,13,17,11,20,5]} {"0":[1,9]} {"0":[1,3]} {"0":[2,1]} {"0":[1,2]} {"0":[1,2]}
T9X2L A1Z2A {"0":[12,21,10,19,18,3,13,14,16,17,11,20,5,2]} {"0":[1,9]} {"0":[1,3]} {"0":[2,1]} {"0":[2]} {"0":[2]}
T9X4L A1Z2A {"0":[5,37,36,38,11,10,12,17,20,3,2,13]} {"0":[1,9]} {"0":[1,3]} {"0":[2,4,1]} {"0":[2,4]} {"0":[2,4]}
T9X6L A1Z2A {"0":[13,55,56,2,3,54,12,11,20,10,17,5]} {"0":[1,9]} {"0":[1,3]} {"0":[2,6,1]} {"0":[2,6]} {"0":[2,6]}
A1Z2A A1Z4A {"0":[2,4,3,5,10,6,11,12,13,20,17]} {"0":[1]} {"0":[1]} {"0":[1,2]} {"0":[2,5,6]} {"0":[2,4]}
A1Z4A A1Z4A {"0":[6,4]} {"0":[1]} {"0":[1]} {"0":[2,1]} {"0":[6,5]} {"0":[4]}
A1Z6A A1Z4A {"0":[6,8,7,9,4]} {"0":[1]} {"0":[1]} {"0":[2,1]} {"0":[6,7,5]} {"0":[4,6]}
A2Y2A A1Z4A {"0":[4,16,24,25,14,26,23,22,27,28,29,21,30,31,18,20,32,33,19,6]} {"0":[1,2]} {"0":[1]} {"0":[1,2]} {"0":[2,5,6]} {"0":[2,4]}
A2Y4A A1Z4A {"0":[6,51,4,41,42,52,48,40,43,49,37,50,39,47,36,44,38,45]} {"0":[1,2]} {"0":[1]} {"0":[2,4,1]} {"0":[4,6,5]} {"0":[4]}
A2Y5A A1Z4A {"0":[6,62,63,59,4,67,68,66,69,58,57]} {"0":[1,2]} {"0":[1]} {"0":[2,5,1]} {"0":[5,6]} {"0":[4,5]}
A2Y6A A1Z4A {"0":[6,73,4,74,54,55,75,80,82,83,86,56,79,84,72,76,78,81,71]} {"0":[1,2]} {"0":[1]} {"0":[2,6,1,5]} {"0":[6,5]} {"0":[4,6]}
A3Y2A A1Z4A {"0":[4,16,14,15,18,6,30,32,31,19,29,20,21,22,28,23,24,25,27,26]} {"0":[1,3]} {"0":[1]} {"0":[1,2]} {"0":[2,5,6]} {"0":[2,4]}
A3Y4A A1Z4A {"0":[6,50,49,4,52,36,37,38,48,39,47,44,43,42,40,41]} {"0":[1,3]} {"0":[1]} {"0":[1,4,2]} {"0":[4,5,6]} {"0":[4]}
A3Y5A A1Z4A {"0":[4,58,63,57,6,64,65,66,67]} {"0":[1,3]} {"0":[1]} {"0":[1,5,2]} {"0":[5,6,4]} {"0":[4,5]}
A3Y6A A1Z4A {"0":[4,81,76,77,84,75,73,78,82,72,71,79,80,85,83,6,87,54,86,55,56]} {"0":[1,3]} {"0":[1]} {"0":[1,6,5,2]} {"0":[5,6]} {"0":[4,6]}
B10Z1R A1Z4A {"0":[4,28,27,26,41,25,6,24,23,42,22,21,43,44,45,46,60,59,58,57]} {"0":[1,10]} {"0":[1,2]} {"0":[1,2]} {"0":[1,5,0,6]} {"0":[1,4]}
B10Z2R A1Z4A {"0":[4,35,34,61,33,6,53,32,62,31,52,30,29,63,64,51,65,50,66,49,47,48]} {"0":[1,10]} {"0":[1,2]} {"0":[1,2]} {"0":[2,5,6]} {"0":[2,4]}
B10Z3R A1Z4A {"0":[4,84,85,83,82,78,77,76,75,74,73,72,71,67,6]} {"0":[1,10]} {"0":[1,2]} {"0":[1,3,4,2]} {"0":[3,5,6]} {"0":[3,4]}
B10Z4R A1Z4A {"0":[4,80,79,81,70,69,68,6]} {"0":[1,10]} {"0":[1,2]} {"0":[1,4,2]} {"0":[4,5,6]} {"0":[4]}
B10Z5R A1Z4A {"0":[6,90,89,88,87,86,4]} {"0":[1,10]} {"0":[1,2]} {"0":[2,5,1]} {"0":[5,6]} {"0":[4,5]}
B13Z1L A1Z4A {"0":[4,40,26,25,41,24,23,42,22,43,44,45,46,47]} {"0":[1,13]} {"0":[1,3]} {"0":[1]} {"0":[0,5,1]} {"0":[1,4]}
B13Z2L A1Z4A {"0":[6,61,28,75,62,73,29,27,72,60,31,59,32,30,58,57,53,52,33,51,50,49,34,48,35,4]} {"0":[1,13]} {"0":[1,3]} {"0":[2,1]} {"0":[2,6,5]} {"0":[2,4]}
B13Z3L A1Z4A {"0":[4,78,77,79,76,6,63,64,65,71,74,66,70,69,67,68]} {"0":[1,13]} {"0":[1,3]} {"0":[1,3,2]} {"0":[3,5,6]} {"0":[3,4]}
B13Z4L A1Z4A {"0":[4,81,6,80]} {"0":[1,13]} {"0":[1,3]} {"0":[1,4,2]} {"0":[4,5,6]} {"0":[4]}
B13Z5L A1Z4A {"0":[6,90,89,82,88,4,87,86,83,84,85]} {"0":[1,13]} {"0":[1,3]} {"0":[2,5,1]} {"0":[5,6]} {"0":[4,5]}
B15Y1R A1Z4A {"0":[4,46,17,45,44,56,61,43,40,20,25,12,6,30,50,42,38,24,41]} {"0":[1,15]} {"0":[1,2]} {"0":[1,2]} {"0":[0,5,1,6]} {"0":[1,4]}
B15Y2R A1Z4A {"0":[4,47,26,53,52,48,51,6,58,59,57,60,62,49,35,34,29,33,31,32,28]} {"0":[1,15]} {"0":[1,2]} {"0":[1,2]} {"0":[2,6,5]} {"0":[2,4]}
B15Y3R A1Z4A {"0":[6,72,71,73,74,75,67,65,76,64,4,63,77]} {"0":[1,15]} {"0":[1,2]} {"0":[2,3,4,1]} {"0":[3,6,5]} {"0":[3,4]}
B15Y4R A1Z4A {"0":[4,79,80,6,78,81,66,70,68,69]} {"0":[1,15]} {"0":[1,2]} {"0":[2,3,1,4]} {"0":[4,5,6]} {"0":[4]}
B15Y5R A1Z4A {"0":[6,82,83,84,85,86,87,88,89,90,4]} {"0":[1,15]} {"0":[1,2]} {"0":[2,5,1]} {"0":[5,6]} {"0":[4,5]}
B1Z1R A1Z4A {"0":[1,4]} {"0":[1]} {"0":[1,2]} {"0":[1]} {"0":[1,5]} {"0":[1,4]}
B3Y1R A1Z4A {"0":[4,8]} {"0":[1,3]} {"0":[1,2]} {"0":[1]} {"0":[1,5]} {"0":[1,4]}
B3Y2R A1Z4A {"0":[4,9]} {"0":[1,3]} {"0":[1,2]} {"0":[1]} {"0":[2,5]} {"0":[2,4]}
B4Z1L A1Z4A {"0":[4,16]} {"0":[1,4]} {"0":[1,3]} {"0":[1]} {"0":[1,5]} {"0":[1,4]}
B4Z2L A1Z4A {"0":[6,22,4,18,15,10]} {"0":[1,4]} {"0":[1,3]} {"0":[2,1]} {"0":[2,6,5]} {"0":[2,4]}
B4Z4L A1Z4A {"0":[4,36,6]} {"0":[1,4]} {"0":[1,3]} {"0":[1,4,2]} {"0":[4,5,6]} {"0":[4]}
B4Z6L A1Z4A {"0":[4,54,6]} {"0":[1,4]} {"0":[1,3]} {"0":[1,6,2]} {"0":[5,6]} {"0":[4,6]}
B7Y1R A1Z4A {"0":[4,15,6,13]} {"0":[1,7]} {"0":[1,2]} {"0":[1,2]} {"0":[1,5,6]} {"0":[1,4]}
B7Y2R A1Z4A {"0":[6,19,18,17,16,14,4]} {"0":[1,7]} {"0":[1,2]} {"0":[2,1]} {"0":[2,6,5]} {"0":[2,4]}
B7Y4R A1Z4A {"0":[4,36,37,41,38,6,39,40]} {"0":[1,7]} {"0":[1,2]} {"0":[1,4,2]} {"0":[4,5,6]} {"0":[4]}
B7Y6R A1Z4A {"0":[4,56,55,54,6]} {"0":[1,7]} {"0":[1,2]} {"0":[1,6,2]} {"0":[5,6,7]} {"0":[4,6]}
B8X1R A1Z4A {"0":[6,15,4]} {"0":[1,8]} {"0":[1,2]} {"0":[2,1]} {"0":[1,6,5]} {"0":[1,4]}
B8X2R A1Z4A {"0":[4,21,14,6,19,16,18]} {"0":[1,8]} {"0":[1,2]} {"0":[1,2]} {"0":[2,5,6]} {"0":[2,4]}
B8X4R A1Z4A {"0":[6,37,38,36,4]} {"0":[1,8]} {"0":[1,2]} {"0":[2,4,1]} {"0":[4,6,5]} {"0":[4]}
B8X6R A1Z4A {"0":[4,56,55,54,6]} {"0":[1,8]} {"0":[1,2]} {"0":[1,6,2]} {"0":[5,6]} {"0":[4,6]}
N2Y1R A1Z4A {"0":[4,6]} {"0":[1,2]} {"0":[1,2]} {"0":[1]} {"0":[0,5]} {"0":[1,4]}
N3Y1L A1Z4A {"0":[4,6]} {"0":[1,3]} {"0":[1,3]} {"0":[1]} {"0":[0,5]} {"0":[1,4]}
T11Z1R A1Z4A {"0":[4,26,25,24,23,22,40,41,42,43,44,45,46,47]} {"0":[1,11]} {"0":[1,2]} {"0":[1]} {"0":[1,5,0]} {"0":[1,4]}
T11Z2R A1Z4A {"0":[6,51,52,50,49,53,48,35,34,57,58,59,60,61,62,33,32,31,30,29,28,27,4,73,72,71]} {"0":[1,11]} {"0":[1,2]} {"0":[2,1,3]} {"0":[2,6,5]} {"0":[2,4]}
T11Z3R A1Z4A {"0":[4,65,64,66,67,68,69,70,63,74,75,76,77,78,79,6]} {"0":[1,11]} {"0":[1,2]} {"0":[1,3,2]} {"0":[3,5,6]} {"0":[3,4]}
T11Z4R A1Z4A {"0":[6,80,4,81]} {"0":[1,11]} {"0":[1,2]} {"0":[2,4,1]} {"0":[4,6,5]} {"0":[4]}
T11Z5R A1Z4A {"0":[4,82,83,84,6,90,85,86,87,88,89]} {"0":[1,11]} {"0":[1,2]} {"0":[2,5,1]} {"0":[5,6,4]} {"0":[4,5]}
T12Z1L A1Z4A {"0":[4,57,22,58,23,24,59,42,25,26,43,60,44,45,6,28,46]} {"0":[1,12]} {"0":[1,3]} {"0":[1,2]} {"0":[1,6,0,5]} {"0":[1,4]}
T12Z2L A1Z4A {"0":[4,51,52,71,53,50,66,65,49,6,64,63,62,48,61,47,35,34,33,32,29,30,31]} {"0":[1,12]} {"0":[1,3]} {"0":[1,2,4]} {"0":[2,5,6]} {"0":[2,4]}
T12Z3L A1Z4A {"0":[6,82,78,83,77,84,76,75,85,74,73,72,4,67]} {"0":[1,12]} {"0":[1,3]} {"0":[2,3,1]} {"0":[3,6,5]} {"0":[3,4]}
T12Z4L A1Z4A {"0":[6,70,69,81,4,68,80,79]} {"0":[1,12]} {"0":[1,3]} {"0":[2,4,1]} {"0":[4,6,5]} {"0":[4]}
T12Z5L A1Z4A {"0":[6,88,87,86,89,90,4]} {"0":[1,12]} {"0":[1,3]} {"0":[2,5,1]} {"0":[5,6]} {"0":[4,5]}
T14Y1L A1Z4A {"0":[4,61,60,25,24,23,59,29,21,30,20,6,50,47,39,58,57,37,38,13,46,45,44,43,42,41,12,40,56]} {"0":[1,14]} {"0":[1,3]} {"0":[1,2]} {"0":[0,5,6,1]} {"0":[1,4]}
T14Y2L A1Z4A {"0":[4,64,34,33,32,52,31,6,71,26,63,62,51,65,53,35,49,48,28,27]} {"0":[1,14]} {"0":[1,3]} {"0":[1,2,3]} {"0":[2,5,6]} {"0":[2,4]}
T14Y3L A1Z4A {"0":[4,66,67,68,69,70,72,73,74,75,76,77,79,6]} {"0":[1,14]} {"0":[1,3]} {"0":[1,3,2]} {"0":[3,5,6]} {"0":[3,4]}
T14Y4L A1Z4A {"0":[4,78,80,81,6]} {"0":[1,14]} {"0":[1,3]} {"0":[1,3,4,2]} {"0":[4,5,6]} {"0":[4]}
T14Y5L A1Z4A {"0":[6,88,87,86,85,84,4,90,89,83,82]} {"0":[1,14]} {"0":[1,3]} {"0":[2,5,1]} {"0":[5,6]} {"0":[4,5]}
T2Y1L A1Z4A {"0":[4,7,8,9]} {"0":[1,2]} {"0":[1,3]} {"0":[1]} {"0":[0,5,1]} {"0":[1,4]}
T5Z1R A1Z4A {"0":[4,16]} {"0":[1,5]} {"0":[1,2]} {"0":[1]} {"0":[1,5]} {"0":[1,4]}
T5Z2R A1Z4A {"0":[6,18,19,21,13,22,23,11,10,4]} {"0":[1,5]} {"0":[1,2]} {"0":[2,1]} {"0":[2,6,5]} {"0":[2,4]}
T5Z4R A1Z4A {"0":[6,39,4,37,36]} {"0":[1,5]} {"0":[1,2]} {"0":[2,4,1]} {"0":[4,6,5]} {"0":[4]}
T5Z6R A1Z4A {"0":[6,54,4,55]} {"0":[1,5]} {"0":[1,2]} {"0":[2,6,1]} {"0":[6,5]} {"0":[4,6]}
T6Y1L A1Z4A {"0":[4,13,15,6]} {"0":[1,6]} {"0":[1,3]} {"0":[1,2]} {"0":[1,5,6]} {"0":[1,4]}
T6Y2L A1Z4A {"0":[4,14,19,18,6,16]} {"0":[1,6]} {"0":[1,3]} {"0":[1,2]} {"0":[2,5,6]} {"0":[2,4]}
T6Y4L A1Z4A {"0":[6,36,37,38,39,4,40]} {"0":[1,6]} {"0":[1,3]} {"0":[2,4,1]} {"0":[4,6,5]} {"0":[4]}
T6Y6L A1Z4A {"0":[6,54,4,55,56]} {"0":[1,6]} {"0":[1,3]} {"0":[2,6,1]} {"0":[6,5]} {"0":[4,6]}
T9X1L A1Z4A {"0":[6,15,4]} {"0":[1,9]} {"0":[1,3]} {"0":[2,1]} {"0":[1,6,5]} {"0":[1,4]}
T9X2L A1Z4A {"0":[6,16,18,14,19,21,4]} {"0":[1,9]} {"0":[1,3]} {"0":[2,1]} {"0":[2,6,5]} {"0":[2,4]}
T9X4L A1Z4A {"0":[6,36,37,38,4]} {"0":[1,9]} {"0":[1,3]} {"0":[2,4,1]} {"0":[4,6,5]} {"0":[4]}
T9X6L A1Z4A {"0":[6,54,55,56,4]} {"0":[1,9]} {"0":[1,3]} {"0":[2,6,1]} {"0":[6,5]} {"0":[4,6]}
A1Z2A A1Z6A {"0":[2,8,7,5,9,17,20,10,11,12,13]} {"0":[1]} {"0":[1]} {"0":[2]} {"0":[2,6,7]} {"0":[2,6]}
A1Z4A A1Z6A {"0":[6,8,9,7]} {"0":[1]} {"0":[1]} {"0":[2]} {"0":[6,7]} {"0":[4,6]}
A1Z6A A1Z6A {"0":[7,8,9]} {"0":[1]} {"0":[1]} {"0":[2]} {"0":[7,6]} {"0":[6]}
A2Y2A A1Z6A {"0":[7,14,8,27,32,9,18,19,26,28,25,24,29,31,20,33,21,30,23,22,16]} {"0":[1,2]} {"0":[1]} {"0":[2]} {"0":[2,7,6]} {"0":[2,6]}
A2Y4A A1Z6A {"0":[7,48,45,41,47,8,43,37,36,50,9,42,49,52,38,44,39,40,51]} {"0":[1,2]} {"0":[1]} {"0":[2,4]} {"0":[4,7,6]} {"0":[4,6]}
A2Y5A A1Z6A {"0":[7,69,66,68,67,58,59,8,62,57,63,9]} {"0":[1,2]} {"0":[1]} {"0":[2,5]} {"0":[5,7,6]} {"0":[5,6]}
A2Y6A A1Z6A {"0":[7,84,72,79,56,80,83,55,81,8,71,9,74,75,76,73,78,54,82,86]} {"0":[1,2]} {"0":[1]} {"0":[2,6,5]} {"0":[6,7,5]} {"0":[6]}
A3Y2A A1Z6A {"0":[7,31,27,8,32,26,30,28,29,25,16,24,19,23,18,9,22,21,20,14,15]} {"0":[1,3]} {"0":[1]} {"0":[2]} {"0":[2,7,6]} {"0":[2,6]}
A3Y4A A1Z6A {"0":[8,39,38,40,7,49,48,37,36,41,47,42,52,9,44,43,50]} {"0":[1,3]} {"0":[1]} {"0":[2,4]} {"0":[4,7,6]} {"0":[4,6]}
A3Y5A A1Z6A {"0":[8,63,64,65,66,9,67,58,7,57]} {"0":[1,3]} {"0":[1]} {"0":[2,5]} {"0":[5,7,4,6]} {"0":[5,6]}
A3Y6A A1Z6A {"0":[7,87,86,85,84,83,82,81,80,79,78,77,76,75,9,73,72,71,56,55,54,8]} {"0":[1,3]}
--Snip at 2,670 rows total

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Tue Jul 25, 2023 2:28 am

With the TCC assembly, this is where I'm trying to go with it. This is really "alpha" at the moment but will refactor the query to tighten it if possible. Basically, create several datasets like AtomicNumber-Slots, AtomicNumber-Alphas, AtomicNumber-SlotDirection, etc. and link them using rules per Miles-LTAMkey. Could get us there. May just need to port it to a full graph database if it can't get it fully there at some point:
Code:
WITH cte AS
(
SELECT
   AtomicNumber,
   dbo.TCC(AtomicNumber, SlotNumber)  AS Result
 
        FROM [dbo].[VwMilesMathisPeriodicTable] A
      WHERE
(A.SlotNumber not in (17,19)) --and A.SlotNumber = B.SlotNumberSrc
--and A.AtomicNumber = B.AtomicNumberSrc
--and A.AlphaType >= B.AlphaTypeSrc
-- and (B.SlotSpinDest <> 'N' and B.SlotSpinDest <> 'N')
--and (B.CanBindDest = 1 and B.CanBindSrc = 1)
and AlphaType > 0
GROUP BY AtomicNumber
),
cte2 AS (
SELECT
   AtomicNumber,
    CAST(J2.[value] AS INT) AS SlotNumberBinding
FROM
    cte
CROSS APPLY
    OPENJSON(cte.[result]) J1
CROSS APPLY
    OPENJSON(j1.[value]) J2
)
SELECT
*
FROM
cte2
GO

Code:

AtomicNumber   SlotNumberBinding
1   1
2   1
2   2
3   1
3   3
4   1
4   4
4   5
5   1
5   5
5   2
6   1
6   6
6   2
6   3
6   7
7   1
7   7
7   2
7   14
7   15
8   1
8   8
8   2
8   3
8   14
8   15
9   3
9   9
9   2
9   1
10   1
10   10
10   2
10   3
10   4
10   5
11   1
11   11
11   2
11   3
11   4
11   5
11   15
12   1
12   12
12   2
12   3
12   4
12   5
12   14
12   15
13   13
13   14
13   7
13   6
13   5
13   4
13   3
13   2
13   1


Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Wed Jul 26, 2023 9:13 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Lbco10
Cr6 wrote. Sounds like progress LTAM! That's awesome that you are back in business.
Airman. Its progress alright. I'll try to keep up.  

Cr6 wrote. Don't need to belabor further revisions but added fixes for a couple of Superconductors (LBCO for example).
Airman. Copy that. As I see it, from AtomicMilesMathisOrbitalsDetailAllBonds, our current number of valid bonds (between two atoms, where CanBindSrc=1 and CanBindDest=1 and IsValid=1) is 291,619. Executing in about 26 seconds.

Some discussion. The image shows a portion of the output when querying for formula ‘LBCO’. 18 rows and 182 columns containing CurrentAtom=B, NextAtom1=C, and NextAtom3=O. Boron, Carbon and Oxygen. Every row is an alternate possible bond between two of those three atoms. Looks like there can be several solutions. Which rows are needed to satisfy the formula? I guess all the rows need to be verified.  

Why is NextAtom2 always NULL?

‘LBCO’. There’s no single uppercase atomic symbol ‘L’ without a following lower case character, (such as with La, Li, Lu). What does the L indicate? Ordering all valid bonds by formula – I saw ‘LBCO’ is the only formula with a single ‘L’ prefix, at position 228,018, just after 38 rows of alternative possible bonds between Lanthium and Thallium, formula ‘LaTl3’. I suppose a ‘formula’ name can have some unique attributes(?) or its own rules.

Cr6 wrote. Added in the counts of Atom in a formula. Could possibly add this to the detail so that it shows duplicates in a vertical form as well. Right now it is Mg2 = Mg and Count 2. May need to create Mg1 and Mg2 stacked.
Airman. Here's an example, Li2O3Zr, rows 228,187 – 228,220. Thirty-three rows to identify 5 bonds between Lithium, Oxygen and Zirconium. I see columns: CurrentAtomCount=2, NextAtom1Count=3, NextAtom2Count=1, … , NextAtom6Count=NULL. I don’t see any Li-Li or O-O bonds - that may be an error. Aside from the fact that every atom in a molecule needs to be tracked separately, I don’t understand why you mention showing duplicates in a vertical form or why you may need to “create Mg1 and Mg2 stacked”.

Cr6 wrote. It is looking fairly complete at this point and just needs challenges for corrections/outliers/problem children. Using this now for the graph dataframe in pandas-networkx...still working on it. The goal is transitive closure with all to all allowable links with Miles' bonding structures.
Airman. Alrighty. Wish I could help.

Cr6 wrote.  https://en.wikipedia.org/wiki/Transitive_closure
Airman. Reviewed the wiki page on Transitive Closure. As well as another link from wiki,
Transitive Closure and Reduction from the Stony Brook Algorithm Repository
https://algorist.com/problems/Transitive_Closure_and_Reduction.html
https://algorist.com/algorist.html
Input Description: A directed graph G=(V,E).
Problem: For transitive closure, construct a graph G′=(V,E′) with edge (i,j)∈E′ iff there is a directed path from i to j in G. For transitive reduction, construct a small graph G′=(V,E′) with a directed path from i to j in G′ iff (i,j)∈E.
Excerpt from The Algorithm Design Manual: Transitive closure can be thought of as establishing a data structure that makes it possible to solve reachability questions (can I get to x from y?) efficiently. After the preprocessing of constructing the transitive closure, all reachability queries can be answered in constant time by simply reporting a matrix entry. Transitive closure is fundamental in propagating the consequences of modified attributes of a graph G. For example, consider the graph underlying any spreadsheet model, where the vertices are cells and there is an edge from cell i to cell j if the result of cell j depends on cell i. When the value of a given cell is modified, the values of all reachable cells must also be updated. The identity of these cells is revealed by the transitive closure of G. Many database problems reduce to computing transitive closures, for analogous reasons.

Here’s another Transitive Closure link from the University of Edinburgh
Maintaining Transitive Closure of Graphs in SQL
https://homepages.inf.ed.ac.uk/libkin/papers/tc-sql.pdf

Cr6 wrote. https://mauridb.medium.com/transitive-closure-clustering-with-sql-server-uda-and-json-dade18953fd2
(has directions to install on SQL Server)

Compiled .dll from their github repository .cs file (run virus check if concerned):
https://mega.nz/file/X0UGhSgK#nyi2vuc48fZLiMHAHWNhL88UX2xGNmYsorADbZO7Y6U

Airman. I read Azure SQL product developer Davide Mauri’s 20 Oct 2017 Search Medium topic, “Transitive Closure Clustering with SQL Server, UDA and JSON, Calculating Transitive Closure Clusters using non-scalar UDA“. Eight minute read my eye.

I also have the associated github site https://github.com/yorek/non-scalar-uda-transitive-closure open. I see this Transitive-closure code tested good on SQL Server 2017. I don’t see which of the github files constitute “directions to install on SQL Server”.

I downloaded, virus-scanned and saved 'TransitiveClosureAggregatorLibrary.dll', a 12 KB file. Again, I don’t see the install directions you mentioned, where does this dll file go? How do I use it?

Cr6 wrote. Results look something like this...shows LTAMKeys that match up with a list of AtomicNumbers using the keys …
Airman. Ok.

Cr6 wrote. With the TCC assembly, this is where I'm trying to go with it. This is really "alpha" at the moment but will refactor the query to tighten it if possible. Basically, create several datasets like AtomicNumber-Slots, AtomicNumber-Alphas, AtomicNumber-SlotDirection, etc. and link them using rules per Miles-LTAMkey. Could get us there. May just need to port it to a full graph database if it can't get it fully there at some point:

Airman. Cr6, I guess I have a vague appreciation of  transitive-closure 'reachability' and why it's important. That a change to a single object will directly affect objects sharing a known valid transitive-closure relationship. But that's not at all clear. Can you describe how transitive-closure might be applied to a single molecule?
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Fri Jul 28, 2023 3:45 am

Hi LTAM,

This SQL file has the detail on running scripts to load the .dll into SQL Server. You'll need to map it to the physics database instead of the TransitiveClosure database in the source script. Also point to the .dll stored on your local drive (like C:\SQLServerDlls\filename.dll):
https://github.com/yorek/non-scalar-uda-transitive-closure/blob/master/SQL/00-Create-Database.sql
Code:


--Code Block to Run to allow custom assemblies in SQL Server--


/*
Enable SQLCLR on the database
*/
EXEC sp_configure 'clr enabled' , '1'; 
RECONFIGURE;
GO
EXEC sp_configure 'show advanced option', '1'; 
RECONFIGURE
GO


/*
For SQL Server 2017+
*/
EXEC sp_configure 'clr strict security', '0'
RECONFIGURE WITH OVERRIDE
GO


/*
Cleanup if needed
*/
DROP AGGREGATE IF EXISTS TCC
GO
DROP ASSEMBLY IF EXISTS [TransitiveClosure]
GO

/*
Create assembly and UDA
NOTE: make sure permission on the file let SQL Server to access it
*/
CREATE ASSEMBLY [TransitiveClosure]
FROM 'C:\pathtoDll\TransitiveClosureAggregatorLibrary.dll'
WITH PERMISSION_SET=SAFE
GO

CREATE AGGREGATE TCC(@id1 INT, @id2 INT) 
RETURNS NVARCHAR(MAX) 
EXTERNAL NAME [TransitiveClosure].[TransitiveClosure.Aggregate]; 
GO


For pivots, this script can be handy and I'm looking at using it in the primary table build. It takes about 2 minutes to resolve:
-------
Code:
--CREATE VIEW dbo.vwAtomicPivotedAtomCounts
--AS
SELECT TOP 100 PERCENT
P11.ID,
P11.ZMolecule,
P11.ZFormula,
MAX(P22.[1] ) as Atom1,
MAX(P22.[2] ) as Atom2,
MAX(P22.[3] ) as Atom3,
MAX(P22.[4] ) as Atom4,
MAX(P22.[5] ) as Atom5,
MAX(P22.[6] ) as Atom6,
MAX(P22.[7] ) as Atom7,
MAX(P22.[8] ) as Atom8,
MAX(P22.[9] ) as Atom9,
MAX(P22.[10]) as Atom10,  
MAX(P11.[1]) as  AtomNumberCount1,
MAX(P11.[2]) as  AtomNumberCount2,
MAX(P11.[3]) as  AtomNumberCount3,
MAX(P11.[4]) as  AtomNumberCount4,
MAX(P11.[5]) as  AtomNumberCount5,
MAX(P11.[6]) as  AtomNumberCount6,
MAX(P11.[7]) as  AtomNumberCount7,
MAX(P11.[8]) as  AtomNumberCount8,
MAX(P11.[9]) as  AtomNumberCount9,
MAX(P11.[10]) as AtomNumberCount10

FROM (


 SELECT *  FROM
 (
 SELECT   PivotTable1.*
 FROM
 (
   SELECT TOP 100 PERCENT ID, ZMolecule, ZelementNum, ZFormula,  ROW_NUMBER() OVER (Partition by ID Order by ZSeqNo) as ZOrder
    FROM [Physics].[dbo].[vwAtomic] order by ID, ZSeqNo
  ) X
 PIVOT( MAX(ZElementNum) FOR ZORDER in ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10]) ) as PivotTable1
 ) P1
) P11
INNER JOIN
(


 SELECT *  FROM
 (
 SELECT   PivotTable2.*
 FROM
 (
   SELECT TOP 100 PERCENT ID,  Zelement, AtomicNumber ,  ROW_NUMBER() OVER (Partition by ID Order by ZSeqNo) as ZOrder
    FROM [Physics].[dbo].[vwAtomic] order by ID, ZSeqNo
  ) X
 PIVOT( MAX(ZElement) FOR ZORDER in ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10]) ) as PivotTable2
 ) P2
) P22 on P11.ID = P22.ID
WHERE P11.ZMolecule not like '%|%' -- Extraneous Text
 GROUP BY P11.ID, P11.ZMolecule, P11.ZFormula
ORDER BY 1

Miles Periodic Table with Standard Periodic Table reference - Page 8 Pivotf10

Overall, I was looking at Transitive Closure for adding in the "next" atom per Miles and LTAMKey. Like here's the last "node-entity" what can still bind to it? Most molecules only go out to 7-8 joins max for the number of atoms bound together.

Here's the superconductors query for LBCO had to enter the full name for it-- the source used unconventional notation:

SELECT *
 FROM [Physics].[dbo].[AtomicMilesMathisOrbitalsDetailAllBonds]
 where Cast(ZID as varchar(15)) like '%.01'
 and Formula like '%LaBa%'
 order by Formula

--ZID Formula CurrentAtom NextAtom1 NextAtom2 NextAtom3 NextAtom4
--105272.01 LaBaCa2Cu4O2 Ba Ca Cu La O

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sat Jul 29, 2023 10:45 pm

.
Cr6, please verify my script changes to SQL/00-Create-Database.sql.

This first code block shows all my changes, comments and questions.
Code:
--  USE tempdb
USE Physics
GO
–  COMMENT. No need to use a tempdb. Changed to USE Physics.

/*
Create database
*/
--  IF DB_ID('TransitiveClosure') IS NOT NULL BEGIN
--   ALTER DATABASE [TransitiveClosure] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
--   DROP DATABASE [TransitiveClosure];
--  END
--  CREATE DATABASE [TransitiveClosure]
--  GO
--  USE [TransitiveClosure]
--  GO
– COMMENT. We’re not creating a db, we’re using Physics. I believe the ‘Create database’ script is not needed so I commented out that script, I would not include it as in the script block below.

/*
Enable SQLCLR on the database. No changes.
*/
EXEC sp_configure 'clr enabled' , '1';  
RECONFIGURE;
GO
EXEC sp_configure 'show advanced option', '1';  
RECONFIGURE
GO
– COMMENT. After USE Physics GO. I suppose Enable SQLCLR will be run as is.

/*
For SQL Server 2017.
*/
EXEC sp_configure 'clr strict security', '0'
RECONFIGURE WITH OVERRIDE
GO
– COMMENT. I assume the same SQL Server 2017 script applies to SQL Server 2019.

/*
Cleanup if needed.
*/
DROP AGGREGATE IF EXISTS TCC
GO
DROP ASSEMBLY IF EXISTS [Physics]
GO
– COMMENT. Database changed to Physics. This script is probably not needed.

/*
Create assembly and UDA
NOTE: make sure permission on the file let SQL Server to access it
*/
CREATE ASSEMBLY [Physics]
--  FROM 'd:\Work\github\non-scalar-uda-transitive-closure\TransitiveClosureAggregatorLibrary\
--  bin\Release\TransitiveClosureAggregatorLibrary.dll'
FROM ‘C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn\TransitiveClosureAggregatorLibrary.dll’
WITH PERMISSION_SET=SAFE
GO

CREATE AGGREGATE TCC(@id1 INT, @id2 INT)  
RETURNS NVARCHAR(MAX)  
EXTERNAL NAME [Physics].[Physics.Aggregate];  
GO
– COMMENT. TransitiveClosure has been changed to Physics in three places. The dll location is good for my machine. Is [Physics].[Physics.Aggregate] correct? I checked the TransitiveClosureAggregatorLibrary.dll properties/permissions - looked good to me.

This second code block is a clean version of just the scripts I believe I need to run. If you agree, I'll try executing it.
Code:
USE Physics
GO

/*
Enable SQLCLR on the database.
*/
EXEC sp_configure 'clr enabled' , '1';  
RECONFIGURE;
GO
EXEC sp_configure 'show advanced option', '1';  
RECONFIGURE
GO

/*
For SQL Server 2017.
*/
EXEC sp_configure 'clr strict security', '0'
RECONFIGURE WITH OVERRIDE
GO

/*
Create assembly and UDA. NOTE: make sure permission on the file let SQL Server to access it
*/
CREATE ASSEMBLY [Physics]
FROM ‘C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn\TransitiveClosureAggregatorLibrary.dll’
WITH PERMISSION_SET=SAFE
GO

CREATE AGGREGATE TCC(@id1 INT, @id2 INT)  
RETURNS NVARCHAR(MAX)  
EXTERNAL NAME [Physics].[Physics.Aggregate];  
GO

For reference, here are the current 182 column headers for the AtomicMilesMathisOrbitalsDetailAllBonds table.
Code:
ZID Formula CurrentAtom NextAtom1 NextAtom2 NextAtom3 NextAtom4 NextAtom5 NextAtom6 CurrentAtomCount NextAtom1Count NextAtom2Count NextAtom3Count NextAtom4Count NextAtom5Count NextAtom6Count LTAMKeySrc LTAMKeyDest AtomicNumberSrc AtomicNumberDest SlotDirectionElectronBond IsValid ElementSrc ElementDest CanBindSrc CanBindDest AlphaTypeSrc AlphaTypeDest SlotNumberSrc SlotNumberDest SlotSpinSrc SlotSpinDest AlphaTypeRemainderSrc AlphaTypeRemainderDest CarouselAlphaTypeSrc CarouselAlphaTypeDest AtomicSymbolSrc AtomicSymbolDest SlotOrienSrc SlotOrienDest NeutronsSrc NeutronsDest ElectronsSrc ElectronsDest ProtonsMMSrc ProtonsMMDest ProtonsSrc ProtonsDest PXSrc PYSrc PZSrc P2P3Src P12Src PESrc p1xSrc p1ySrc p1zSrc p2xSrc p2ySrc p2zSrc p3xSrc p3ySrc p3zSrc p4xSrc p4ySrc p4zSrc p5xSrc p5ySrc p5zSrc p6xSrc p6ySrc p6zSrc N1N2Src N1Src N2Src N3Src N4Src N5Src N6Src n1xSrc n1ySrc n1zSrc n2xSrc n2ySrc n2zSrc n3xSrc n3ySrc n3zSrc n4xSrc n4ySrc n4zSrc n5xSrc n5ySrc n5zSrc n6xSrc n6ySrc n6zSrc e1xSrc e1ySrc e1zSrc e2xSrc e2ySrc e2zSrc e3xSrc e3ySrc e3zSrc e4xSrc e4ySrc e4zSrc e5xSrc e5ySrc e5zSrc e6xSrc e6ySrc e6zSrc PXDest PYDest PZDest P2P3Dest P12Dest PEDest p1xDest p1yDest p1zDest p2xDest p2yDest p2zDest p3xDest p3yDest p3zDest p4xDest p4yDest p4zDest p5xDest p5yDest p5zDest p6xDest p6yDest p6zDest N1N2Dest N1Dest N2Dest N3Dest N4Dest N5Dest N6Dest n1xDest n1yDest n1zDest n2xDest n2yDest n2zDest n3xDest n3yDest n3zDest n4xDest n4yDest n4zDest n5xDest n5yDest n5zDest n6xDest n6yDest n6zDest e1xDest e1yDest e1zDest e2xDest e2yDest e2zDest e3xDest e3yDest e3zDest e4xDest e4yDest e4zDest e5xDest e5yDest e5zDest e6xDest e6yDest e6zDest
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sat Jul 29, 2023 11:20 pm

Hi LTAM,

Yes, that looks like it should work. Here's another step-by-step from SQLshack. This is a good site for how-tos. This has scripts for enabling CLR:
https://www.sqlshack.com/getting-started-with-sql-server-clr-functions/

You can always do "DROP Assembly MyAssemblyName (like "TransitiveClosure") if you need to rerun it.

On a prod server, enabling CLR can be a risk...on our local developer SQL servers it shouldn't be a problem.

This is the script I'm trying out at the moment. Takes about 3+ minutes to run and returns about 6 million rows:

Code:

--CREATE View [dbo].[MathisGraphBondsTCC]
--as
SELECT Distinct *
FROM(
      Select Distinct
      ElementSrc, ElementDest,
      AtomicNumberSrc, AtomicNumberDest,
      LTAMKeySrc, LTAMKeyDest,
   
      dbo.TCC([AtomicNumberSrc],[AtomicNumberDest]) as  AtomicNumbers ,
      dbo.TCC([SlotNumberSrc],[SlotNumberDest]) as SlotBinds ,
      dbo.TCC(Case [SlotSpinSrc] when 'A' then 1 when 'R' then 2 when 'L' then 3 end ,
               Case  [SlotSpinDest]  when 'A' then 1 when 'R' then 2 when 'L' then 3 end) SlotSpins,
      dbo.TCC( [AlphaTypeSrc]  ,
               [AlphaTypeDest] ) AlphaTypes,
      dbo.TCC( [NeutronsSrc]  ,
               [NeutronsDest] ) Neutrons,
      dbo.TCC( [ProtonsSrc]  ,
               [ProtonsDest] ) Protons
 
      FROM [dbo].[MathisNodesEdgesAllBinds]
      where CanBindSrc = 1 and CanBindDest =1
      GROUP BY  AtomicNumberSrc, AtomicNumberDest,
      LTAMKeySrc, LTAMKeyDest,ElementSrc, ElementDest
   ) A
   cross apply
   openjson(A.AtomicNumbers) A1
cross apply
   openjson(A.SlotBinds) SB
cross apply
   openjson(A.SlotSpins) SS
cross apply
   openjson(A.AlphaTypes) ATs
cross apply
   openjson(A.Neutrons) Ns
cross apply
   openjson(A.Protons) Ps
cross apply
   openjson(A1.value) A2
cross apply
   openjson(SB.value) SB2
cross apply
   openjson(SS.value) SS2
cross apply
   openjson(ATs.value) ATs2
cross apply
   openjson(Ns.value) Ns2
cross apply
   openjson(Ps.value) Ps2

GO



Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Jul 30, 2023 11:23 am

.
Cr6, I've hit a snag. Here's the code used:
Code:

USE Physics
GO

/*
Enable SQLCLR on the database.
*/
EXEC sp_configure 'clr enabled' , '1';  
RECONFIGURE;
GO
EXEC sp_configure 'show advanced option', '1';  
RECONFIGURE
GO

/*
For SQL Server 2017.
*/
EXEC sp_configure 'clr strict security', '0'
RECONFIGURE WITH OVERRIDE
GO

/*
Create assembly and UDA. NOTE: make sure permission on the file let SQL Server to access it
*/
CREATE ASSEMBLY [Physics]
FROM 'c:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Binn\TransitiveClosureAggregatorLibrary.dll'
WITH PERMISSION_SET=SAFE
GO

CREATE AGGREGATE TCC(@id1 INT, @id2 INT)  
RETURNS NVARCHAR(MAX)  
EXTERNAL NAME [Physics].[Physics.Aggregate];  
GO

Here's the Output:
Code:

Configuration option 'clr enabled' changed from 0 to 1. Run the RECONFIGURE statement to install.
Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
Configuration option 'clr strict security' changed from 1 to 0. Run the RECONFIGURE statement to install.
Msg 6556, Level 16, State 1, Line 29
CREATE AGGREGATE failed because it could not find type 'Physics.Aggregate' in assembly 'TransitiveClosureAggregatorLibrary'.
Msg 6597, Level 16, State 2, Line 29
CREATE AGGREGATE failed.

Completion time: 2023-07-30T08:10:47.1531548-07:00
Configuration option 'clr enabled' changed from 0 to 1. Run the RECONFIGURE statement to install.
Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
Configuration option 'clr strict security' changed from 1 to 0. Run the RECONFIGURE statement to install.
Msg 6556, Level 16, State 1, Line 29
CREATE AGGREGATE failed because it could not find type 'Physics.Aggregate' in assembly 'TransitiveClosureAggregatorLibrary'.
Msg 6597, Level 16, State 2, Line 29
CREATE AGGREGATE failed.

Completion time: 2023-07-30T08:10:47.1531548-07:00

What is "Run the RECONFIGURE statement to install"? Am I missing a script?
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Jul 30, 2023 12:22 pm

Hi LTAm,

Looks like the Reconfigured was okay. CLR was enabled and can be seen by the server.

The .dll location may need to be changed to a more accessible folder with the .dll copied there.  C:\tempfolder\.dll

The name of the function in the .dll is TransitiveClosure hence the CREATE Aggregate TransitiveClosre External name needs to be named the function call instead of Physics.Aggregate.

Try to imitate the original CREATE Assembly and CREATE Aggregate in the original SQL statement. CLR is enabled. Just mapping the naming conventions now.

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Jul 30, 2023 1:28 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Tccins10
The latest output.

1. Copied TransitiveClosureAggregatorLibrary.dll to a new tempfolder and pointed to it.
2. Changed [Physics].[Physics.Aggregate] to [Physics].[TransitiveClosure]
TransitiveClosureAggregatorLibrary.dll sure looks unusual when opened in Notepad++.

Ran just the highlighted sql.

Pardon the long delays, I'm also doing chores here.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Sun Jul 30, 2023 5:01 pm

Arggh. Okay

Maybe try this:
Code:

[b]USE Physics
GO
[/b]
DROP AGGREGATE IF EXISTS TCC
GO
DROP ASSEMBLY IF EXISTS [TransitiveClosure]
GO

/*
Create assembly and UDA
NOTE: make sure permission on the file let SQL Server to access it
*/
CREATE ASSEMBLY [TransitiveClosure]
FROM C:\tempfolder\TransitiveClosureAggregatorLibrary.dll'
WITH PERMISSION_SET=SAFE
GO

CREATE AGGREGATE TCC(@id1 INT, @id2 INT)  
RETURNS NVARCHAR(MAX)  
EXTERNAL NAME [TransitiveClosure].[TransitiveClosure.Aggregate];  
GO



Last edited by Chromium6 on Mon Jul 31, 2023 10:26 pm; edited 1 time in total

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Sun Jul 30, 2023 5:47 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Tccins11
Current output.

Added single quotes to the dll location and ran the latest highlighted script.

We must be getting closer.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Mon Jul 31, 2023 10:31 pm

What do you see with these queries?
It should look like something below... if it is try to run one of the TCC queries above. It may be giving too much detail if it is already registered.
-------
Code:
USE Physics
GO

SELECT * FROM sys.assemblies ;
SELECT * FROM sys.assembly_files;
SELECT * FROM sys.assembly_modules;

Miles Periodic Table with Standard Periodic Table reference - Page 8 Tccsys10

Try this if there still are issues (point to the .dll location):
Code:
ALTER ASSEMBLY TransitiveClosure
FROM 'C:\tempfolder\TransitiveClosureAggregatorLibrary.dll'

https://serverfault.com/questions/323014/how-to-update-a-clr-assembly-without-dropping-assembly-from-sql-server

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Aug 01, 2023 9:08 am

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Assych10
A little difficult to read at 90%. The third select output appears to be missing.

Tried to run
Code:
ALTER ASSEMBLY TransitiveClosure
FROM 'C:\tempfolder\TransitiveClosureAggregatorLibrary.dll'

And received the output message.
Code:
Msg 15151, Level 16, State 1, Line 4
Cannot alter the assembly 'TransitiveClosure', because it does not exist or you do not have permission.

Completion time: 2023-08-01T05:54:56.7702312-07:00

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Tue Aug 01, 2023 8:06 pm

Try to drop the assembly again. Then put the .dll in a local folder outside of the mssql folder. Looks like server can't access the file.

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Aug 01, 2023 9:50 pm



Cr6 wrote. “Try to drop the assembly again”.
Code:
USE Physics
GO

DROP ASSEMBLY IF EXISTS [TransitiveClosure]
GO

Code:
Commands completed successfully.

Completion time: 2023-08-01T18:09:00.3654888-07:00

Cr6 wrote. “Then put the .dll in a local folder outside of the mssql folder. Looks like server can't access the file’”.
Airman. Let me make sure I read that correctly. I created ‘alocalfolder’ with the dll file alongside the MSSQL folder at,
C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\alocalfolder\TransitiveClosureAggregatorLibrary.dll.

Awaiting your confirmation that this dll file location is acceptable. The dll file is now at three locations.

Awaiting further instructions. Should I try to run the CREATE ASSEMBLY [Physics] (with the new pointer) next?
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Chromium6 Tue Aug 01, 2023 11:10 pm

Yes....Try to create the assembly in something like C:\MyLocalFolder\TransitiveClosureAggregatorLibrary.dll and then try to create the aggregate.

You may want to restart the SQL Server before running the code below again.

Like try running this again if the .dll is still in this folder:
Miles Periodic Table with Standard Periodic Table reference - Page 8 Tccins11

Chromium6

Posts : 734
Join date : 2019-11-29

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by LongtimeAirman Tue Aug 01, 2023 11:36 pm

.
Miles Periodic Table with Standard Periodic Table reference - Page 8 Create10
Restarted the SQL Server and re-ran the scripts for both assembly and aggregate.
No change from the previous attempt.
.

LongtimeAirman
Admin

Posts : 2033
Join date : 2014-08-10

Back to top Go down

Miles Periodic Table with Standard Periodic Table reference - Page 8 Empty Re: Miles Periodic Table with Standard Periodic Table reference

Post by Sponsored content


Sponsored content


Back to top Go down

Page 8 of 12 Previous  1, 2, 3 ... 7, 8, 9, 10, 11, 12  Next

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum