Пример #1
0
    interpScalarVals = tf.gather_nd(avgScalarField, inputIndices)
    interpGaugeVals = tf.gather_nd(avgGaugeField, inputIndices)
    outputIndexVectorsEven = inputIndexVectors.copy()
    outputIndexVectorsEven[axis] = 2*inputIndexVectors[axis]
    outputIndicesEven = tf.stack(tf.meshgrid(outputIndexVectorsEven[0], outputIndexVectorsEven[1], outputIndexVectorsEven[2], indexing="ij"), -1)
    outputScalarField = tf.tensor_scatter_nd_update(outputScalarField, outputIndicesEven, interpScalarVals)
    outputGaugeField = tf.tensor_scatter_nd_update(outputGaugeField, outputIndicesEven, interpGaugeVals)

    return outputScalarField, outputGaugeField

B = 9
smallMagneticField = FieldTools.constantMagneticField(
    inputR, inputY, inputZ, 0, -B
    )
inputGaugeField = FieldTools.linearSuperpose(
    inputGaugeField, smallMagneticField
    )

outputScalarField, outputGaugeField = interp1d(inputScalarField, inputGaugeField, 0, theory)
outputScalarField, outputGaugeField = interp1d(outputScalarField, outputGaugeField, 1, theory)
outputScalarField, outputGaugeField = interp1d(outputScalarField, outputGaugeField, 2, theory)

outputLatShape = tf.shape(outputScalarField)[0:3]
outputParams = inputParams
outputParams["vev"] /= 2
outputParams["latShape"] = outputLatShape

r = tf.cast(
    tf.linspace(
        1/2, tf.cast(outputLatShape[0], tf.float32) - 1/2, outputLatShape[0]
        ), tf.float64
Пример #2
0
# Shift the poles around, obeying the BCs
leftGaugeField = inputGaugeField
leftScalarField = inputScalarField
rightGaugeField = inputGaugeField
rightScalarField = inputScalarField
for ii in range(shiftNumLeft):
    leftGaugeField = singlePoleTheory.shiftGaugeField(leftGaugeField, 0, +1)
    leftScalarField = singlePoleTheory.shiftScalarField(leftScalarField, 0, +1)

# Because shiftNumRight > monopoleXCoord, the monopole ends up conjugated
for ii in range(shiftNumRight):
    rightGaugeField = singlePoleTheory.shiftGaugeField(rightGaugeField, 0, +1)
    rightScalarField = singlePoleTheory.shiftScalarField(
        rightScalarField, 0, +1)

gaugeField = FieldTools.linearSuperpose(leftGaugeField, rightGaugeField)
scalarField = 0.5 * (leftScalarField + rightScalarField)

# Shift once more to centre the pair
gaugeField = tf.roll(gaugeField, -1, 0)
scalarField = tf.roll(scalarField, -1, 0)

numFluxQuanta = args.externalField
# Negative flux quanta results in lowering of energy (dipole points along
# negative x axis)
magField = FieldTools.constantMagneticField(X, Y, Z, 0, -numFluxQuanta)
gaugeField = FieldTools.linearSuperpose(gaugeField, magField)

gaugeFieldVar = tf.Variable(gaugeField, trainable=True)
scalarFieldVar = tf.Variable(scalarField, trainable=True)
Пример #3
0
inputParams = np.load(inputPath + "/params.npy", allow_pickle=True).item()

# Halve the lattice and field size
inputShape = tf.shape(inputX)
R = inputX[int(inputShape[0]) // 2:, ...]
Y = inputY[int(inputShape[0]) // 2:, ...]
Z = inputZ[int(inputShape[0]) // 2:, ...]
latShape = tf.shape(R)

scalarField = inputScalarField[int(inputShape[0]) // 2:, ...]
gaugeField = inputGaugeField[int(inputShape[0]) // 2:, ...]

# Add magnetic field if required
numFluxQuanta = args.externalField
magField = FieldTools.constantMagneticField(R, Y, Z, 0, numFluxQuanta)
gaugeField = FieldTools.linearSuperpose(gaugeField, magField)

# Theory parameters
params = {
    "vev": args.vev,
    "selfCoupling": args.selfCoupling,
    "gaugeCoupling": args.gaugeCoupling,
    "latShape": latShape
}

theory = GeorgiGlashowRadialTheory(params)

scalarFieldVar = tf.Variable(scalarField)
gaugeFieldVar = tf.Variable(gaugeField)